API reference
API reference
Select your platform
No SDKs available
No versions available

SyntheticHand Class

Used primarily for touch limiting (modifying the motion of a tracked IHand so that it doesn't penetrate surfaces) during pokes and custom poses during grabs.
Alters hand data piped into this modifier to lock and unlock joints (wrist position and rotation, finger joint rotations). When switching between locked and unlocked states, additionally smooths out transitions by easing between source hand data and target hand data.

Fields

UpdateRequired : System.Action
A signal which can be used to alert observers that the SyntheticHand should be updated.
Signature
System.Action Oculus.Interaction.Input.SyntheticHand.UpdateRequired

Protected Methods

Apply ( data )
Signature
override void Oculus.Interaction.Input.SyntheticHand.Apply(HandDataAsset data)
Parameters
Returns
override void
Start ()
Signature
override void Oculus.Interaction.Input.SyntheticHand.Start()
Returns
override void

Methods

FreeAllJoints ()
Short-hand method for setting the freedom level of all fingers in a hand to Free.
Similar to calling SetFingerFreedom for each single finger in the hand with a value of FingerFreedom.Free for the freedomLevel
Signature
void Oculus.Interaction.Input.SyntheticHand.FreeAllJoints()
Returns
void
FreeWrist ( lockMode )
Unlocks the hand (locked using LockWristPose(Pose, float, WristLockMode, bool, bool) or one of its sibling methods) starting a timer for the smooth release animation.
Signature
void Oculus.Interaction.Input.SyntheticHand.FreeWrist(WristLockMode lockMode=WristLockMode.Full)
Parameters
lockMode: WristLockMode
Returns
void
GetJointFreedom ( jointId )
Queries the current JointFreedom for the specified finger.
Signature
JointFreedom Oculus.Interaction.Input.SyntheticHand.GetJointFreedom(in HandJointId jointId)
Parameters
jointId: in HandJointId  The finger, specified as a HandJointId
Returns
JointFreedom  The JointFreedom of the specified finger
InjectAllSyntheticHandModifier ( updateMode , updateAfter , modifyDataFromSource , applyModifier , wristPositionLockCurve , wristPositionUnlockCurve , wristRotationLockCurve , wristRotationUnlockCurve , jointLockCurve , jointUnlockCurve , spreadAllowance )
Injects all required dependencies for a dynamically instantiated SyntheticHand; effectively wraps Hand.InjectAllHand(DataSource<HandDataAsset>.UpdateModeFlags, IDataSource, DataModifier<HandDataAsset>, bool), InjectWristPositionLockCurve(ProgressCurve), InjectWristPositionUnlockCurve(ProgressCurve), InjectWristRotationLockCurve(ProgressCurve), InjectWristRotationUnlockCurve(ProgressCurve), InjectJointLockCurve(ProgressCurve), InjectJointUnlockCurve(ProgressCurve), and InjectSpreadAllowance(float).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectAllSyntheticHandModifier(UpdateModeFlags updateMode, IDataSource updateAfter, DataModifier< HandDataAsset > modifyDataFromSource, bool applyModifier, ProgressCurve wristPositionLockCurve, ProgressCurve wristPositionUnlockCurve, ProgressCurve wristRotationLockCurve, ProgressCurve wristRotationUnlockCurve, ProgressCurve jointLockCurve, ProgressCurve jointUnlockCurve, float spreadAllowance)
Parameters
updateMode: UpdateModeFlags
updateAfter: IDataSource
modifyDataFromSource: DataModifier< HandDataAsset >
applyModifier: bool
wristPositionLockCurve: ProgressCurve
wristPositionUnlockCurve: ProgressCurve
wristRotationLockCurve: ProgressCurve
wristRotationUnlockCurve: ProgressCurve
jointLockCurve: ProgressCurve
jointUnlockCurve: ProgressCurve
spreadAllowance: float
Returns
void
InjectJointLockCurve ( jointLockCurve )
Adds a ProgressCurve to a dynamically instantiated SyntheticHand as the animation curve for joint locking.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectJointLockCurve(ProgressCurve jointLockCurve)
Parameters
jointLockCurve: ProgressCurve
Returns
void
InjectJointUnlockCurve ( jointUnlockCurve )
Adds a ProgressCurve to a dynamically instantiated SyntheticHand as the animation curve for joint unlocking.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectJointUnlockCurve(ProgressCurve jointUnlockCurve)
Parameters
jointUnlockCurve: ProgressCurve
Returns
void
InjectSpreadAllowance ( spreadAllowance )
Adds a floating point value to a dynamically instantiated SyntheticHand as spread allowance.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectSpreadAllowance(float spreadAllowance)
Parameters
spreadAllowance: float
Returns
void
InjectWristPositionLockCurve ( wristPositionLockCurve )
Adds a ProgressCurve to a dynamically instantiated SyntheticHand as the animation curve for wrist position locking.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectWristPositionLockCurve(ProgressCurve wristPositionLockCurve)
Parameters
wristPositionLockCurve: ProgressCurve
Returns
void
InjectWristPositionUnlockCurve ( wristPositionUnlockCurve )
Adds a ProgressCurve to a dynamically instantiated SyntheticHand as the animation curve for wrist position unlocking.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectWristPositionUnlockCurve(ProgressCurve wristPositionUnlockCurve)
Parameters
wristPositionUnlockCurve: ProgressCurve
Returns
void
InjectWristRotationLockCurve ( wristRotationLockCurve )
Adds a ProgressCurve to a dynamically instantiated SyntheticHand as the animation curve for wrist rotation locking.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectWristRotationLockCurve(ProgressCurve wristRotationLockCurve)
Parameters
wristRotationLockCurve: ProgressCurve
Returns
void
InjectWristRotationUnlockCurve ( wristRotationUnlockCurve )
Adds a ProgressCurve to a dynamically instantiated SyntheticHand as the animation curve for wrist rotation unlocking.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.Input.SyntheticHand.InjectWristRotationUnlockCurve(ProgressCurve wristRotationUnlockCurve)
Parameters
wristRotationUnlockCurve: ProgressCurve
Returns
void
LockFingerAtCurrent ( finger )
Immediately locks an individual HandFinger (all its internal joints) at the last known value.
Signature
void Oculus.Interaction.Input.SyntheticHand.LockFingerAtCurrent(in HandFinger finger)
Parameters
finger: in HandFinger  The finger for which to lock joints.
Returns
void
LockJoint ( jointId , rotation , overrideFactor )
Locks a specified joint to a specified overriding rotation.
Note that, because this is locking rather than interpolating, overrideFactor is not used by this call.
Signature
void Oculus.Interaction.Input.SyntheticHand.LockJoint(in HandJointId jointId, Quaternion rotation, float overrideFactor=1f)
Parameters
jointId: in HandJointId  The HandJointId specifying which joint to override
rotation: Quaternion  The rotation to which to lock
overrideFactor: float  Unused
Returns
void
LockWristPose ( wristPose , overrideFactor , lockMode , worldPose , skipAnimation )
Stores the desired pose to set the wrist of the hand to.
This is not necessarily the final pose of the hand, as it allows lerping between the tracked and provided one during Apply(HandDataAsset).
To ensure the hand is locked at the desired pose, pass a value of 1 in the overrideFactor
Signature
void Oculus.Interaction.Input.SyntheticHand.LockWristPose(Pose wristPose, float overrideFactor=1f, WristLockMode lockMode=WristLockMode.Full, bool worldPose=false, bool skipAnimation=false)
Parameters
wristPose: Pose  The final pose desired for the wrist
overrideFactor: float  How much to lerp between the tracked and the provided pose
lockMode: WristLockMode  Either lock the position, rotation or both (default)
worldPose: bool
skipAnimation: bool  Whether to skip the animation curve for this override.
Returns
void
LockWristPosition ( position , overrideFactor , skipAnimation )
Similar to LockWristPose(Pose, float, WristLockMode, bool, bool), but only locks the position, leaving orientation free.
Signature
void Oculus.Interaction.Input.SyntheticHand.LockWristPosition(Vector3 position, float overrideFactor=1f, bool skipAnimation=false)
Parameters
position: Vector3  The position to which to lock the wrist
overrideFactor: float  How much to lerp between the tracked and the locked position
skipAnimation: bool  Whether to skip the animation curve for this override
Returns
void
LockWristRotation ( rotation , overrideFactor , skipAnimation )
Similar to LockWristPose(Pose, float, WristLockMode, bool, bool), but only locks the rotation, leaving position free.
Signature
void Oculus.Interaction.Input.SyntheticHand.LockWristRotation(Quaternion rotation, float overrideFactor=1f, bool skipAnimation=false)
Parameters
rotation: Quaternion  The rotation to which to lock the wrist
overrideFactor: float  How much to lerp between the tracked and the locked rotation
skipAnimation: bool  Whether to skip the animation curve for this override
Returns
void
OverrideAllJoints ( jointRotations , overrideFactor )
Stores the rotation data for all joints in the hand, to be applied during Apply(HandDataAsset).
Signature
void Oculus.Interaction.Input.SyntheticHand.OverrideAllJoints(in Quaternion[] jointRotations, float overrideFactor)
Parameters
jointRotations: in Quaternion []  The joint rotations following the FingersMetadata.HAND_JOINT_IDS format.
overrideFactor: float  How much to lerp the fingers from the tracked (raw) state to the provided one.
Returns
void
OverrideFingerRotations ( finger , rotations , overrideFactor )
Stores the rotation data for all joints for the given finger, to be applied during Apply(HandDataAsset).
Signature
void Oculus.Interaction.Input.SyntheticHand.OverrideFingerRotations(HandFinger finger, Quaternion[] rotations, float overrideFactor)
Parameters
finger: HandFinger  The HandFinger for which to lock joints.
rotations: Quaternion []  The joint rotations for each joint on the finger
overrideFactor: float  How much to lerp the fingers from the tracked (raw) state to the provided one.
Returns
void
OverrideJointRotation ( jointId , rotation , overrideFactor )
Overrides the rotation value for the specified HandJointId, to be applied during Apply(HandDataAsset).
Signature
void Oculus.Interaction.Input.SyntheticHand.OverrideJointRotation(HandJointId jointId, Quaternion rotation, float overrideFactor)
Parameters
jointId: HandJointId  The HandJointId specifying which joint to override
rotation: Quaternion  The overriding rotation
overrideFactor: float  How much to lerp the fingers from the tracked (raw) state to the provided one
Returns
void
SetFingerFreedom ( finger , freedomLevel , skipAnimation )
To use in conjunction with OverrideAllJoints(in Quaternion[], float), this sets the freedom state for a provided finger.
Opposite to LockFingerAtCurrent(in HandFinger), this method uses the data provided in OverrideAllJoints(in Quaternion[], float) instead of the last known state.
Signature
void Oculus.Interaction.Input.SyntheticHand.SetFingerFreedom(in HandFinger finger, in JointFreedom freedomLevel, bool skipAnimation=false)
Parameters
finger: in HandFinger  The finger to modify, specified as a HandFinger
freedomLevel: in JointFreedom  The freedom level for the finger
skipAnimation: bool  Whether or not to animate as a result of setting
Returns
void
SetJointFreedom ( jointId , freedomLevel , skipAnimation )
To use in conjunction with OverrideAllJoints(in Quaternion[], float), this sets the freedom state for a provided finger.
Opposite to LockFingerAtCurrent(in HandFinger), this method uses the data provided in OverrideAllJoints(in Quaternion[], float) instead of the last known state.
Signature
void Oculus.Interaction.Input.SyntheticHand.SetJointFreedom(in HandJointId jointId, in JointFreedom freedomLevel, bool skipAnimation=false)
Parameters
jointId: in HandJointId  The finger to modify, specified as a HandJointId
freedomLevel: in JointFreedom  The freedom level for the finger
skipAnimation: bool  Whether to skip the animation curve for this override
Returns
void

Inner Enum

WristLockMode Enum

Enumeration of modes for "wrist locking," which is the mechanism SyntheticHand uses to alter the motion of an IHand for touch limiting.
This enum is intended to be used as a bit mask.

Enumeration Constants

MemberValue
Position
1 << 0
Rotation
1 << 1
Full
(1 << 2) - 1