Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorLocomotion.Instance Class Reference

Behavior instance. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorLocomotion.Instance:
Dragengine.Scenery.DefaultECBehaviorInstance Dragengine.Scenery.ECBehaviorInstance

Public Member Functions

void applyLookAround (float deltaHorizontal, float deltaVertical)
 Apply looking around changes to locomotion. More...
 
void dispose ()
 Dispose of instance. More...
 
void geometryChanged ()
 Position, orientation or size changed. More...
 
ECBehaviorCollider.Instance getCollider ()
 Collider behavior instance or null. More...
 
ECBehaviorColliderAI.Instance getColliderAI ()
 ColliderAI behavior instance or null. More...
 
ECBehaviorLocomotion getECBehavior ()
 Behavior. More...
 
Locomotion getLocomotion ()
 Locomotion. More...
 
Vector getViewDirection ()
 View direction. More...
 
Matrix getViewMatrix ()
 View matrix. More...
 
void init (StubElement stub)
 Initialize element from stub. More...
 
void initHuman (float averageSpeed)
 Initialize locomotion with common human actor parameters. More...
 
void initVehicle (float averageSpeed)
 Initialize locomotion with common vehicle parameters. More...
 
Instance new (ECBehaviorLocomotion ecbehavior, BehaviorElement element)
 Create instance. More...
 
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read element from file. More...
 
void resetLooking ()
 Reset looking vertically and horizontally to 0. More...
 
void setOrientation (float orientation)
 Set locomotion orientation in euler angles in world coordinates. More...
 
void setOrientationFromUpAxis ()
 Set locomotion orientation from element up axis. More...
 
void stopMoving ()
 Clear all movement to ensure actor is not unintentially moving. More...
 
void update (float elapsed)
 Update locomotion. More...
 
void updateAnimator (float elapsed)
 Update animator controllers. More...
 
void updatePost (float elapsed)
 Post-Update locomotion. More...
 
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write element to file. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance
void addToGameWorld ()
 Add element to game world. More...
 
void attachToParent (Element parent)
 Attach element to object set by the mapper in the IGDE World Editor. More...
 
void enterFrame ()
 Frame update started. More...
 
BehaviorElement getElement ()
 Behavior element to apply behavior to. More...
 
int getInstanceIndex ()
 Behavior instance index. More...
 
DefaultECBehaviorInstance new (BehaviorElement element)
 Create default composeable instance. More...
 
void postThink (float elapsed)
 Post thinking after physics processing is finished. More...
 
void removeFromGameWorld ()
 Remove element from game world. More...
 
bool requiresEnterFrame ()
 Behavior instance requires enterFrame() to be called. More...
 
bool requiresThink ()
 Behavior instance requires think() to be called. More...
 
void stateChanged ()
 State changed (visble, touchable). More...
 
void think (float elapsed)
 Think about what to do for the next frame update. More...
 

Protected Member Functions

Locomotion createLocomotion (StubElement stub)
 Create locomotion. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance
void setRequiresEnterFrame (bool required)
 Set if behavior instance requires enterFrame() to be called. More...
 
void setRequiresThink (bool required)
 Set if behavior instance requires think() to be called. More...
 

Detailed Description

Behavior instance.

Member Function Documentation

◆ applyLookAround()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.applyLookAround ( float  deltaHorizontal,
float  deltaVertical 
)

Apply looking around changes to locomotion.

Typically called for player controlled actors only.

◆ createLocomotion()

Locomotion Dragengine.Scenery.ECBehaviorLocomotion.Instance.createLocomotion ( StubElement  stub)
protected

Create locomotion.

Creates instance of Locomotion.

◆ dispose()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.dispose ( )

Dispose of instance.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ geometryChanged()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.geometryChanged ( )

Position, orientation or size changed.

Adjusts locomotion orientation to line up with the actor orientation. Moving orientation is kept untouched with moving direction adjusted to be correct.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ getCollider()

ECBehaviorCollider.Instance Dragengine.Scenery.ECBehaviorLocomotion.Instance.getCollider ( )

Collider behavior instance or null.

◆ getColliderAI()

