|
Drag[en]gine Script Module DragonScript 1.35
|
Base VR Hand action. More...
Classes | |
| class | Factory |
| Factory for loading actor actions. More... | |
Public Member Functions | |
| void | activate (BehaviorElement actor, ECBehaviorVRHand.Instance vrHand) |
| Action has been set as active hand action. | |
| void | activateWhileLoading (BehaviorElement actor, ECBehaviorVRHand.Instance vrHand) |
| Action has been set as active action in an actor while loading. | |
| void | cancel () |
| Cancel action the next time possible. | |
| void | collisionResponse (Collider owner, CollisionInfo info) |
| Collision detected. | |
| bool | conversationWait () |
| Check if conversation actions have to wait for actor to finish this action. | |
| void | deactivate () |
| Action has been unset as active hand action. | |
| void | dispose () |
| Dispose of actor action. | |
| void | enteredGameWorld () |
| Actor entered game world. | |
| void | enterFrame () |
| Actor has been added to game world and enterFrame() is called once. | |
| BehaviorElement | getActor () |
| Actor the action is assigned to or null. | |
| ECBehaviorConversationActor.Instance | getConversationActor () |
| Conversation actor behavior if present. | |
| ECBehaviorVRHandAction.Instance | getHandAction () |
| Behavior VR hand action or null. | |
| ECBehaviorActorAnimated.Instance | getHandAnimated () |
| Hand animated behavior if present. | |
| ECBehaviorAttachSlot.Instance | getHandAttachSlot () |
| Hand Controller Attach Slot. | |
| ECBehaviorGrabber.Instance | getHandGrabber () |
| Hand Controller Grabber. | |
| ECBehaviorVRHandLaserPointer.Instance | getHandLaserPointer () |
| Hand Controller Laser Pointer. | |
| ECBehaviorVRHandLocomotion.Instance | getHandLocomotion () |
| Hand Locomotion. | |
| ECBehaviorVRHandPointAt.Instance | getHandPointAt () |
| Hand Controller Point-At. | |
| ECBehaviorVRHandPose.Instance | getHandPose () |
| Hand Pose. | |
| ECBehaviorLocomotion.Instance | getLocomotion () |
| Locomotion behavior. | |
| ECBehaviorVRHand.Instance | getVRHand () |
| VR hand behavior the action is assigned to or null. | |
| bool | isActive () |
| Action is active hand action. | |
| bool | isLeftHand () |
| Action is left hand. | |
| bool | isNotActive () |
| Action is not active hand action. | |
| bool | isRightHand () |
| Action is right hand. | |
| void | leftGameWorld () |
| Actor left game world. | |
| void | log (Console console, Element element, String text) |
| Log text about element to console prefixed with actor information. | |
| void | log (Console console, Exception exception) |
| Log exception to console prefixed with actor information. | |
| void | log (Console console, String text) |
| Log text to console prefixed with actor information. | |
| void | log (Element element, String text) |
| Log text about element to BaseGameApp console prefixed with actor information. | |
| void | log (Exception exception) |
| Log exception to BaseGameApp console prefixed with actor information. | |
| void | log (String text) |
| Log text to BaseGameApp console prefixed with actor information. | |
| String | loggingPrefix () |
| Logging prefix. | |
| BaseVRHandAction | new () |
| Create actor action. | |
| BaseVRHandAction | new (PersistencyEnvironment env, FileReader reader) |
| Create actor action from persisted state. | |
| String | persistencyFactoryName () |
| Name of PersistencyFactory required to load object from file. | |
| void | playerReleasesControl () |
| Player released control of actor. | |
| void | playerTakesControl () |
| Player takes control of actor. | |
| void | postThink (float elapsed) |
| Post physics. | |
| void | think (float elapsed) |
| Thinking. | |
| void | writeObjectToFile (PersistencyEnvironment env, FileWriter writer) |
| Write object to file writer. | |
Protected Member Functions | |
| void | applyAnimations () |
| Apply animations. | |
| void | initAnimator () |
| Initialize animator. | |
| void | initBehaviors () |
| Init behaviors. | |
| void | updateAnimator (float elapsed) |
| Update animator controllers. | |
Protected Attributes | |
| BehaviorElement | actor |
| Actor the action is assigned to or null. | |
| ECBehaviorConversationActor.Instance | conversationActor |
| Conversation actor behavior if present. | |
| ECBehaviorVRHandAction.Instance | handAction |
| Behavior VR hand action or null. | |
| ECBehaviorActorAnimated.Instance | handAnimated |
| Hand animated behavior if present. | |
| ECBehaviorAttachSlot.Instance | handAttachSlot |
| Hand Controller Attach Slot behavior. | |
| ECBehaviorGrabber.Instance | handGrabber |
| Hand Controller Grabber behavior. | |
| ECBehaviorVRHandLaserPointer.Instance | handLaserPointer |
| Hand Controller Laser Pointer behavior. | |
| ECBehaviorVRHandLocomotion.Instance | handLocomotion |
| Hand Locomotion behavior. | |
| ECBehaviorVRHandPointAt.Instance | handPointAt |
| Hand Controller Point-At behavior. | |
| ECBehaviorVRHandPose.Instance | handPose |
| Hand Pose behavior. | |
| ECBehaviorLocomotion.Instance | locomotion |
| Locomotion behavior. | |
| bool | pIsRightHand |
| ECBehaviorVRHand.Instance | vrHand |
| VR hand the action is assigned to or null. | |
Base VR Hand action.
Action supports the Persistable interface and can be read from and writen to file writers.
| void Dragengine.Scenery.BaseVRHandAction.activate | ( | BehaviorElement | actor, |
| ECBehaviorVRHand.Instance | vrHand ) |
Action has been set as active hand action.
Stores the actor and VR hand behavior and calls initAnimator() and ECBehaviorActorAnimated.applyAnimations().
Calls these hook methods:
References getHandAction(), getHandAnimated(), handAction, and handAnimated.
Referenced by think().
| void Dragengine.Scenery.BaseVRHandAction.activateWhileLoading | ( | BehaviorElement | actor, |
| ECBehaviorVRHand.Instance | vrHand ) |
Action has been set as active action in an actor while loading.
Similar to activate(BehaviorElement,ECBehaviorVRHand.Instance) but only stores the actor and VR hand behavior and calls initBehaviors(). This is required since while loading behaviors load their state and actions load their states. If activate(BehaviorElement,ECBehaviorVRHand.Instance) is called these states would be reset to initial values.
References handAction, isActive(), and isNotActive().
Referenced by initBehaviors().
|
protected |
Apply animations.
Default implementation calls these method if the behvaiors are present:
References actor, conversationActor, getConversationActor(), getLocomotion(), handPointAt, initBehaviors(), locomotion, and vrHand.
Referenced by cancel(), initAnimator(), and writeObjectToFile().
| void Dragengine.Scenery.BaseVRHandAction.cancel | ( | ) |
Cancel action the next time possible.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References applyAnimations(), handAnimated, and initAnimator().
Referenced by updateAnimator().
| void Dragengine.Scenery.BaseVRHandAction.collisionResponse | ( | Collider | owner, |
| CollisionInfo | info ) |
Collision detected.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References handAction, handAnimated, handPointAt, and vrHand.
Referenced by writeObjectToFile().
| bool Dragengine.Scenery.BaseVRHandAction.conversationWait | ( | ) |
Check if conversation actions have to wait for actor to finish this action.
BaseActor adds a listener to ECBehaviorConversationActor using conversationWait() to answer waiting queries by conversation scripts.
The default implementation returns false which equals no waiting required.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References handAttachSlot, handGrabber, handLaserPointer, handLocomotion, and handPose.
Referenced by writeObjectToFile().
| void Dragengine.Scenery.BaseVRHandAction.deactivate | ( | ) |
Action has been unset as active hand action.
The stored actor is not cleared to avoid problems while cleaning up.
References handAction.
Referenced by initBehaviors().
| void Dragengine.Scenery.BaseVRHandAction.dispose | ( | ) |
Dispose of actor action.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References new().
Referenced by getVRHand().
| void Dragengine.Scenery.BaseVRHandAction.enteredGameWorld | ( | ) |
Actor entered game world.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References isRightHand(), and pIsRightHand.
Referenced by initBehaviors().
| void Dragengine.Scenery.BaseVRHandAction.enterFrame | ( | ) |
Actor has been added to game world and enterFrame() is called once.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References isLeftHand(), and pIsRightHand.
Referenced by initBehaviors().
| BehaviorElement Dragengine.Scenery.BaseVRHandAction.getActor | ( | ) |
| ECBehaviorConversationActor.Instance Dragengine.Scenery.BaseVRHandAction.getConversationActor | ( | ) |
Conversation actor behavior if present.
References getActor().
Referenced by applyAnimations(), and getHandPose().
| ECBehaviorVRHandAction.Instance Dragengine.Scenery.BaseVRHandAction.getHandAction | ( | ) |
Behavior VR hand action or null.
References getHandLaserPointer(), and handLaserPointer.
Referenced by activate().
| ECBehaviorActorAnimated.Instance Dragengine.Scenery.BaseVRHandAction.getHandAnimated | ( | ) |
Hand animated behavior if present.
Referenced by activate().
| ECBehaviorAttachSlot.Instance Dragengine.Scenery.BaseVRHandAction.getHandAttachSlot | ( | ) |
Hand Controller Attach Slot.
Referenced by isActive().
| ECBehaviorGrabber.Instance Dragengine.Scenery.BaseVRHandAction.getHandGrabber | ( | ) |
| ECBehaviorVRHandLaserPointer.Instance Dragengine.Scenery.BaseVRHandAction.getHandLaserPointer | ( | ) |
| ECBehaviorVRHandLocomotion.Instance Dragengine.Scenery.BaseVRHandAction.getHandLocomotion | ( | ) |
Hand Locomotion.
References getHandPointAt(), and handPointAt.
Referenced by isLeftHand().
| ECBehaviorVRHandPointAt.Instance Dragengine.Scenery.BaseVRHandAction.getHandPointAt | ( | ) |
| ECBehaviorVRHandPose.Instance Dragengine.Scenery.BaseVRHandAction.getHandPose | ( | ) |
| ECBehaviorLocomotion.Instance Dragengine.Scenery.BaseVRHandAction.getLocomotion | ( | ) |
Locomotion behavior.
Referenced by applyAnimations(), and getHandGrabber().
| ECBehaviorVRHand.Instance Dragengine.Scenery.BaseVRHandAction.getVRHand | ( | ) |
VR hand behavior the action is assigned to or null.
References actor, and dispose().
Referenced by getHandLaserPointer().
|
protected |
Initialize animator.
Overwrite to change animator to use for this actor.
Default implementation does nothing.
Call setActiveAnimatorID() with the identifier of the desired animator as set up in the "handAnimated.animators" element class property. If you set up controller mappings using handAnimated.setDefaultControllerMappings() or manually you can stop here since controller mappings are automatically updated. By default BaseActorClass does calls setDefaultControllerMappings().
A typical implementation can look like this:
If you change the animator you should usually also change the locomotion controller mappings to automatically animate them unless you plan to do it manually.
A typical implementation can look like this:
This example code sets an animator which is known to have 4 controllers. The mappings are set to automatically update the controllers with values matching their use. In this case the first controller is playback while actor is not moving. The second controller is playback while actor is walking. Using ATTR_DISPLACEMENT uses the distance moved by the actor as controller value. Using distance avoids feet shuffling and works well with variable movement speeds. The other two controllers affect the direction the actor is looking.
References applyAnimations(), postThink(), and updateAnimator().
Referenced by cancel(), and writeObjectToFile().
|
protected |
Init behaviors.
Retrieve and store required and optional behavior instances from the actor element.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References activateWhileLoading(), actor, deactivate(), enteredGameWorld(), enterFrame(), initBehaviors(), leftGameWorld(), pIsRightHand, playerReleasesControl(), playerTakesControl(), think(), and vrHand.
Referenced by applyAnimations(), initBehaviors(), and postThink().
| bool Dragengine.Scenery.BaseVRHandAction.isActive | ( | ) |
Action is active hand action.
References getHandAttachSlot().
Referenced by activateWhileLoading(), and Dragengine.Scenery.BAAVRHandStateMachine.writeObjectToFile().
| bool Dragengine.Scenery.BaseVRHandAction.isLeftHand | ( | ) |
Action is left hand.
References getHandLocomotion(), getHandPose(), handLocomotion, and handPose.
Referenced by enterFrame().
| bool Dragengine.Scenery.BaseVRHandAction.isNotActive | ( | ) |
| bool Dragengine.Scenery.BaseVRHandAction.isRightHand | ( | ) |
Action is right hand.
References getHandGrabber(), and handGrabber.
Referenced by enteredGameWorld().
| void Dragengine.Scenery.BaseVRHandAction.leftGameWorld | ( | ) |
Actor left game world.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
Referenced by initBehaviors().
Log text about element to console prefixed with actor information.
References conversationActor, and locomotion.
| void Dragengine.Scenery.BaseVRHandAction.log | ( | Console | console, |
| Exception | exception ) |
Log exception to console prefixed with actor information.
References handAction, handAnimated, handAttachSlot, handGrabber, handLaserPointer, handLocomotion, and handPose.
| void Dragengine.Scenery.BaseVRHandAction.log | ( | Console | console, |
| String | text ) |
Log text to console prefixed with actor information.
References handAnimated, handLocomotion, and handPose.
| void Dragengine.Scenery.BaseVRHandAction.log | ( | Element | element, |
| String | text ) |
Log text about element to BaseGameApp console prefixed with actor information.
References handAction.
| void Dragengine.Scenery.BaseVRHandAction.log | ( | Exception | exception | ) |
Log exception to BaseGameApp console prefixed with actor information.
References handPointAt, and vrHand.
| void Dragengine.Scenery.BaseVRHandAction.log | ( | String | text | ) |
Log text to BaseGameApp console prefixed with actor information.
References handAttachSlot, handGrabber, and handLaserPointer.
Referenced by writeObjectToFile().
| String Dragengine.Scenery.BaseVRHandAction.loggingPrefix | ( | ) |
Logging prefix.
Returns string in the form "<actor-class>/<action-class>".
References handAction, handAnimated, handAttachSlot, handGrabber, handLaserPointer, handLocomotion, handPointAt, and handPose.
Referenced by writeObjectToFile().
| BaseVRHandAction Dragengine.Scenery.BaseVRHandAction.new | ( | ) |
Create actor action.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References handAction, and pIsRightHand.
Referenced by dispose(), and getActor().
| BaseVRHandAction Dragengine.Scenery.BaseVRHandAction.new | ( | PersistencyEnvironment | env, |
| FileReader | reader ) |
Create actor action from persisted state.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
| String Dragengine.Scenery.BaseVRHandAction.persistencyFactoryName | ( | ) |
Name of PersistencyFactory required to load object from file.
Name of PersistencyFactory is first written to the file as string with 8-bit length. Then writeToFile() is called to write the object itself. Empty name is not allowed as is names longer than 255 characters. Name has to match a PersistencyFactory present in the Persistency instance used for loading objects. Object is read using PersistencyFactory.readObjectFromFile() of the matching PersistencyFactory.
Implements Dragengine.LoadSave.Persistable.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
Referenced by writeObjectToFile().
| void Dragengine.Scenery.BaseVRHandAction.playerReleasesControl | ( | ) |
Player released control of actor.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
Referenced by initBehaviors().
| void Dragengine.Scenery.BaseVRHandAction.playerTakesControl | ( | ) |
Player takes control of actor.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
Referenced by initBehaviors().
| void Dragengine.Scenery.BaseVRHandAction.postThink | ( | float | elapsed | ) |
Post physics.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References initBehaviors(), pIsRightHand, and vrHand.
Referenced by initAnimator().
| void Dragengine.Scenery.BaseVRHandAction.think | ( | float | elapsed | ) |
Thinking.
Default implementation does these actions in this order:
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References activate(), and actor.
Referenced by initBehaviors().
|
protected |
Update animator controllers.
Default implementation calls these method if the behvaiors are present:
References cancel().
Referenced by initAnimator(), and writeObjectToFile().
| void Dragengine.Scenery.BaseVRHandAction.writeObjectToFile | ( | PersistencyEnvironment | env, |
| FileWriter | writer ) |
Write object to file writer.
Implements Dragengine.LoadSave.Persistable.
Reimplemented in Dragengine.Scenery.BAAVRHandStateMachine.
References actor, applyAnimations(), collisionResponse(), conversationWait(), handAnimated, handPose, initAnimator(), log(), loggingPrefix(), persistencyFactoryName(), updateAnimator(), vrHand, and writeObjectToFile().
Referenced by writeObjectToFile().
|
protected |
Actor the action is assigned to or null.
Referenced by applyAnimations(), getHandPointAt(), getVRHand(), initBehaviors(), Dragengine.Scenery.BAAVRHandStateMachine.persistencyFactoryName(), think(), Dragengine.Scenery.BAAVRHandStateMachine.writeObjectToFile(), and writeObjectToFile().
|
protected |
Conversation actor behavior if present.
Referenced by applyAnimations(), getHandPose(), and log().
|
protected |
Behavior VR hand action or null.
Referenced by activate(), activateWhileLoading(), collisionResponse(), deactivate(), log(), log(), loggingPrefix(), and new().
|
protected |
Hand animated behavior if present.
Referenced by activate(), cancel(), collisionResponse(), log(), log(), loggingPrefix(), and writeObjectToFile().
|
protected |
Hand Controller Attach Slot behavior.
Referenced by conversationWait(), isNotActive(), log(), log(), and loggingPrefix().
|
protected |
Hand Controller Grabber behavior.
Referenced by conversationWait(), isRightHand(), log(), log(), and loggingPrefix().
|
protected |
Hand Controller Laser Pointer behavior.
Referenced by conversationWait(), getHandAction(), log(), log(), and loggingPrefix().
|
protected |
Hand Locomotion behavior.
Referenced by conversationWait(), isLeftHand(), log(), log(), and loggingPrefix().
|
protected |
Hand Controller Point-At behavior.
Referenced by applyAnimations(), collisionResponse(), getHandLocomotion(), log(), and loggingPrefix().
|
protected |
Hand Pose behavior.
Referenced by conversationWait(), isLeftHand(), log(), log(), loggingPrefix(), and writeObjectToFile().
|
protected |
Locomotion behavior.
Referenced by applyAnimations(), getHandGrabber(), and log().
|
protected |
|
protected |
VR hand the action is assigned to or null.
Referenced by applyAnimations(), collisionResponse(), getHandLaserPointer(), initBehaviors(), log(), postThink(), Dragengine.Scenery.BAAVRHandStateMachine.writeObjectToFile(), and writeObjectToFile().