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

Base VR Hand action using state machine. More...

Inheritance diagram for Dragengine.Scenery.BAAVRHandStateMachine:
Dragengine.Scenery.BaseVRHandAction Dragengine.Scenery.BAAStateMachineEvent

Classes

class  Factory
 Factory for loading actor actions. More...
 

Public Member Functions

void activate (BehaviorElement actor)
 
void activateWhileLoading (BehaviorElement actor)
 
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 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.
 
ECBehaviorStateMachine.Instance getBehaviorStateMachine ()
 State machine behavior.
 
SMContext getContext ()
 State machine context.
 
StateMachine getStateMachine ()
 State machine.
 
void leftGameWorld ()
 Actor left game world.
 
BAAVRHandStateMachine new ()
 Create actor action.
 
BAAVRHandStateMachine new (PersistencyEnvironment env, FileReader reader)
 Create actor ai restoring from file reader.
 
BAAVRHandStateMachine new (StateMachine stateMachine)
 Create actor ai using state machine.
 
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 sendInputAsEvent (String event, Object parameter)
 Send input as event to state machine.
 
void setBehaviorStateMachine (ECBehaviorStateMachine.Instance behavior)
 Set behavior behavior.
 
void setContext (SMContext context)
 Set state machine context.
 
void setStateMachine (StateMachine stateMachine)
 Set state machine to use or null.
 
void think (float elapsed)
 Thinking.
 
void writeObjectToFile (PersistencyEnvironment env, FileWriter writer)
 Write object to file writer.
 
- Public Member Functions inherited from Dragengine.Scenery.BaseVRHandAction
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 deactivate ()
 Action has been unset as active hand action.
 
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 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.
 

Public Attributes

ECBehaviorStateMachine.Instance pBehaviorStateMachine
 
SMContext pContext
 
String pLoadStateId
 
StateMachine pStateMachine
 

Protected Member Functions

void initBehaviors ()
 Init behaviors.
 
- Protected Member Functions inherited from Dragengine.Scenery.BaseVRHandAction
void applyAnimations ()
 Apply animations.
 
void initAnimator ()
 Initialize animator.
 
void updateAnimator (float elapsed)
 Update animator controllers.
 

Additional Inherited Members

- Protected Attributes inherited from Dragengine.Scenery.BaseVRHandAction
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.
 

Detailed Description

Base VR Hand action using state machine.

Version
1.26

This class adds support to send state machine events for inputs for these interfaces:

  • BAAVRGrab
  • BAAVRMenuInput
  • BAAVRTriggerInput

Otherwise the state machine is responsible for the entire action handling. Helper behaviors provide common actions and conditions to simplify this task.

The following events can be send to the state machine:

  • activate
  • activateWhileLoading
  • enteredGameWorld
  • leftGameWorld
  • enterFrame
  • playerTakesControl
  • playerReleasesControl
  • think
  • cancel
  • collisionResponse

Input events are send to state machine using interface BAAStateMachineEvent. For further information see the respective bridge classes:

  • Commands.CommandsBAAVRGrab::StateMachineEventBridge
  • Commands.CommandsBAAVRMenuInput::StateMachineEventBridge
  • Commands.CommandsBAAVRTriggerInput::StateMachineEventBridge

Member Function Documentation

◆ activate()

void Dragengine.Scenery.BAAVRHandStateMachine.activate ( BehaviorElement  actor)

◆ activateWhileLoading()

void Dragengine.Scenery.BAAVRHandStateMachine.activateWhileLoading ( BehaviorElement  actor)

◆ cancel()

void Dragengine.Scenery.BAAVRHandStateMachine.cancel ( )

Cancel action the next time possible.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ collisionResponse()

void Dragengine.Scenery.BAAVRHandStateMachine.collisionResponse ( Collider  owner,
CollisionInfo  info 
)

Collision detected.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ conversationWait()

bool Dragengine.Scenery.BAAVRHandStateMachine.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 from Dragengine.Scenery.BaseVRHandAction.

◆ dispose()

void Dragengine.Scenery.BAAVRHandStateMachine.dispose ( )