ECBehaviorColliderAI.Instance Dragengine.Scenery.ECBehaviorLocomotion.Instance.getColliderAI ( )

ColliderAI behavior instance or null.

◆ getECBehavior()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorLocomotion.Instance.getECBehavior ( )

Behavior.

◆ getLocomotion()

Locomotion Dragengine.Scenery.ECBehaviorLocomotion.Instance.getLocomotion ( )

◆ getViewDirection()

Vector Dragengine.Scenery.ECBehaviorLocomotion.Instance.getViewDirection ( )

View direction.

◆ getViewMatrix()

Matrix Dragengine.Scenery.ECBehaviorLocomotion.Instance.getViewMatrix ( )

View matrix.

◆ init()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.init ( StubElement  stub)

Initialize element from stub.

Calls initHuman() with a speed of 4.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ initHuman()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.initHuman ( float  averageSpeed)

Initialize locomotion with common human actor parameters.

Sets these parameters:

  • Can turn: yes
  • Can turn in-place: yes
  • Linear velocity adjust range: Actor element class run speed
  • Linear velocity adjust time: 1
  • Moving left right adjust time: 0
  • Looking limits: -80..80 (up-down) and -90..90 (left-right)
  • Looking adjust times: 1
  • Orientation adjust time: 1
  • Turn adjust look left-right: yes
  • Turn in-place limit: -70..70
  • Turn in-place adjust time: 1
Parameters
speedAverage speed of actor used to calculate adjustment speed. Using running speed of actor is a good value.

◆ initVehicle()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.initVehicle ( float  averageSpeed)

Initialize locomotion with common vehicle parameters.

Sets these initial parameters:

  • Can turn: yes
  • Can turn in-place: no
  • Linear velocity adjust range: Actor element class run speed
  • Linear velocity adjust time: 0.5
  • Moving left right adjust time: 0
  • Looking limits: -80..80 (up-down) and -90..90 (left-right)
  • Looking adjust times: 0
  • Orientation adjust time: 1
  • Turn adjust look left-right: no
  • Turn in-place limit: -70..70
  • Turn in-place adjust time: 1

These values are suitable for player controlled actors. For non-player controlled actors it might be useful to set these additional parameters:

  • Looking adjust time: 1
  • Linear velocity adjust time: 1
Parameters
speedAverage speed of actor used to calculate adjustment speed. Using running speed of actor is a good value.

◆ new()

Instance Dragengine.Scenery.ECBehaviorLocomotion.Instance.new ( ECBehaviorLocomotion  ecbehavior,
BehaviorElement  element 
)

Create instance.

◆ readFromFile()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.readFromFile ( PersistencyEnvironment  env,
FileReader  reader 
)

Read element from file.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ resetLooking()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.resetLooking ( )

Reset looking vertically and horizontally to 0.

◆ setOrientation()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.setOrientation ( float  orientation)

Set locomotion orientation in euler angles in world coordinates.

◆ setOrientationFromUpAxis()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.setOrientationFromUpAxis ( )

Set locomotion orientation from element up axis.

Adjusts locomotion orientation to line up with the actor orientation. Moving orientation is kept untouched with moving direction adjusted to be correct.

◆ stopMoving()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.stopMoving ( )

Clear all movement to ensure actor is not unintentially moving.

◆ update()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.update ( float  elapsed)

Update locomotion.

Calls Locomotion.updateLooking() to pull the look-around values towards their goal values with the set adjustment velocities. Then Locomotion.updateLocomotion() is called to update all the locomotion parameters for later use.

◆ updateAnimator()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.updateAnimator ( float  elapsed)

Update animator controllers.

Calls Locomotion.updateAnimatorInstance() to update animator controller for which mappings have been defined.

◆ updatePost()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.updatePost ( float  elapsed)

Post-Update locomotion.

Called by postThink() if auto-updating is enabled. For actors auto-thinking is set to false allowing actor to call updatePost() in the appropriate time.

Calls Locomotion.updatePostLocomotion() to apply tilting and foot projecting which can be done only after physics have been calculated.

◆ writeToFile()

void Dragengine.Scenery.ECBehaviorLocomotion.Instance.writeToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Write element to file.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.


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