Drag[en]gine Script Module DragonScript
1.23
|
Behavior instance. More...
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... | |
Behavior instance.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.applyLookAround | ( | float | deltaHorizontal, |
float | deltaVertical | ||
) |
Apply looking around changes to locomotion.
Typically called for player controlled actors only.
|
protected |
Create locomotion.
Creates instance of Locomotion.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.dispose | ( | ) |
Dispose of instance.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
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.
ECBehaviorCollider.Instance Dragengine.Scenery.ECBehaviorLocomotion.Instance.getCollider | ( | ) |
Collider behavior instance or null.
ECBehaviorColliderAI.Instance Dragengine.Scenery.ECBehaviorLocomotion.Instance.getColliderAI | ( | ) |
ColliderAI behavior instance or null.
ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorLocomotion.Instance.getECBehavior | ( | ) |
Behavior.
Locomotion Dragengine.Scenery.ECBehaviorLocomotion.Instance.getLocomotion | ( | ) |
Vector Dragengine.Scenery.ECBehaviorLocomotion.Instance.getViewDirection | ( | ) |
View direction.
Matrix Dragengine.Scenery.ECBehaviorLocomotion.Instance.getViewMatrix | ( | ) |
View matrix.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.init | ( | StubElement | stub | ) |
Initialize element from stub.
Calls initHuman() with a speed of 4.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.initHuman | ( | float | averageSpeed | ) |
Initialize locomotion with common human actor parameters.
Sets these parameters:
speed | Average speed of actor used to calculate adjustment speed. Using running speed of actor is a good value. |
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.initVehicle | ( | float | averageSpeed | ) |
Initialize locomotion with common vehicle parameters.
Sets these initial parameters:
These values are suitable for player controlled actors. For non-player controlled actors it might be useful to set these additional parameters:
speed | Average speed of actor used to calculate adjustment speed. Using running speed of actor is a good value. |
Instance Dragengine.Scenery.ECBehaviorLocomotion.Instance.new | ( | ECBehaviorLocomotion | ecbehavior, |
BehaviorElement | element | ||
) |
Create instance.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read element from file.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.resetLooking | ( | ) |
Reset looking vertically and horizontally to 0.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.setOrientation | ( | float | orientation | ) |
Set locomotion orientation in euler angles in world coordinates.
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.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.stopMoving | ( | ) |
Clear all movement to ensure actor is not unintentially moving.
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.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.updateAnimator | ( | float | elapsed | ) |
Update animator controllers.
Calls Locomotion.updateAnimatorInstance() to update animator controller for which mappings have been defined.
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.
void Dragengine.Scenery.ECBehaviorLocomotion.Instance.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write element to file.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.