Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorVRHandPointAt Class Reference

Behavior adding support to VR Hand behavior to know what element they are pointing at. More...

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

Classes

class  BlockListenerFactory
 Factory creating listeners using block. More...
class  DefaultListener
 Default implementation of behavior instance listener. More...
class  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...
interface  Listener
 Listener for behavior instance events. More...
interface  ListenerFactory
 Factory creating listeners. More...

Public Member Functions

void addListenerFactory (Block blockFactory)
 Add listener factory using block.
void addListenerFactory (ListenerFactory factory)
 Add listener factory.
void createListeners (Instance instance)
 Create listeners from factories adding them to behavior instance.
void dispose ()
 Dispose of behavior.
void forEachListenerFactory (Block ablock)
 Visit listener factories with block with argument ListenerFactory.
ECComposeBTSM getBTSMs ()
 Compose behavior trees and state machines.
ECComposeCollisionFilter getCollisionFilter ()
 Collision filter for AI collider.
ECPCollisionFilter getCollisionFilterProperty ()
 Collision filter for AI collider.
ECBehaviorCollider getIgnoreCollider ()
 Collider to ignore during collision testing or null.
ECPVector getOrigin ()
 Test origin.
String getPrefix ()
 Prefix.
ECPFloat getRange ()
 Test range.
ECPVector getRotation ()
 Test direction rotation.
ECPShapeList getShape ()
 Test shape.
ECPString getTestBone ()
 Test bone.
ECBehaviorVRHand getVRHand ()
 VR Hand behavior or null.
ECBehaviorVRHandPointAt new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand)
 Create behavior element class.
ECBehaviorVRHandPointAt new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id)
 Create behavior element class.
ECBehaviorVRHandPointAt new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id, String prefix)
 Create behavior element class.
void setIgnoreCollider (ECBehaviorCollider collider)
 Set collider to ignore during collision testing or null.
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 ECBehaviorVRHandPointAt getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.

Public Attributes

ECComposeBTSM pBTSMs
ECPCollisionFilter pCollisionFilter
ECBehaviorCollider pIgnoreCollider
Array pListenerFactories
ECPVector pOrigin
String pPrefix
ECPFloat pRange
ECPVector pRotation
ECPShapeList pShape
ECPString pTestBone
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 VR Hand behavior to know what element they are pointing at.

Version
1.7

Behavior uses one collider collision test located attached controller collider facing forward.

If hand component is present and a test bone is set the collision test will be attached to the component bone.

By default the test direction is rotated by -45 degrees along the X axis. This accounts for VR hand controllers typically having their Z axis along the grip direction. This causes the point at detection to point 45 degrees upwards. For easier usage rotating the point at detection direction downwards by 45 degrees helps.

By default point-at is disabled for backward compatibility.

Requires these behaviors to be present:

To this behavior add it and set the class properties. Add listener to be notified if the pointed at element changes or query the current state.

Interaction with ECBehaviorVRHandPointedAt

If the pointed at element has ECBehaviorVRHandPointedAt instance it will be updated by adding and removing the owner element.

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

Member Function Documentation

◆ addListenerFactory() [1/2]

void Dragengine.Scenery.ECBehaviorVRHandPointAt.addListenerFactory ( Block blockFactory)

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

void Dragengine.Scenery.ECBehaviorVRHandPointAt.addListenerFactory ( ListenerFactory factory)

Add listener factory.

References pShape.

Referenced by getBehaviorIn().

◆ createListeners()

void Dragengine.Scenery.ECBehaviorVRHandPointAt.createListeners ( Instance instance)

Create listeners from factories adding them to behavior instance.

References pCollisionFilter.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorVRHandPointAt.Instance.updateTestParameters().

◆ dispose()

void Dragengine.Scenery.ECBehaviorVRHandPointAt.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

Referenced by getBehaviorIn().

◆ forEachListenerFactory()

void Dragengine.Scenery.ECBehaviorVRHandPointAt.forEachListenerFactory ( Block ablock)

