Drag[en]gine Script Module DragonScript
1.23
|
Behavior adding support to apply hand pose to VR Hand. More...
Classes | |
class | Instance |
Behavior instance. More... | |
Public Member Functions | |
void | dispose () |
Dispose of behavior. More... | |
ECPString | getBoneIndex1 () |
Index bone name. More... | |
ECPString | getBoneIndex2 () |
ECPString | getBoneIndex3 () |
ECPString | getBoneIndex4 () |
ECPString | getBoneMiddle1 () |
Middle bone name. More... | |
ECPString | getBoneMiddle2 () |
ECPString | getBoneMiddle3 () |
ECPString | getBoneMiddle4 () |
ECPString | getBoneOrigin () |
Origin bone name. More... | |
ECPString | getBonePinky1 () |
Pinky bone name. More... | |
ECPString | getBonePinky2 () |
ECPString | getBonePinky3 () |
ECPString | getBonePinky4 () |
ECPString | getBoneRing1 () |
Ring bone name. More... | |
ECPString | getBoneRing2 () |
ECPString | getBoneRing3 () |
ECPString | getBoneRing4 () |
ECPString | getBoneThumb1 () |
Thumb bone name. More... | |
ECPString | getBoneThumb2 () |
ECPString | getBoneThumb3 () |
ECPString | getBoneWrist () |
Wrist bone name. More... | |
ECPBoolean | getEnabled () |
Enable hand pose. More... | |
ECPFloat | getFingerTipDistance () |
Distance between middle finger tip and wrist in fully stretched pose. More... | |
ECPBoolean | getOnlyRotation () |
Apply only rotation instead of position and rotation. More... | |
ECBehaviorVRHand | getVRHand () |
VR Hand behavior or null. More... | |
Instance | instance (BehaviorElement element) |
Get instance in element from owner element class. More... | |
ECBehaviorVRHandPose | new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand) |
Create behavior element class. More... | |
ECBehaviorVRHandPose | new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id) |
Create behavior element class. More... | |
ECBehaviorVRHandPose | new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id, String prefix) |
Create behavior element class. More... | |
void | setHandBoneNames (bool rightHand) |
Set finger names to default names with hand prefix. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
String | getID () |
Identifier. More... | |
int | getInstanceIndex () |
Instance index. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
Load instance data of another behavior. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading instance data of another behavior. More... | |
Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
ECBehaviorInstance | createInstance (BehaviorElement element) |
Create Behavior instance. More... | |
Static Public Member Functions | |
static ECBehaviorVRHandPose | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
DefaultECBehavior | new (BehaviorElementClass eclass) |
Create default composeable behavior with empty identifier. More... | |
DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
Create default composeable behavior. More... | |
void | setBehaviorID (String identifier) |
Set behavior identifier. More... | |
void | useClassNameAsBehaviorID () |
Set behavior identifier to "<class-name>:<identifier>". More... | |
void | useFullyQualifiedClassNameAsBehaviorID () |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More... | |
Behavior adding support to apply hand pose to VR Hand.
Behavior queries VR hand device for bone poses and applies them to the VR hand component.
Creates an animator to apply the states. This allows to chain other animators like ECBehaviorActorAnimated for best performance. The bone names can be modified to adjust to rigs using different names.
The default bone names are these:
Models of varying size can be used.
By default only rotation of bones are used. If you want to use also positions you have first to set "onlyRotation" element class property to false. Using models with position transfer requires some additional care to work properly. In particular the model rig has to match as closely as possible the rig used by the VR runtime except for scaling. The behavior scales the input data to fit the model size. For this process to wor you have to measure the distance from the middle finger tip bone to the wrist bone. Use the base of these bones not their tails (in Blender3D). Set this values as the "fingerTipDistance" element class property:
The default distance is 0.165 which is a measuring of a typical VR hand model.
Requires these behaviors to be present:
void Dragengine.Scenery.ECBehaviorVRHandPose.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorVRHandPose.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex1 | ( | ) |
Index bone name.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex2 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex3 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex4 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle1 | ( | ) |
Middle bone name.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle2 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle3 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle4 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneOrigin | ( | ) |
Origin bone name.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky1 | ( | ) |
Pinky bone name.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky2 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky3 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky4 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing1 | ( | ) |
Ring bone name.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing2 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing3 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing4 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneThumb1 | ( | ) |
Thumb bone name.
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneThumb2 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneThumb3 | ( | ) |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneWrist | ( | ) |
Wrist bone name.
ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.getEnabled | ( | ) |
Enable hand pose.
ECPFloat Dragengine.Scenery.ECBehaviorVRHandPose.getFingerTipDistance | ( | ) |
Distance between middle finger tip and wrist in fully stretched pose.
ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.getOnlyRotation | ( | ) |
Apply only rotation instead of position and rotation.
ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPose.getVRHand | ( | ) |
VR Hand behavior or null.
Instance Dragengine.Scenery.ECBehaviorVRHandPose.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.new | ( | BehaviorElementClass | eclass, |
ECBehaviorVRHand | vrHand | ||
) |
Create behavior element class.
ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.new | ( | BehaviorElementClass | eclass, |
ECBehaviorVRHand | vrHand, | ||
String | id | ||
) |
Create behavior element class.
ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.new | ( | BehaviorElementClass | eclass, |
ECBehaviorVRHand | vrHand, | ||
String | id, | ||
String | prefix | ||
) |
Create behavior element class.
void Dragengine.Scenery.ECBehaviorVRHandPose.setHandBoneNames | ( | bool | rightHand | ) |
Set finger names to default names with hand prefix.
For example "wrist" becomes "wrist.r" if rightHand is true otherwise "wrist.l"
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneIndex1 |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneMiddle1 |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneOrigin |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBonePinky1 |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneRing1 |
ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneThumb1 |
ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.pEnabled |
ECPFloat Dragengine.Scenery.ECBehaviorVRHandPose.pFingerTipDistance |
ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPose.pVRHand |