Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ECBehaviorCollider.Instance Class Reference

Behavior instance. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorCollider.Instance:
Dragengine.Scenery.DefaultECBehaviorInstance Dragengine.Scenery.ColliderListener Dragengine.Scenery.ECBehaviorInstance

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...
 

Detailed Description

Behavior instance.

Member Function Documentation

◆ addListener()

void Dragengine.Scenery.ECBehaviorCollider.Instance.addListener ( Listener  listener)

Add listener.

◆ addToGameWorld()

void Dragengine.Scenery.ECBehaviorCollider.Instance.addToGameWorld ( )

Add element to game world.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ canHitCollider()

bool Dragengine.Scenery.ECBehaviorCollider.Instance.canHitCollider ( Collider  owner,
Collider  collider 
)

Colliders can hit each other.

Implements Dragengine.Scenery.ColliderListener.

◆ collisionResponse()

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.

◆ createCollider()

Collider Dragengine.Scenery.ECBehaviorCollider.Instance.createCollider ( StubElement  stub,
ECBehaviorComponent.Instance  component 
)
protected

Create collider.

Parameters
stubStub to use.
componentComponent to use or null if absent.

◆ dispose()

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

Dispose of composeable instance.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ geometryChanged()

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

Position or orientation changed.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ getCollider()

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

◆ getECBehavior()

ECBehaviorCollider Dragengine.Scenery.ECBehaviorCollider.Instance.getECBehavior ( )

Behavior.

◆ getRigShapeProperty() [1/2]

String Dragengine.Scenery.ECBehaviorCollider.Instance.getRigShapeProperty ( CollisionInfo  info,
bool  owner 
)

Rig shape property from collision or null if not possible.

◆ getRigShapeProperty() [2/2]

String Dragengine.Scenery.ECBehaviorCollider.Instance.getRigShapeProperty ( int  bone,
int  shape 
)

Rig shape property or null if not possible.

◆ init()

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

Initialize element from stub.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ new()

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

Create element.

◆ readBoneState()

bool Dragengine.Scenery.ECBehaviorCollider.Instance.readBoneState ( PersistencyEnvironment  env,
FileReader  reader,
ColliderRig  collider 
)
protected

Read bone state from file.

Version
1.15

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.

Returns
true if bone state has been read or false if empty string has been read.

◆ readBoneStates()

void Dragengine.Scenery.ECBehaviorCollider.Instance.readBoneStates ( PersistencyEnvironment  env,
FileReader  reader 
)
protected

Read bone states from file.

Version
1.15

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.

◆ readColliderState()

void Dragengine.Scenery.ECBehaviorCollider.Instance.readColliderState ( PersistencyEnvironment  env,
FileReader  reader 
)
protected

Read collider parameters from file.

Version
1.15

◆ readFromFile()

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

Read behavior from file.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ removeFromGameWorld()

void Dragengine.Scenery.ECBehaviorCollider.Instance.removeFromGameWorld ( )

Remove element from game world.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ removeListener()

void Dragengine.Scenery.ECBehaviorCollider.Instance.removeListener ( Listener  listener)

Remove listener.

◆ stateChanged()

void Dragengine.Scenery.ECBehaviorCollider.Instance.stateChanged ( )

State changed (visble, touchable).

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ writeBoneStates()

void Dragengine.Scenery.ECBehaviorCollider.Instance.writeBoneStates ( PersistencyEnvironment  env,
FileWriter  writer 
)
protected

Write bone states to file.

Version
1.15

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.

◆ writeDynamicBoneState()

void Dragengine.Scenery.ECBehaviorCollider.Instance.writeDynamicBoneState ( FileWriter  writer,
ColliderRig  collider,
int  bone 
)
protected

Write bone state to file.

Version
1.15

Writes bone name as 8-bit string then position (DVector), orientation (Quaternion) linear velocity (Vector) and angular velocity (Vector).

◆ writeDynamicBoneStates()

void Dragengine.Scenery.ECBehaviorCollider.Instance.writeDynamicBoneStates ( FileWriter  writer)
protected

Write dynamic bone states to file.

Version
1.15

◆ writeToFile()

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

Write behavior to file.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.


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