Visit listener factories with block with argument ListenerFactory.

Referenced by getBehaviorIn().

◆ getBehaviorIn()

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandPointAt.getBTSMs ( )

Compose behavior trees and state machines.

Version
1.26

References new().

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorVRHandPointAt.Instance.writeToFile().

◆ getCollisionFilter()

ECComposeCollisionFilter Dragengine.Scenery.ECBehaviorVRHandPointAt.getCollisionFilter ( )

◆ getCollisionFilterProperty()

ECPCollisionFilter Dragengine.Scenery.ECBehaviorVRHandPointAt.getCollisionFilterProperty ( )

Collision filter for AI collider.

Version
1.35

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorVRHandPointAt.Instance.getPointAtOrigin().

◆ getIgnoreCollider()

ECBehaviorCollider Dragengine.Scenery.ECBehaviorVRHandPointAt.getIgnoreCollider ( )

Collider to ignore during collision testing or null.

Referenced by Dragengine.Scenery.ECBehaviorVRHandPointAt.Instance.calcTestMatrix(), and getBehaviorIn().

◆ getOrigin()

ECPVector Dragengine.Scenery.ECBehaviorVRHandPointAt.getOrigin ( )

Test origin.

Referenced by getBehaviorIn().

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorVRHandPointAt.getPrefix ( )

◆ getRange()

ECPFloat Dragengine.Scenery.ECBehaviorVRHandPointAt.getRange ( )

Test range.

References pBTSMs.

Referenced by getBehaviorIn().

◆ getRotation()

ECPVector Dragengine.Scenery.ECBehaviorVRHandPointAt.getRotation ( )

Test direction rotation.

Referenced by getBehaviorIn().

◆ getShape()

ECPShapeList Dragengine.Scenery.ECBehaviorVRHandPointAt.getShape ( )

◆ getTestBone()

ECPString Dragengine.Scenery.ECBehaviorVRHandPointAt.getTestBone ( )

◆ getVRHand()

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPointAt.getVRHand ( )

VR Hand behavior or null.

Referenced by getBehaviorIn().

◆ new() [1/3]

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

◆ new() [2/3]

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

Create behavior element class.

◆ new() [3/3]

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

Create behavior element class.

◆ setIgnoreCollider()

void Dragengine.Scenery.ECBehaviorVRHandPointAt.setIgnoreCollider ( ECBehaviorCollider collider)

Set collider to ignore during collision testing or null.

Referenced by getBehaviorIn().

Member Data Documentation

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandPointAt.pBTSMs

Referenced by getBehaviorIn(), and getRange().

◆ pCollisionFilter

ECPCollisionFilter Dragengine.Scenery.ECBehaviorVRHandPointAt.pCollisionFilter

Referenced by createListeners(), and getBehaviorIn().

◆ pIgnoreCollider

ECBehaviorCollider Dragengine.Scenery.ECBehaviorVRHandPointAt.pIgnoreCollider

Referenced by getBehaviorIn().

◆ pListenerFactories

Array Dragengine.Scenery.ECBehaviorVRHandPointAt.pListenerFactories

Referenced by getBehaviorIn().

◆ pOrigin

ECPVector Dragengine.Scenery.ECBehaviorVRHandPointAt.pOrigin

Referenced by getBehaviorIn().

◆ pPrefix

String Dragengine.Scenery.ECBehaviorVRHandPointAt.pPrefix

Referenced by getBehaviorIn().

◆ pRange

ECPFloat Dragengine.Scenery.ECBehaviorVRHandPointAt.pRange

Referenced by getBehaviorIn().

◆ pRotation

◆ pShape

ECPShapeList Dragengine.Scenery.ECBehaviorVRHandPointAt.pShape

◆ pTestBone

ECPString Dragengine.Scenery.ECBehaviorVRHandPointAt.pTestBone

Referenced by getBehaviorIn().

◆ pVRHand

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandPointAt.pVRHand

Referenced by getBehaviorIn().


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