Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...

Public Member Functions

void dispose ()
 Dispose of behavior.
ECPString getBoneIndex1 ()
 Index bone name.
ECPString getBoneIndex2 ()
ECPString getBoneIndex3 ()
ECPString getBoneIndex4 ()
ECPString getBoneMiddle1 ()
 Middle bone name.
ECPString getBoneMiddle2 ()
ECPString getBoneMiddle3 ()
ECPString getBoneMiddle4 ()
ECPString getBoneOrigin ()
 Origin bone name.
ECPString getBonePinky1 ()
 Pinky bone name.
ECPString getBonePinky2 ()
ECPString getBonePinky3 ()
ECPString getBonePinky4 ()
ECPString getBoneRing1 ()
 Ring bone name.
ECPString getBoneRing2 ()
ECPString getBoneRing3 ()
ECPString getBoneRing4 ()
ECPString getBoneThumb1 ()
 Thumb bone name.
ECPString getBoneThumb2 ()
ECPString getBoneThumb3 ()
ECPString getBoneWrist ()
 Wrist bone name.
ECComposeBTSM getBTSMs ()
 Compose behavior trees and state machines.
ECPBoolean getEnabled ()
 Enable hand pose.
ECPFloat getFingerTipDistance ()
 Distance between middle finger tip and wrist in fully stretched pose.
ECPBoolean getOnlyRotation ()
 Apply only rotation instead of position and rotation.
String getPrefix ()
 Prefix.
ECBehaviorVRBody getVRBody ()
 VR body to synchronize hand with or null.
ECBehaviorVRHand getVRHand ()
 VR Hand behavior or null.
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
ECBehaviorVRHandPose new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand)
 Create behavior element class.
ECBehaviorVRHandPose new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id)
 Create behavior element class.
ECBehaviorVRHandPose new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id, String prefix)
 Create behavior element class.
void setHandBoneNames (bool rightHand)
 Set finger names to default names with hand prefix.
void setVRBody (ECBehaviorVRBody vrBody)
 Set VR body to synchronize hand with.
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
String getBehaviorID ()
 Unique identifier of behavior.
String getID ()
 Identifier.
int getInstanceIndex ()
 Instance index.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.
Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.

Static Public Member Functions

static ECBehaviorVRHandPose getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.

Public Attributes

ECPString pBoneIndex1
ECPString pBoneMiddle1
ECPString pBoneOrigin
ECPString pBonePinky1
ECPString pBoneRing1
ECPString pBoneThumb1
ECComposeBTSM pBTSMs
ECPBoolean pEnabled
ECPFloat pFingerTipDistance
String pPrefix
ECBehaviorVRBody pVRBody
ECBehaviorVRHand pVRHand

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier.
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
void setBehaviorID (String identifier)
 Set behavior identifier.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

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:

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_vrhandpose

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorVRHandPose.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getBehaviorIn()

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.

References getOnlyRotation(), getVRBody(), getVRHand(), new(), pVRBody, and pVRHand.

◆ 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 ( )

References getBTSMs(), and getPrefix().

◆ getBoneMiddle1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle1 ( )

Middle bone name.

References new().

◆ getBoneMiddle2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle2 ( )

◆ getBoneMiddle3()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle3 ( )

◆ getBoneMiddle4()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneMiddle4 ( )

References new().

◆ 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 ( )

References pVRHand.

◆ getBonePinky4()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBonePinky4 ( )

References pVRBody.

◆ getBoneRing1()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing1 ( )

Ring bone name.

◆ getBoneRing2()

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.getBoneRing2 ( )

References pBoneOrigin.

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

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandPose.getBTSMs ( )

Compose behavior trees and state machines.

Version
1.26

References pBoneOrigin.

Referenced by getBoneIndex4().

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

References new().

◆ getOnlyRotation()

ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.getOnlyRotation ( )

Apply only rotation instead of position and rotation.

References new().

Referenced by getBehaviorIn().

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorVRHandPose.getPrefix ( )

Prefix.

Version
1.26

Referenced by getBoneIndex4().

◆ getVRBody()

ECBehaviorVRBody Dragengine.Scenery.ECBehaviorVRHandPose.getVRBody ( )

VR body to synchronize hand with or null.

Version
1.31

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorVRHandPose.Instance.getBone().

◆ getVRHand()

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPose.getVRHand ( )

◆ instance()

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

Get instance in element from owner element class.

References new().

Referenced by Dragengine.Scenery.ECBehaviorVRHandPose.Instance.getBone(), and Dragengine.Scenery.ECBehaviorVRHandPose.Instance.getUseVRBody().

◆ new() [1/3]

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

◆ new() [2/3]

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

Create behavior element class.

References pVRHand.

◆ 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"

References new().

◆ setVRBody()

void Dragengine.Scenery.ECBehaviorVRHandPose.setVRBody ( ECBehaviorVRBody vrBody)

Set VR body to synchronize hand with.

Version
1.31

References new().

Member Data Documentation

◆ pBoneIndex1

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneIndex1

◆ pBoneMiddle1

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneMiddle1

◆ pBoneOrigin

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneOrigin

Referenced by getBoneRing2(), and getBTSMs().

◆ pBonePinky1

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBonePinky1

◆ pBoneRing1

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneRing1

◆ pBoneThumb1

ECPString Dragengine.Scenery.ECBehaviorVRHandPose.pBoneThumb1

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandPose.pBTSMs

◆ pEnabled

ECPBoolean Dragengine.Scenery.ECBehaviorVRHandPose.pEnabled

◆ pFingerTipDistance

ECPFloat Dragengine.Scenery.ECBehaviorVRHandPose.pFingerTipDistance

◆ pPrefix

String Dragengine.Scenery.ECBehaviorVRHandPose.pPrefix

◆ pVRBody

ECBehaviorVRBody Dragengine.Scenery.ECBehaviorVRHandPose.pVRBody

Referenced by getBehaviorIn(), and getBonePinky4().

◆ pVRHand

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPose.pVRHand

Referenced by getBehaviorIn(), getBonePinky3(), and new().


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