Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ECBehaviorVRHandPose Class Reference

Behavior adding support to apply hand pose to VR Hand. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorVRHandPose:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

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...
 

Detailed Description

Behavior adding support to apply hand pose to VR Hand.

Version
1.7

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:

  • Origin set to VR Hand: origin
  • Wrist: hand
  • Thumb: thumb1, thumb2, thumb3
  • Index: index1, index2, index3, index4
  • Middle: middle1, middle2, middle3, middle4
  • Ring: ring1, ring2, ring3, ring4
  • Pinky: pinky1, pinky2, pinky3, pinky4

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:

ECPFloat getFingerTipDistance()
Distance between middle finger tip and wrist in fully stretched pose.
void setValue(Object value)
Set value of property from XML decoded value.

The default distance is 0.165 which is a measuring of a typical VR hand model.

Requires these behaviors to be present:

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorVRHandPose.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getBehaviorIn()

static ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.getBehaviorIn ( BehaviorElementClass  eclass)
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.

◆ getBoneIndex1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex1 ( )

Index bone name.

◆ getBoneIndex2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex2 ( )

◆ getBoneIndex3()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex3 ( )

◆ getBoneIndex4()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneIndex4 ( )

◆ getBoneMiddle1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle1 ( )

Middle bone name.

◆ getBoneMiddle2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle2 ( )

◆ getBoneMiddle3()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle3 ( )

◆ getBoneMiddle4()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle4 ( )

◆ getBoneOrigin()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneOrigin ( )

Origin bone name.

◆ getBonePinky1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky1 ( )

Pinky bone name.

◆ getBonePinky2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky2 ( )

◆ getBonePinky3()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky3 ( )

◆ getBonePinky4()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky4 ( )

◆ getBoneRing1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing1 ( )

Ring bone name.

◆ getBoneRing2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing2 ( )

◆ getBoneRing3()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing3 ( )

◆ getBoneRing4()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing4 ( )

◆ getBoneThumb1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneThumb1 ( )

Thumb bone name.

◆ getBoneThumb2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneThumb2 ( )

◆ getBoneThumb3()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneThumb3 ( )

◆ getBoneWrist()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneWrist ( )

Wrist bone name.

◆ getEnabled()

ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.getEnabled ( )

Enable hand pose.

◆ getFingerTipDistance()

ECPFloat Dragengine.Scenery.ECBehaviorVRHandPose.getFingerTipDistance ( )

Distance between middle finger tip and wrist in fully stretched pose.

◆ getOnlyRotation()

ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.getOnlyRotation ( )

Apply only rotation instead of position and rotation.

◆ getVRHand()

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPose.getVRHand ( )

VR Hand behavior or null.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorVRHandPose.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/3]

ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand 
)

Create behavior element class.

◆ new() [2/3]

ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
String  id 
)

Create behavior element class.

◆ new() [3/3]

ECBehaviorVRHandPose Dragengine.Scenery.ECBehaviorVRHandPose.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
String  id,
String  prefix 
)

Create behavior element class.

◆ setHandBoneNames()

void Dragengine.Scenery.ECBehaviorVRHandPose.setHandBoneNames ( bool  rightHand)

Set finger names to default names with hand prefix.

Version
1.10

For example "wrist" becomes "wrist.r" if rightHand is true otherwise "wrist.l"


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