Dispose of actor action.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ enteredGameWorld()

void Dragengine.Scenery.BAAVRHandStateMachine.enteredGameWorld ( )

Actor entered game world.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ enterFrame()

void Dragengine.Scenery.BAAVRHandStateMachine.enterFrame ( )

Actor has been added to game world and enterFrame() is called once.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ getBehaviorStateMachine()

ECBehaviorStateMachine.Instance Dragengine.Scenery.BAAVRHandStateMachine.getBehaviorStateMachine ( )

State machine behavior.

◆ getContext()

SMContext Dragengine.Scenery.BAAVRHandStateMachine.getContext ( )

State machine context.

◆ getStateMachine()

StateMachine Dragengine.Scenery.BAAVRHandStateMachine.getStateMachine ( )

State machine.

Version
1.26

◆ initBehaviors()

void Dragengine.Scenery.BAAVRHandStateMachine.initBehaviors ( )
protected

Init behaviors.

Retrieve and store required and optional behavior instances from the actor element.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ leftGameWorld()

void Dragengine.Scenery.BAAVRHandStateMachine.leftGameWorld ( )

Actor left game world.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ new() [1/3]

BAAVRHandStateMachine Dragengine.Scenery.BAAVRHandStateMachine.new ( )

Create actor action.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ new() [2/3]

BAAVRHandStateMachine Dragengine.Scenery.BAAVRHandStateMachine.new ( PersistencyEnvironment  env,
FileReader  reader 
)

Create actor ai restoring from file reader.

Version
1.26

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ new() [3/3]

BAAVRHandStateMachine Dragengine.Scenery.BAAVRHandStateMachine.new ( StateMachine  stateMachine)

Create actor ai using state machine.

Version
1.26

◆ persistencyFactoryName()

String Dragengine.Scenery.BAAVRHandStateMachine.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.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ playerReleasesControl()

void Dragengine.Scenery.BAAVRHandStateMachine.playerReleasesControl ( )

Player released control of actor.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ playerTakesControl()

void Dragengine.Scenery.BAAVRHandStateMachine.playerTakesControl ( )

Player takes control of actor.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ postThink()

void Dragengine.Scenery.BAAVRHandStateMachine.postThink ( float  elapsed)

Post physics.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ sendInputAsEvent()

void Dragengine.Scenery.BAAVRHandStateMachine.sendInputAsEvent ( String  event,
Object  parameter 
)

Send input as event to state machine.

Parameters
eventEvent to send.
parameterOptional parameter or null.

Implements Dragengine.Scenery.BAAStateMachineEvent.

◆ setBehaviorStateMachine()

void Dragengine.Scenery.BAAVRHandStateMachine.setBehaviorStateMachine ( ECBehaviorStateMachine.Instance  behavior)

Set behavior behavior.

◆ setContext()

void Dragengine.Scenery.BAAVRHandStateMachine.setContext ( SMContext  context)

Set state machine context.

◆ setStateMachine()

void Dragengine.Scenery.BAAVRHandStateMachine.setStateMachine ( StateMachine  stateMachine)

Set state machine to use or null.

Version
1.26

Change affects context only before #activate() has been called.

◆ think()

void Dragengine.Scenery.BAAVRHandStateMachine.think ( float  elapsed)

Thinking.

Default implementation does these actions in this order:

  • updateAnimator()
  • applyAnimations()

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

◆ writeObjectToFile()

void Dragengine.Scenery.BAAVRHandStateMachine.writeObjectToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write object to file writer.

Reimplemented from Dragengine.Scenery.BaseVRHandAction.

Member Data Documentation

◆ pBehaviorStateMachine

ECBehaviorStateMachine.Instance Dragengine.Scenery.BAAVRHandStateMachine.pBehaviorStateMachine

◆ pContext

SMContext Dragengine.Scenery.BAAVRHandStateMachine.pContext

◆ pLoadStateId

String Dragengine.Scenery.BAAVRHandStateMachine.pLoadStateId

◆ pStateMachine

StateMachine Dragengine.Scenery.BAAVRHandStateMachine.pStateMachine

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