Drag[en]gine Script Module DragonScript
1.23
|
Physics element class. More...
Public Member Functions | |
ElementClass | duplicateNamed (String classname) |
Create copy of element class. More... | |
ECBehaviorAttachToParent | getAttachToParent () |
Attach to parent behavior. More... | |
ECBehaviorCollider | getCollider () |
Collider behavior. More... | |
ECBehaviorComponent | getComponent () |
Component behavior. More... | |
PhysicsElementClass | new () |
Create element class using loaders from BaseGameApp. More... | |
PhysicsElementClass | new (String className) |
Create element class using loaders from BaseGameApp. More... | |
Public Member Functions inherited from Dragengine.Scenery.BehaviorElementClass | |
void | addBehavior (ECBehavior behavior) |
Add behavior. More... | |
void | addPrepareStubBehavior (BehaviorPrepareStub behavior) |
Add behavior to be notified before initialization is done. More... | |
Array | collectBehaviors (Block ablock) |
Collect behaviors with block into Array. More... | |
void | createAndAddElement (StubElement stub, GameWorld gameWorld) |
Create element from given stub and add it to game world. More... | |
void | dispose () |
Dispose of element class. More... | |
ECBehavior | findBehavior (Block ablock) |
Find behavior with block. More... | |
void | forEachBehavior (Block ablock) |
Visit behaviors with block. More... | |
void | forEachBehaviorDirect (Block ablock) |
Visit behaviors with block. More... | |
void | forEachPrepareStubBehavior (Block ablock) |
Visit prepare stub behaviors with block. version 1.23. More... | |
void | forEachPreventCreationBehavior (Block ablock) |
Visit prevent creation behaviors with block. version 1.23. More... | |
ECBehavior | getBehaviorAt (int index) |
Behavior at index. More... | |
BehaviorElementClass | new (Loaders loaders) |
Create element class. More... | |
BehaviorElementClass | new (String className, Loaders loaders) |
Create element class. More... | |
void | prepareStubs (StubElement stub, GameWorld gameWorld, bool loading) |
Call prepareStub on all prepare stub behaviors. More... | |
bool | preventCreation (StubElement stub, GameWorld gameWorld) |
Call prepareStub on all prepare stub behaviors. More... | |
Public Member Functions inherited from Dragengine.Scenery.ElementClass | |
void | addProperty (ElementClassProperty property) |
Add property. More... | |
void | copyPropertyValues (ElementClass eclass) |
Copy values of properties from another class to properties of this class. More... | |
Element | createElement (StubElement stub) |
Create element instance from stub. More... | |
bool | equals (Object obj) |
Element class is equal to another object. More... | |
void | failedLoading (String path, ResourceLoaderType resourceType) |
Resource failed loading. More... | |
void | finishedLoading (String path, ResourceLoaderType resourceType, Object resource) |
Resource finished loading successfully. More... | |
void | forEachProperty (Block ablock) |
Visit properties with block with parameter ElementClass. More... | |
String | getBasePath () |
Base path for relative loading of resource properties. More... | |
CodecPropertyString | getCodecPropertyString () |
Property codec helper. More... | |
bool | getIsXmlElementClass () |
Element class is an XML element class. More... | |
bool | getPersistable () |
Element class is persistable to file writers. More... | |
int | getPropertyCount () |
Number of properties. More... | |
ElementClassProperty | getPropertyNamed (String name) |
Named property or null if absent. More... | |
Array | getPropertyNames () |
List of property names as array of strings. More... | |
TSTriggerExpressionParser | getTriggerExpressionParser () |
Trigger expression parser. More... | |
int | hashCode () |
Hash code. More... | |
bool | hasPropertyNamed (String name) |
Named property is present. More... | |
Object | injectProperty (Object injectValue, Block ablock) |
Process value visiting properties. More... | |
void | loadAndAddElement (PersistencyEnvironment env, StubElement stub, FileReader reader, GameWorld gameWorld) |
Load element from file reader and add it to game world. More... | |
Element | loadElement (PersistencyEnvironment env, StubElement stub, FileReader reader) |
Load element from file reader. More... | |
void | removeAllProperties () |
Remove all properties. More... | |
void | removeProperty (ElementClassProperty property) |
Remove property. More... | |
void | setBasePath (String path) |
Set base path for relative loading of resource properties. More... | |
void | setIsXmlElementClass (bool isXmlElementClass) |
Set if element class is an XML element class. More... | |
void | setPersistable (bool persistable) |
Set element class is persistable to file writers. More... | |
void | setPropertyValue (String name, Object value) |
Set value of named property. More... | |
Notification |
Protected Member Functions | |
Element | createElement () |
Create element instance. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Dragengine.Scenery.ElementClass | |
static CodecPropertyString | getSharedCodecPropertyString () |
Shared property codec helper. More... | |
static TSTriggerExpressionParser | getSharedTriggerExpressionParser () |
Shared trigger expression parser. More... | |
static void | setSharedCodecPropertyString (CodecPropertyString codec) |
Set shared property codec helper. More... | |
static void | setSharedTriggerExpressionParser (TSTriggerExpressionParser parser) |
Set shared trigger expression parser. More... | |
Public Attributes inherited from Dragengine.Scenery.BehaviorElementClass | |
Array | pBehaviors |
Array | pPrepareStubBehaviors |
Array | pPreventCreationBehaviors |
Physics element class.
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.
|
protected |
Create element instance.
If this element class does not support creating elements, for example because the result is not an element, null has to be returned. The default implementation returns null. Subclasses not intending to create elements or requiring special creation handling should subclass createAndAddElement() and loadAndAddElement() bypassing this method.
Reimplemented from Dragengine.Scenery.ElementClass.
ElementClass Dragengine.Scenery.PhysicsElementClass.duplicateNamed | ( | String | classname | ) |
Create copy of element class.
Reimplemented from Dragengine.Scenery.ElementClass.
ECBehaviorAttachToParent Dragengine.Scenery.PhysicsElementClass.getAttachToParent | ( | ) |
Attach to parent behavior.
ECBehaviorCollider Dragengine.Scenery.PhysicsElementClass.getCollider | ( | ) |
Collider behavior.
ECBehaviorComponent Dragengine.Scenery.PhysicsElementClass.getComponent | ( | ) |
Component behavior.
PhysicsElementClass Dragengine.Scenery.PhysicsElementClass.new | ( | ) |
Create element class using loaders from BaseGameApp.
Reimplemented from Dragengine.Scenery.BehaviorElementClass.
PhysicsElementClass Dragengine.Scenery.PhysicsElementClass.new | ( | String | className | ) |
Create element class using loaders from BaseGameApp.
Reimplemented from Dragengine.Scenery.BehaviorElementClass.