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

Behavior element behavior adding hands only locomotion support to actor. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorVRHandLocomotion:
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.
 
CommandManager getCommandManager ()
 Command manager.
 
ECBehaviorPlayerControllable getPlayerControllable ()
 Player controllable behavior.
 
String getPrefix ()
 Prefix.
 
ECBehaviorVRHand getVRHand ()
 VR Hand behavior.
 
ECBehaviorVRHandLocomotion new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorPlayerControllable playerControllable, CommandManager commandManager)
 Create behavior element class.
 
ECBehaviorVRHandLocomotion new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorPlayerControllable playerControllable, CommandManager commandManager, String id)
 Create behavior element class.
 
ECBehaviorVRHandLocomotion new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorPlayerControllable playerControllable, CommandManager commandManager, String id, String subID)
 Create behavior element class.
 
ECBehaviorVRHandLocomotion new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorPlayerControllable playerControllable, CommandManager commandManager, String id, String subID, String prefix)
 Create behavior element class.
 
ECBehaviorVRHandLocomotion new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorPlayerControllable playerControllable, String id)
 Create behavior element class.
 
ECBehaviorVRHandLocomotion new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorPlayerControllable playerControllable, String id, String subID)
 Create behavior element class.
 
- 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 ECBehaviorVRHandLocomotion getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.
 

Public Attributes

ECComposeBTSM pBTSMs
 
CommandManager pCommandManager
 
Array pListenerFactories
 
ECBehaviorPlayerControllable pPlayerControllable
 
String pPrefix
 
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 element behavior adding hands only locomotion support to actor.

Version
1.28

This behavior is designed to be used with ECBehaviorVRHand for which ECBehaviorVRHand.Instance::isUsingHandInteraction() returns true.

Using hands only (or hand interaction) controllers there is no way to use sticks to move or turn the actor. This behavior simulates stick type movement by tracking hand position. The user begins moving and turning by looking at his hand and touching an application defined finger to the thumb, typically the middle finger. The index is usually a bad choice since VR runtimes tend to intercept this touch event for special system handling. The hand location relative to the HMD at the time of touching is stored as origin. While still touching the thumb the user can then move the hand left, right, forward, backwards, up and down. This is like if the user is moving the tip of an imaginary stick. Each movement direction is assigned a Command of this the analog value is set from the distance from the origin. Furthermore button press events are simulated on the same commands if the value is larger than 75% away from the origin. There is a dead-zone near the stored origin to avoid unintentional turning or moving. Furthermore the input is not linear from the dead zone border to the input range. This allows for easier input of small turning and movement while still being able to turn and move faster near the range.

This behavior can be added multiple times to an element. This allows to track two hands. Each instance has an identifier which can be used to retrieve a specific instance. The prefix of the element class properties is "vrHandLocomotion." . If the identifier is not empty the element class properties have the prefix "{id}.vrHandLocomotion." . This can be overwritten if required.

This behavior does not require persistable element class (setPersistable).

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

Member Function Documentation

◆ addListenerFactory() [1/2]

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

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

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

Add listener factory.

◆ createListeners()

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

Create listeners from factories adding them to behavior instance.

◆ dispose()

void Dragengine.Scenery.ECBehaviorVRHandLocomotion.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachListenerFactory()

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

Visit listener factories with block with argument ListenerFactory.

◆ getBehaviorIn()

static ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.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 ECBehaviorVRHandLocomotion.

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandLocomotion.getBTSMs ( )

Compose behavior trees and state machines.

◆ getCommandManager()

CommandManager Dragengine.Scenery.ECBehaviorVRHandLocomotion.getCommandManager ( )

Command manager.

◆ getPlayerControllable()

ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHandLocomotion.getPlayerControllable ( )

Player controllable behavior.

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorVRHandLocomotion.getPrefix ( )

Prefix.

◆ getVRHand()

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandLocomotion.getVRHand ( )

VR Hand behavior.

◆ new() [1/6]

ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorPlayerControllable  playerControllable,
CommandManager  commandManager 
)

Create behavior element class.

◆ new() [2/6]

ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorPlayerControllable  playerControllable,
CommandManager  commandManager,
String  id 
)

Create behavior element class.

◆ new() [3/6]

ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorPlayerControllable  playerControllable,
CommandManager  commandManager,
String  id,
String  subID 
)

Create behavior element class.

◆ new() [4/6]

ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorPlayerControllable  playerControllable,
CommandManager  commandManager,
String  id,
String  subID,
String  prefix 
)

Create behavior element class.

◆ new() [5/6]

ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorPlayerControllable  playerControllable,
String  id 
)

Create behavior element class.

◆ new() [6/6]

ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorPlayerControllable  playerControllable,
String  id,
String  subID 
)

Create behavior element class.

Member Data Documentation

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandLocomotion.pBTSMs

◆ pCommandManager

CommandManager Dragengine.Scenery.ECBehaviorVRHandLocomotion.pCommandManager

◆ pListenerFactories

Array Dragengine.Scenery.ECBehaviorVRHandLocomotion.pListenerFactories

◆ pPlayerControllable

ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHandLocomotion.pPlayerControllable

◆ pPrefix

String Dragengine.Scenery.ECBehaviorVRHandLocomotion.pPrefix

◆ pVRHand

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandLocomotion.pVRHand

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