Drag[en]gine Script Module DragonScript
1.23
|
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. More... | |
void | activateWhileLoading (BehaviorElement actor, ECBehaviorVRHand.Instance vrHand) |
Action has been set as active action in an actor while loading. More... | |
void | cancel () |
Cancel action the next time possible. More... | |
void | collisionResponse (Collider owner, CollisionInfo info) |
Collision detected. More... | |
bool | conversationWait () |
Check if conversation actions have to wait for actor to finish this action. More... | |
void | deactivate () |
Action has been unset as active hand action. More... | |
void | dispose () |
Dispose of actor action. More... | |
void | enteredGameWorld () |
Actor entered game world. More... | |
void | enterFrame () |
Actor has been added to game world and enterFrame() is called once. More... | |
BehaviorElement | getActor () |
Actor the action is assigned to or null. More... | |
ECBehaviorConversationActor.Instance | getConversationActor () |
Conversation actor behavior if present. More... | |
ECBehaviorVRHandAction.Instance | getHandAction () |
Behavior VR hand action or null. More... | |
ECBehaviorActorAnimated.Instance | getHandAnimated () |
Hand animated behavior if present. More... | |
ECBehaviorAttachSlot.Instance | getHandAttachSlot () |
Hand Controller Attach Slot. More... | |
ECBehaviorGrabber.Instance | getHandGrabber () |
Hand Controller Grabber. More... | |
ECBehaviorVRHandLaserPointer.Instance | getHandLaserPointer () |
Hand Controller Laser Pointer. More... | |
ECBehaviorVRHandPointAt.Instance | getHandPointAt () |
Hand Controller Point-At. More... | |
ECBehaviorVRHandPose.Instance | getHandPose () |
Hand Pose. More... | |
ECBehaviorLocomotion.Instance | getLocomotion () |
Locomotion behavior. More... | |
ECBehaviorVRHand.Instance | getVRHand () |
VR hand behavior the action is assigned to or null. More... | |
bool | isActive () |
Action is active hand action. More... | |
bool | isLeftHand () |
Action is left hand. More... | |
bool | isNotActive () |
Action is not active hand action. More... | |
bool | isRightHand () |
Action is right hand. More... | |
void | leftGameWorld () |
Actor left game world. More... | |
void | log (Console console, Element element, String text) |
Log text about element to console prefixed with actor information. More... | |
void | log (Console console, Exception exception) |
Log exception to console prefixed with actor information. More... | |
void | log (Console console, String text) |
Log text to console prefixed with actor information. More... | |
void | log (Element element, String text) |
Log text about element to BaseGameApp console prefixed with actor information. More... | |
void | log (Exception exception) |
Log exception to BaseGameApp console prefixed with actor information. More... | |
void | log (String text) |
Log text to BaseGameApp console prefixed with actor information. More... | |
String | loggingPrefix () |
Logging prefix. More... | |
BaseVRHandAction | new () |
Create actor action. More... | |
BaseVRHandAction | new (PersistencyEnvironment env, FileReader reader) |
Create actor action from persisted state. More... | |
String | persistencyFactoryName () |
Name of PersistencyFactory required to load object from file. More... | |
void | playerReleasesControl () |
Player released control of actor. More... | |
void | playerTakesControl () |
Player takes control of actor. More... | |
void | postThink (float elapsed) |
Post physics. More... | |
void | think (float elapsed) |
Thinking. More... | |
void | writeObjectToFile (PersistencyEnvironment env, FileWriter writer) |
Write object to file writer. More... | |
Protected Member Functions | |
void | applyAnimations () |
Apply animations. More... | |
void | initAnimator () |
Initialize animator. More... | |
void | initBehaviors () |
Init behaviors. More... | |
void | updateAnimator (float elapsed) |
Update animator controllers. More... | |
Protected Attributes | |
BehaviorElement | actor |
Actor the action is assigned to or null. More... | |
ECBehaviorConversationActor.Instance | conversationActor |
Conversation actor behavior if present. More... | |
ECBehaviorVRHandAction.Instance | handAction |
Behavior VR hand action or null. More... | |
ECBehaviorActorAnimated.Instance | handAnimated |
Hand animated behavior if present. More... | |
ECBehaviorAttachSlot.Instance | handAttachSlot |
Hand Controller Attach Slot behavior. More... | |
ECBehaviorGrabber.Instance | handGrabber |
Hand Controller Grabber behavior. More... | |
ECBehaviorVRHandLaserPointer.Instance | handLaserPointer |
Hand Controller Laser Pointer behavior. More... | |
ECBehaviorVRHandPointAt.Instance | handPointAt |
Hand Controller Point-At behavior. More... | |
ECBehaviorVRHandPose.Instance | handPose |
Hand Animated Pose behavior. More... | |
ECBehaviorLocomotion.Instance | locomotion |
Locomotion behavior. More... | |
ECBehaviorVRHand.Instance | vrHand |
VR hand the action is assigned to or null. More... | |
Base VR Hand action.
Action supports the Persistable interface an 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:
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.
|
protected |
Apply animations.
Default implementation calls these method if the behvaiors are present:
void Dragengine.Scenery.BaseVRHandAction.cancel | ( | ) |
Cancel action the next time possible.
void Dragengine.Scenery.BaseVRHandAction.collisionResponse | ( | Collider | owner, |
CollisionInfo | info | ||
) |
Collision detected.
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.
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.
void Dragengine.Scenery.BaseVRHandAction.dispose | ( | ) |
Dispose of actor action.
void Dragengine.Scenery.BaseVRHandAction.enteredGameWorld | ( | ) |
Actor entered game world.
void Dragengine.Scenery.BaseVRHandAction.enterFrame | ( | ) |
Actor has been added to game world and enterFrame() is called once.
BehaviorElement Dragengine.Scenery.BaseVRHandAction.getActor | ( | ) |
Actor the action is assigned to or null.
ECBehaviorConversationActor.Instance Dragengine.Scenery.BaseVRHandAction.getConversationActor | ( | ) |
Conversation actor behavior if present.
ECBehaviorVRHandAction.Instance Dragengine.Scenery.BaseVRHandAction.getHandAction | ( | ) |
Behavior VR hand action or null.
ECBehaviorActorAnimated.Instance Dragengine.Scenery.BaseVRHandAction.getHandAnimated | ( | ) |
Hand animated behavior if present.
ECBehaviorAttachSlot.Instance Dragengine.Scenery.BaseVRHandAction.getHandAttachSlot | ( | ) |
Hand Controller Attach Slot.
ECBehaviorGrabber.Instance Dragengine.Scenery.BaseVRHandAction.getHandGrabber | ( | ) |
Hand Controller Grabber.
ECBehaviorVRHandLaserPointer.Instance Dragengine.Scenery.BaseVRHandAction.getHandLaserPointer | ( | ) |
Hand Controller Laser Pointer.
ECBehaviorVRHandPointAt.Instance Dragengine.Scenery.BaseVRHandAction.getHandPointAt | ( | ) |
Hand Controller Point-At.
ECBehaviorVRHandPose.Instance Dragengine.Scenery.BaseVRHandAction.getHandPose | ( | ) |
Hand Pose.
ECBehaviorLocomotion.Instance Dragengine.Scenery.BaseVRHandAction.getLocomotion | ( | ) |
Locomotion behavior.
ECBehaviorVRHand.Instance Dragengine.Scenery.BaseVRHandAction.getVRHand | ( | ) |
VR hand behavior the action is assigned to or null.
|
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.
|
protected |
Init behaviors.
Retrieve and store required and optional behavior instances from the actor element.
bool Dragengine.Scenery.BaseVRHandAction.isActive | ( | ) |
Action is active hand action.
bool Dragengine.Scenery.BaseVRHandAction.isLeftHand | ( | ) |
Action is left hand.
bool Dragengine.Scenery.BaseVRHandAction.isNotActive | ( | ) |
Action is not active hand action.
bool Dragengine.Scenery.BaseVRHandAction.isRightHand | ( | ) |
Action is right hand.
void Dragengine.Scenery.BaseVRHandAction.leftGameWorld | ( | ) |
Actor left game world.
Log text about element to console prefixed with actor information.
void Dragengine.Scenery.BaseVRHandAction.log | ( | Console | console, |
Exception | exception | ||
) |
Log exception to console prefixed with actor information.
void Dragengine.Scenery.BaseVRHandAction.log | ( | Console | console, |
String | text | ||
) |
Log text to console prefixed with actor information.
void Dragengine.Scenery.BaseVRHandAction.log | ( | Element | element, |
String | text | ||
) |
Log text about element to BaseGameApp console prefixed with actor information.
void Dragengine.Scenery.BaseVRHandAction.log | ( | Exception | exception | ) |
Log exception to BaseGameApp console prefixed with actor information.
void Dragengine.Scenery.BaseVRHandAction.log | ( | String | text | ) |
Log text to BaseGameApp console prefixed with actor information.
String Dragengine.Scenery.BaseVRHandAction.loggingPrefix | ( | ) |
Logging prefix.
Returns string in the form "<actor-class>/<action-class>".
BaseVRHandAction Dragengine.Scenery.BaseVRHandAction.new | ( | ) |
Create actor action.
BaseVRHandAction Dragengine.Scenery.BaseVRHandAction.new | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Create actor action from persisted state.
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.
void Dragengine.Scenery.BaseVRHandAction.playerReleasesControl | ( | ) |
Player released control of actor.
void Dragengine.Scenery.BaseVRHandAction.playerTakesControl | ( | ) |
Player takes control of actor.
void Dragengine.Scenery.BaseVRHandAction.postThink | ( | float | elapsed | ) |
Post physics.
void Dragengine.Scenery.BaseVRHandAction.think | ( | float | elapsed | ) |
Thinking.
Default implementation does these actions in this order:
|
protected |
Update animator controllers.
Default implementation calls these method if the behvaiors are present:
void Dragengine.Scenery.BaseVRHandAction.writeObjectToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write object to file writer.
Implements Dragengine.LoadSave.Persistable.
|
protected |
Actor the action is assigned to or null.
|
protected |
Conversation actor behavior if present.
|
protected |
Behavior VR hand action or null.
|
protected |
Hand animated behavior if present.
|
protected |
Hand Controller Attach Slot behavior.
|
protected |
Hand Controller Grabber behavior.
|
protected |
Hand Controller Laser Pointer behavior.
|
protected |
Hand Controller Point-At behavior.
|
protected |
Hand Animated Pose behavior.
|
protected |
Locomotion behavior.
|
protected |
VR hand the action is assigned to or null.