Drag[en]gine Script Module DragonScript
1.23
|
Physics element. More...
Public Member Functions | |
ECBehaviorAttachToParent.Instance | getAttachToParent () |
Attach to parent behavior instance. More... | |
ECBehaviorCollider.Instance | getCollider () |
Collider behavior instance. More... | |
ECBehaviorComponent.Instance | getComponent () |
Component behavio instance. More... | |
PhysicsElement | new (PhysicsElementClass eclass) |
Create element. More... | |
void | visit (ElementVisitor visitor) |
Visit element. More... | |
Public Member Functions inherited from Dragengine.Scenery.BehaviorElement | |
void | addAttachableBehavior (ECAttachableBehavior behavior) |
Add attached behavior. More... | |
Array | collectAttachableBehaviors (Block ablock) |
Collect attached behaviors with block into Array. More... | |
Array | collectInstances (Block ablock) |
Collect behavior instance with block into Array. More... | |
ECAttachableBehavior | findAttachableBehavior (Block ablock) |
Find attached behavior with block. More... | |
ECBehaviorInstance | findInstance (Block ablock) |
Find behavior instance with block. More... | |
void | forEachAttachableBehavior (Block ablock) |
Visit attached s with block. More... | |
void | forEachAttachableBehaviorReverse (Block ablock) |
Visit attached behaviors with block in reverse order. More... | |
void | forEachInstance (Block ablock) |
Visit behavior instances with block. More... | |
void | forEachInstanceReverse (Block ablock) |
Visit behavior instances with block in reverse order. More... | |
ECAttachableBehavior | getAttachableBehaviorAt (int index) |
Attached behavior at index. More... | |
int | getAttachableBehaviorCount () |
Count of attachaed behaviors. More... | |
bool | getRequiresAttachToParent () |
Attach to parent has not been processed yet. More... | |
bool | getRequiresEnterFrame () |
Sub-class requires enterFrame() to be called. More... | |
bool | getRequiresThink () |
Sub-class requires think() to be called. More... | |
bool | isChangingGameWorld () |
Behavior element is in progress of beeing added to or removed from a GameWorld. More... | |
bool | isReallyInGameWorld () |
Element is in GameWorld and not in progress of beeing removed from it. More... | |
BehaviorElement | new (BehaviorElementClass eclass) |
Create element. More... | |
void | onSetPosition () |
Position changed. More... | |
void | removeAttachableBehavior (ECAttachableBehavior behavior) |
Remove attached behavior. More... | |
void | requiresThinkChanged () |
Requires thinking changed. More... | |
void | setRequiresAttachToParent (bool requiresAttachToParent) |
Set if attach to parent has not been processed yet. More... | |
Public Member Functions inherited from Dragengine.Scenery.Element | |
void | addToGameWorld () |
Dictionary | debugInformation () |
Debug information as Dictionary. More... | |
void | dispose () |
Dispose of element. More... | |
void | enterFrame () |
Frame update started. More... | |
ElementClass | getClass () |
DMatrix | getElementMatrix () |
Matrix to transform from element space into world space. More... | |
GameWorld | getGameWorld () |
UniqueID | getID () |
DMatrix | getInverseElementMatrix () |
Matrix to transform from world space into element space. More... | |
bool | getIsScaled () |
Is scaled. More... | |
Quaternion | getOrientation () |
Orientation. More... | |
Element | getParent () |
DVector | getPosition () |
Position. More... | |
Vector | getScaling () |
Scaling. More... | |
StubElement | getStub () |
Element stub used to create the element. More... | |
bool | getTouchable () |
bool | getVisible () |
void | init (StubElement stub) |
Initialize element from stub. More... | |
bool | isChildOf (Element parent) |
bool | isDisposed () |
Element has been disposed of. More... | |
bool | isMyselfOrChildOf (Element parent) |
bool | isNotDisposed () |
Element has not been disposed of. More... | |
void | log (String message) |
Log using BaseGameApp Console if present. More... | |
Element | new (ElementClass elementClass) |
void | onSetGameWorld () |
void | onSetGeometry () |
Position, orientation or scaling changed. More... | |
void | onSetOrientation () |
Orientation changed. More... | |
void | onSetParent () |
void | onSetScaling () |
Scaling changed. More... | |
void | onSetTouchable () |
void | onSetVisible () |
void | postThink (float elapsed) |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read element from file reader. More... | |
void | removeFromGameWorld () |
void | removeFromGameWorldIfPresent () |
Remove element from game world if present. More... | |
void | safeDispose () |
Remove element from game world if present and dispose of element. More... | |
void | setGameWorld (GameWorld gameWorld) |
void | setGeometry (DVector position, Quaternion orientation) |
Set position and orientation. More... | |
void | setGeometry (DVector position, Quaternion orientation, Vector scaling) |
Set position, orientation and scaling of element. More... | |
void | setID (UniqueID id) |
void | setOrientation (Quaternion orientation) |
Set orientation. More... | |
void | setParent (Element parent) |
void | setPosition (DVector position) |
Set position. More... | |
void | setScaling (Vector scaling) |
Set scaling. More... | |
void | setStub (StubElement stub) |
Set element stub used to create the element. More... | |
void | setTouchable (bool touchable) |
void | setVisible (bool visible) |
void | think (float elapsed) |
String | toString () |
void | updateStubGeometryFromElement () |
Update stub position, rotation and scaling from element. More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write element to file writer. More... | |
void | writeToFileWithStub (PersistencyEnvironment env, FileWriter writer) |
Write element to file writer with stub. More... | |
Physics element.
Physics behavior element composing of these behaviors:
This class is a quick way to add physics elements to a game world. Such elements use CollisionResponse.dynamic and are affected by physical simulation. You can create new element classes by subclassing and adding additional behaviors. It is usually though better to create a new BehaviorElementClass subclass instead adding the desired behaviors. This also allows to use subclassed behaviors for specific needs.
The default collision filter makes the physics element being affected by BaseGameApp.CollisionFilterBit.actor but not BaseGameApp.CollisionFilterBit.actorAI . This is on purpose. If BaseGameApp.CollisionFilterBit.actorAI is used then the actor will stop moving when it touches the physics element. This prevents the actor from pushing the physics element. Instead by using BaseGameApp.CollisionFilterBit.actor the actor AI collider is moving through the physics element as if it is not present. The regular collider present in the actor can then be used to assign a shape which affects the physics element.
ECBehaviorAttachToParent.Instance Dragengine.Scenery.PhysicsElement.getAttachToParent | ( | ) |
Attach to parent behavior instance.
ECBehaviorCollider.Instance Dragengine.Scenery.PhysicsElement.getCollider | ( | ) |
Collider behavior instance.
ECBehaviorComponent.Instance Dragengine.Scenery.PhysicsElement.getComponent | ( | ) |
Component behavio instance.
PhysicsElement Dragengine.Scenery.PhysicsElement.new | ( | PhysicsElementClass | eclass | ) |
Create element.
void Dragengine.Scenery.PhysicsElement.visit | ( | ElementVisitor | visitor | ) |
Visit element.
Reimplemented from Dragengine.Scenery.Element.