Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Properties | List of all members
Passer.Humanoid.LeapTracker Class Reference

Description

Leap Motion enables detailed hand tracking with markerless optical detection. Individual finger movements can be tracked.

Prerequisites

Leap Motion is supported in Humanoid Control Plus and Pro

Hardware

HMD mounted Leap Motion is supported when it is mounted on Oculus Rift, HTC Vive or Windows Mixed Reality using the Leap Motion VR Developer Mount.

Operating System

Leap Motion is supported on Microsoft Windows 10.

Runtime

Leap Motion software version 4 or higher is required

Setup

For Leap Motion to work, the Leap Motion Unity Core Assets needs to be imported into the project. Go to Edit Menu->Preferences->Humanoid Control and look for the Leap Motion Support entry.

Click the button to go to the download page for the Leap Motion assets. From the SDK, you only need to import the core.unitypackage.

After the assets have been imported, Leap Motion Support will be enabled automatically in the preferences.

Inspector

To enable tracking with Leap Motion for a humanoid, Leap Motion needs to be enabled in the HumanoidControl Component:

By default the LeapMotion object is not visible in the scene, but it will be created automatically when the scene starts. If the button Show is pressed, the Leap Motion object will be created in the Real World object.

Leap Motion (LeapMotion) is a reference to the object in the scene representing the Leap Motion Sensor. This GameObject is found as a child of the Real World GameObject. It is only rendered in the scene when HumanoidControl->Settings->Show Real Objects has been enabled. The LeapMotion GameObject can be used to set the position of the tracking relative to the player in the scene.

See also
Inheritance diagram for Passer.Humanoid.LeapTracker:
Passer.Humanoid.HumanoidTracker Passer.Tracking.Tracker

Public Types

enum  Status { Unavailable , Present , Tracking }
 The tracking status. More...
 

Public Member Functions

override void CheckTracker (HumanoidControl humanoid)
 Check the presence of a LeapMotion object and creates one if it does not exist.
 
void CheckTrackerOnHmd (HumanoidControl humanoid, TrackerGetter getTracker, Vector3 localPosition, Quaternion localRotation)
 Function to check the status of a specific tracker.
 
override void StartTracker (HumanoidControl _humanoid)
 Start the tracker.
 
override void StopTracker ()
 Stop the tracker.
 
override void UpdateTracker ()
 Update the tracker state.
 
void PlaceTrackerTransform (bool isHeadMounted)
 
void SetTrackerToTarget ()
 
void UpdateTrackerFromTarget (bool isHeadMounted)
 
void CheckTracker (HumanoidControl humanoid, TrackerGetter getTracker)
 Function to check the status of a specific tracker.
 
void CheckTracker (HumanoidControl humanoid, TrackerGetter getTracker, Vector3 localPosition, Quaternion localRotation)
 Function to check the status of a specific tracker.
 
delegate TrackerComponent TrackerGetter (Transform transform, Vector3 localPosition, Quaternion localRotation)
 Function delegate for retrieving the tracker.
 
virtual Vector3 GetBonePosition (uint actorId, FacialBone boneId)
 
virtual Quaternion GetBoneRotation (uint actorId, FacialBone boneId)
 
virtual float GetBoneConfidence (uint actorId, FacialBone boneId)
 
virtual void StartTracker ()
 Optional list of SubTrackers.
 
virtual void ShowTracker (bool shown)
 Show or hide the Tracker renderers.
 
virtual void Calibrate ()
 Calibrate the tracker.
 
virtual void AdjustTracking (Vector3 positionalDelta, Quaternion rotationalDelta)
 Adjust the position of the tracker by the given delat.
 

Public Attributes

LeapDevice device
 
bool isHeadMounted = true
 Is the LeapMotion mounted on an HMD?
 
HumanoidControl humanoid
 The humanoid for this tracker.
 
bool enabled
 Is this tracker enabled?
 
Status status
 The tracking Status of the tracker.
 
TrackerComponent trackerComponent
 The tracking device.
 

Protected Attributes

bool useLeapPackage = false
 
Vector3 headTrackerPosition
 
Quaternion headTrackerRotation
 

Properties

override string name [get]
 
override ArmSensor leftHandSensor [get]
 
override ArmSensor rightHandSensor [get]
 
override HumanoidSensor[] sensors [get]
 
virtual HeadSensor headSensor [get]
 Get the sensor for the head.
 
virtual TorsoSensor hipsSensor [get]
 Get the sensor for the hips.
 
virtual LegSensor leftFootSensor [get]
 Get the sensor for the left foot.
 
virtual LegSensor rightFootSensor [get]
 Get the sensor for the right foot.
 

Member Enumeration Documentation

◆ Status

The tracking status.

Enumerator
Unavailable 

The tracking device is not available.

Present 

The tracking device is available but not tracking.

Tracking 

The tracking device is actively tracking.

Member Function Documentation

◆ CheckTracker() [1/3]

override void Passer.Humanoid.LeapTracker.CheckTracker ( HumanoidControl  humanoid)
virtual

