Drag[en]gine Script Module DragonScript
1.21
|
Behavior instance. More...
Public Member Functions | |
void | addListener (Listener listener) |
Add listener. More... | |
void | addToGameWorld () |
Add element to game world. More... | |
bool | canHitCollider (Collider owner, Collider collider) |
Colliders can hit each other. More... | |
void | collisionResponse (Collider owner, CollisionInfo info) |
Collision detected. More... | |
void | dispose () |
Dispose of composeable instance. More... | |
void | geometryChanged () |
Position or orientation changed. More... | |
Collider | getCollider () |
Collider. More... | |
ECBehaviorCollider | getECBehavior () |
Behavior. More... | |
String | getRigShapeProperty (CollisionInfo info, bool owner) |
Rig shape property from collision or null if not possible. More... | |
String | getRigShapeProperty (int bone, int shape) |
Rig shape property or null if not possible. More... | |
void | init (StubElement stub) |
Initialize element from stub. More... | |
Instance | new (ECBehaviorCollider ecbehavior, BehaviorElement element) |
Create element. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read behavior from file. More... | |
void | removeFromGameWorld () |
Remove element from game world. More... | |
void | removeListener (Listener listener) |
Remove listener. More... | |
void | stateChanged () |
State changed (visble, touchable). More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write behavior to file. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance | |
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... | |
bool | requiresEnterFrame () |
Behavior instance requires enterFrame() to be called. More... | |
bool | requiresThink () |
Behavior instance requires think() to be called. More... | |
void | think (float elapsed) |
Think about what to do for the next frame update. More... | |
Public Member Functions inherited from Dragengine.Scenery.ColliderListener | |
void | colliderChanged (Collider owner) |
Collider properties have changed and attached resources have been updated. More... | |
Protected Member Functions | |
Collider | createCollider (StubElement stub, ECBehaviorComponent.Instance component) |
Create collider. More... | |
bool | readBoneState (PersistencyEnvironment env, FileReader reader, ColliderRig collider) |
Read bone state from file. More... | |
void | readBoneStates (PersistencyEnvironment env, FileReader reader) |
Read bone states from file. More... | |
void | readColliderState (PersistencyEnvironment env, FileReader reader) |
Read collider parameters from file. More... | |
void | writeBoneStates (PersistencyEnvironment env, FileWriter writer) |
Write bone states to file. More... | |
void | writeDynamicBoneState (FileWriter writer, ColliderRig collider, int bone) |
Write bone state to file. More... | |
void | writeDynamicBoneStates (FileWriter writer) |
Write dynamic bone states to file. 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.ECBehaviorCollider.Instance.addListener | ( | Listener | listener | ) |
Add listener.
void Dragengine.Scenery.ECBehaviorCollider.Instance.addToGameWorld | ( | ) |
Add element to game world.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
bool Dragengine.Scenery.ECBehaviorCollider.Instance.canHitCollider | ( | Collider | owner, |
Collider | collider | ||
) |
Colliders can hit each other.
Implements Dragengine.Scenery.ColliderListener.
void Dragengine.Scenery.ECBehaviorCollider.Instance.collisionResponse | ( | Collider | owner, |
CollisionInfo | info | ||
) |
Collision detected.
If listeners are present calls collisionResponse() on all listeners expecting them to handle collision properly. Otherwise for static and kinematic collision response clears linear and angular velocity. For dynamic collision response nothing is done.
Implements Dragengine.Scenery.ColliderListener.
|
protected |
Create collider.
stub | Stub to use. |
component | Component to use or null if absent. |
void Dragengine.Scenery.ECBehaviorCollider.Instance.dispose | ( | ) |
Dispose of composeable instance.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorCollider.Instance.geometryChanged | ( | ) |
Position or orientation changed.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
ECBehaviorCollider Dragengine.Scenery.ECBehaviorCollider.Instance.getECBehavior | ( | ) |
Behavior.
String Dragengine.Scenery.ECBehaviorCollider.Instance.getRigShapeProperty | ( | CollisionInfo | info, |
bool | owner | ||
) |
Rig shape property from collision or null if not possible.
String Dragengine.Scenery.ECBehaviorCollider.Instance.getRigShapeProperty | ( | int | bone, |
int | shape | ||
) |
Rig shape property or null if not possible.
void Dragengine.Scenery.ECBehaviorCollider.Instance.init | ( | StubElement | stub | ) |
Initialize element from stub.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
Instance Dragengine.Scenery.ECBehaviorCollider.Instance.new | ( | ECBehaviorCollider | ecbehavior, |
BehaviorElement | element | ||
) |
Create element.
|
protected |
Read bone state from file.
Reads first the bone name. If the name is empty string this marks the end of the bone state list and the function exits. Otherwise reads position (DVector), orientation (Quaternion), linear velocity (Vector) and angular velocity (Vector). If the bone name is found int he collider the respective bone parameters are set. If the bone name is not found in the rig nothing is done. This allows loading bone states from file in case the rig does not match anymore. The so restored bone states are potentially incomplete but at last the bone states can be successfully read from file.
The parameter collider can be null if collider is not of the matching type. In this case bone state has to be read but not applied as if the bone name is not found.
|
protected |
Read bone states from file.
Calls readBoneState() until the false is returned. If any bone states have been read and collider is castable to ColliderComponent then copyStatesToComponent() is called to ensure component bone states match collider bone states.
|
protected |
Read collider parameters from file.
void Dragengine.Scenery.ECBehaviorCollider.Instance.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read behavior from file.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorCollider.Instance.removeFromGameWorld | ( | ) |
Remove element from game world.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorCollider.Instance.removeListener | ( | Listener | listener | ) |
Remove listener.
void Dragengine.Scenery.ECBehaviorCollider.Instance.stateChanged | ( | ) |
State changed (visble, touchable).
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
|
protected |
Write bone states to file.
Subclass can overwrite to determine which bone states to write. Default implementation calls writeDynamicBoneStates() if collider response type is CollisionResponse.dynamic. For each bone state to write call writeBoneStates(). After writing all bone states write an empty 8-bit string to mark the end of the bone state list.
|
protected |
Write bone state to file.
Writes bone name as 8-bit string then position (DVector), orientation (Quaternion) linear velocity (Vector) and angular velocity (Vector).
|
protected |
Write dynamic bone states to file.
void Dragengine.Scenery.ECBehaviorCollider.Instance.writeToFile | ( | PersistencyEnvironment | env, |
FileWriter | writer | ||
) |
Write behavior to file.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.