HandSkeleton component for hand tracking with UnityXR.
Important note: although the Unity XR SDK implements this interface no known device is supporting it at the moment. The added value of this component is therefore limited. Also: because of this limitation this component is untested! See: https://forum.unity.com/threads/xr-interaction-toolkit-and-hand-tracking-2022.1323330/
|
enum | BoneId {
Invalid = -1
, Hand = 0
, ThumbProximal
, ThumbIntermediate
,
ThumbDistal
, ThumbTip
, IndexMetaCarpal
, IndexProximal
,
IndexIntermediate
, IndexDistal
, IndexTip
, MiddleMetaCarpal
,
MiddleProximal
, MiddleIntermediate
, MiddleDistal
, MiddleTip
,
RingMetaCarpal
, RingProximal
, RingIntermediate
, RingDistal
,
RingTip
, LittleMetacarpal
, LittleProximal
, LittleIntermediate
,
LittleDistal
, LittleTip
, Forearm
, Count
} |
|
|
override void | UpdateComponent () |
| Update the component manually.
|
|
virtual GameObject | CreateHandSkeleton (Transform trackerTransform, bool isLeft, bool showRealObjects) |
|
virtual Transform | GetForearmBone () |
|
virtual Transform | GetWristBone () |
|
virtual Transform | GetBoneTransform (Finger finger, FingerBone fingerBone) |
| Gets the transform of the tracked bone.
|
|
virtual int | GetBoneId (Finger finger, FingerBone fingerBone) |
|
virtual void | Show (bool showModel) |
| Show or hide the rendered model of the sensor.
|
|
virtual void | StartComponent (Transform trackerTransform) |
| Start the manual updating of the sensor.
|
|
|
TrackerComponent | tracker |
|
bool | isLeft |
| True: this is a left hand. Fale: this is a right hand.
|
|
new bool | show = false |
| Determines whether this skeleton should be rendered.
|
|
Tracker.Status | status |
| The tracking status of the sensor.
|
|
float | rotationConfidence |
| The confidence (0..1) of the tracked rotation.
|
|
float | positionConfidence |
| The confidence (0..1) of the tracked position.
|
|
bool | autoUpdate = true |
| Is used to set whether the sensor updates itself.
|
|
GameObject | model |
|
|
override void | Start () |
| Starts the sensor.
|
|
virtual void | OnDeviceConnected (InputDevice device) |
| Hand is detected?
|
|
virtual void | OnDeviceDisconnected (InputDevice device) |
| Hand is lost.
|
|
override void | InitializeSkeleton () |
| This function is used to initialize the tracked bones.
|
|
void | UpdateFinger (ref int boneIx, Hand handData, HandFinger fingerId) |
|
void | UpdateSkeletonRender () |
| Updates the rendering of the bones.
|
|
void | EnableRenderer () |
|
void | DisableRenderer () |
|
virtual void | ShowModel (string resourceName) |
| Try to add a rendered model to the sensor.
|
|
virtual void | CreateModel (string resourceName) |
| Add a rendered model to the sensor.
|
|
virtual void | Awake () |
| Initializes the sensor.
|
|
|
InputDevice | device |
|
XRNode | xrNode |
|
List< TrackedBone > | bones |
| The list of tracked bones.
|
|
bool | rendered |
|
Transform | trackerTransform |
| The transform which is used as the root of the tracking space.
|
|
bool | _show |
|
|
bool | renderController [set] |
| Enable or disable the renderers for this sensor.
|
|
◆ Start()
override void Passer.Tracking.UnityXRHandSkeleton.Start |
( |
| ) |
|
|
protectedvirtual |
◆ OnDeviceConnected()
virtual void Passer.Tracking.UnityXRHandSkeleton.OnDeviceConnected |
( |
InputDevice |
device | ) |
|
|
protectedvirtual |
Hand is detected?
- Parameters
-
device | The InputDevice of the hand |
◆ OnDeviceDisconnected()
virtual void Passer.Tracking.UnityXRHandSkeleton.OnDeviceDisconnected |
( |
InputDevice |
device | ) |
|
|
protectedvirtual |
Hand is lost.
This also happens when the hand is no longer tracked.
- Parameters
-
device | The InputDevice of the hand |
◆ InitializeSkeleton()
override void Passer.Tracking.UnityXRHandSkeleton.InitializeSkeleton |
( |
| ) |
|
|
protectedvirtual |
◆ UpdateComponent()
override void Passer.Tracking.UnityXRHandSkeleton.UpdateComponent |
( |
| ) |
|
|
virtual |
◆ GetBoneTransform()
virtual Transform Passer.Tracking.HandSkeleton.GetBoneTransform |
( |
Finger |
finger, |
|
|
FingerBone |
fingerBone |
|
) |
| |
|
virtualinherited |
Gets the transform of the tracked bone.
- Parameters
-
finger | The requested finger |
fingerBone | The requested bone in the finger |
- Returns
- The tracked bon transform of null if it does not exist
Reimplemented in Passer.Tracking.LeapHandSkeleton.
◆ ShowModel()
virtual void Passer.Tracking.SensorComponent.ShowModel |
( |
string |
resourceName | ) |
|
|
protectedvirtualinherited |
Try to add a rendered model to the sensor.
- Parameters
-
resourceName | The name of the resource to use for the model |
No new model is added when it already has a model
◆ CreateModel()
virtual void Passer.Tracking.SensorComponent.CreateModel |
( |
string |
resourceName | ) |
|
|
protectedvirtualinherited |
Add a rendered model to the sensor.
- Parameters
-
resourceName | The name of the resource to use for the model |
Any existing model will be destroyed and replaced.
◆ Show()
virtual void Passer.Tracking.SensorComponent.Show |
( |
bool |
showModel | ) |
|
|
virtualinherited |
Show or hide the rendered model of the sensor.
- Parameters
-
showModel | True will show the mode, False will hide it |
◆ Awake()
virtual void Passer.Tracking.SensorComponent.Awake |
( |
| ) |
|
|
protectedvirtualinherited |
◆ StartComponent()
virtual void Passer.Tracking.SensorComponent.StartComponent |
( |
Transform |
trackerTransform | ) |
|
|
virtualinherited |
Start the manual updating of the sensor.
- Parameters
-
When this function has been called, autoUpdate will be disabled and the sensor will no longer update from Unity Updates. Instead, UpdateComponent needs to be called to update the sensor data
◆ autoUpdate
bool Passer.Tracking.SensorComponent.autoUpdate = true |
|
inherited |
Is used to set whether the sensor updates itself.
When enabled, the sensor will update itself. When disabled, StartComponent and UpdateComponent need to be called to update the tracking status.
The documentation for this class was generated from the following file:
- d:/Unity/Humanoid4/Humanoid4_Pro/Assets/humanoidcontrol4_pro/Runtime/HumanoidControl/Scripts/Extensions/UnityXR/UnityXRHandSkeleton.cs