Check the presence of a LeapMotion object and creates one if it does not exist.

Parameters
humanoidThe humanoid for which the tracker needs to be checked

Reimplemented from Passer.Humanoid.HumanoidTracker.

◆ CheckTrackerOnHmd()

void Passer.Humanoid.LeapTracker.CheckTrackerOnHmd ( HumanoidControl  humanoid,
TrackerGetter  getTracker,
Vector3  localPosition,
Quaternion  localRotation 
)

Function to check the status of a specific tracker.

Parameters
humanoidThe humanoid for which the tracker needs to be checked
getTrackerFunction delegate to retrieve the tracker
localPositionThe default local position of the tracker
localRotationThe default local rotation of the tracker

◆ StartTracker() [1/2]

override void Passer.Humanoid.LeapTracker.StartTracker ( HumanoidControl  _humanoid)
virtual

Start the tracker.

Reimplemented from Passer.Humanoid.HumanoidTracker.

◆ StopTracker()

override void Passer.Humanoid.LeapTracker.StopTracker ( )
virtual

Stop the tracker.

Reimplemented from Passer.Tracking.Tracker.

◆ UpdateTracker()

override void Passer.Humanoid.LeapTracker.UpdateTracker ( )
virtual

Update the tracker state.

Reimplemented from Passer.Tracking.Tracker.

◆ CheckTracker() [2/3]

void Passer.Humanoid.HumanoidTracker.CheckTracker ( HumanoidControl  humanoid,
TrackerGetter  getTracker 
)
inherited

Function to check the status of a specific tracker.

Parameters
humanoidThe humanoid for which the tracker needs to be checked
getTrackerFunction delegate to retrieve the tracker

The default position/rotation for the tracker when created will be zero

◆ CheckTracker() [3/3]

void Passer.Humanoid.HumanoidTracker.CheckTracker ( HumanoidControl  humanoid,
TrackerGetter  getTracker,
Vector3  localPosition,
Quaternion  localRotation 
)
inherited

Function to check the status of a specific tracker.

Parameters
humanoidThe humanoid for which the tracker needs to be checked
getTrackerFunction delegate to retrieve the tracker
localPositionThe default local position of the tracker
localRotationThe default local rotation of the tracker

◆ TrackerGetter()

delegate TrackerComponent Passer.Humanoid.HumanoidTracker.TrackerGetter ( Transform  transform,
Vector3  localPosition,
Quaternion  localRotation 
)
inherited

Function delegate for retrieving the tracker.

Parameters
transformThe root transform to start the searching of the tracker
localPositionThe default local position of the tracker
localRotationThe default local rotation of the tracker
Returns
The tracker component found or created

The default position/rotation is relative to the humanoid's real world.

◆ StartTracker() [2/2]

virtual void Passer.Tracking.Tracker.StartTracker ( )
virtualinherited

Optional list of SubTrackers.

Start the tracker

◆ ShowTracker()

virtual void Passer.Tracking.Tracker.ShowTracker ( bool  shown)
virtualinherited

Show or hide the Tracker renderers.

Parameters
shownRenderers are enabled when shown == true

◆ Calibrate()

virtual void Passer.Tracking.Tracker.Calibrate ( )
virtualinherited

Calibrate the tracker.

Reimplemented in Passer.Humanoid.UnityXRTracker.

◆ AdjustTracking()

virtual void Passer.Tracking.Tracker.AdjustTracking ( Vector3  positionalDelta,
Quaternion  rotationalDelta 
)
virtualinherited

Adjust the position of the tracker by the given delat.

Parameters
positionalDeltaThe positional delta to apply
rotationalDeltaThe rotational delta to apply

Member Data Documentation

◆ isHeadMounted

bool Passer.Humanoid.LeapTracker.isHeadMounted = true

Is the LeapMotion mounted on an HMD?

When enabled, the LeapMotion device will follow the movement of the hmd. And hand tracking will be relative to the hmd.

Property Documentation

◆ name

override string Passer.Humanoid.LeapTracker.name
get

◆ leftHandSensor

override ArmSensor Passer.Humanoid.LeapTracker.leftHandSensor
get

◆ rightHandSensor

override ArmSensor Passer.Humanoid.LeapTracker.rightHandSensor
get

◆ headSensor

virtual HeadSensor Passer.Humanoid.HumanoidTracker.headSensor
getinherited

Get the sensor for the head.

Will return null when this sensor is not present

◆ hipsSensor

virtual TorsoSensor Passer.Humanoid.HumanoidTracker.hipsSensor
getinherited

Get the sensor for the hips.

Will return null when this sensor is not present

◆ leftFootSensor

virtual LegSensor Passer.Humanoid.HumanoidTracker.leftFootSensor
getinherited

Get the sensor for the left foot.

Will return null when this sensor is not present

◆ rightFootSensor

virtual LegSensor Passer.Humanoid.HumanoidTracker.rightFootSensor
getinherited

Get the sensor for the right foot.

Will return null when this sensor is not present


The documentation for this class was generated from the following file: