|
Drag[en]gine Script Module DragonScript 1.32.1
|
Behavior element behavior adding hands only locomotion support to actor. More...
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>". | |
Behavior element behavior adding hands only locomotion support to actor.
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).
| void Dragengine.Scenery.ECBehaviorVRHandLocomotion.addListenerFactory | ( | Block | blockFactory | ) |
Add listener factory using block.
Block receives as parameter Instance and returns Listener.
| void Dragengine.Scenery.ECBehaviorVRHandLocomotion.addListenerFactory | ( | ListenerFactory | factory | ) |
Add listener factory.
| void Dragengine.Scenery.ECBehaviorVRHandLocomotion.createListeners | ( | Instance | instance | ) |
Create listeners from factories adding them to behavior instance.
| void Dragengine.Scenery.ECBehaviorVRHandLocomotion.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
| void Dragengine.Scenery.ECBehaviorVRHandLocomotion.forEachListenerFactory | ( | Block | ablock | ) |
Visit listener factories with block with argument ListenerFactory.
|
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.
| ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandLocomotion.getBTSMs | ( | ) |
Compose behavior trees and state machines.
| CommandManager Dragengine.Scenery.ECBehaviorVRHandLocomotion.getCommandManager | ( | ) |
Command manager.
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHandLocomotion.getPlayerControllable | ( | ) |
Player controllable behavior.
| String Dragengine.Scenery.ECBehaviorVRHandLocomotion.getPrefix | ( | ) |
Prefix.
| ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandLocomotion.getVRHand | ( | ) |
VR Hand behavior.
| ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorVRHand | vrHand, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| CommandManager | commandManager | ||
| ) |
Create behavior element class.
| ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorVRHand | vrHand, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| CommandManager | commandManager, | ||
| String | id | ||
| ) |
Create behavior element class.
| ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorVRHand | vrHand, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| CommandManager | commandManager, | ||
| String | id, | ||
| String | subID | ||
| ) |
Create behavior element class.
| ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorVRHand | vrHand, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| CommandManager | commandManager, | ||
| String | id, | ||
| String | subID, | ||
| String | prefix | ||
| ) |
Create behavior element class.
| ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorVRHand | vrHand, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| String | id | ||
| ) |
Create behavior element class.
| ECBehaviorVRHandLocomotion Dragengine.Scenery.ECBehaviorVRHandLocomotion.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorVRHand | vrHand, | ||
| ECBehaviorPlayerControllable | playerControllable, | ||
| String | id, | ||
| String | subID | ||
| ) |
Create behavior element class.
| ECComposeBTSM Dragengine.Scenery.ECBehaviorVRHandLocomotion.pBTSMs |
| CommandManager Dragengine.Scenery.ECBehaviorVRHandLocomotion.pCommandManager |
| Array Dragengine.Scenery.ECBehaviorVRHandLocomotion.pListenerFactories |
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHandLocomotion.pPlayerControllable |
| String Dragengine.Scenery.ECBehaviorVRHandLocomotion.pPrefix |
| ECBehaviorVRHand Dragengine.Scenery.ECBehaviorVRHandLocomotion.pVRHand |