Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding attach to parent support. More...
Classes | |
class | Instance |
Behavior instance. More... | |
Public Member Functions | |
void | dispose () |
Dispose of behavior. More... | |
ECBehaviorAttachable | getAttachable () |
Attachable behavior or null if not used. More... | |
ECPString | getAttachSlot () |
Attach slot to attach to. More... | |
ECPString | getBone () |
Bone to attach to. More... | |
ECBehaviorCollider | getCollider () |
Collider behavior. More... | |
ECPVector | getOrientation () |
Explicit attach rotation. More... | |
ECPVector | getPosition () |
Explicit attach position. More... | |
ECPBoolean | getRelative () |
Attach relative to world position or using explicit position. More... | |
ECPBoolean | getRigMode () |
Attach using rig mode if supported by colliders. More... | |
Instance | instance (BehaviorElement element) |
Get instance in element from owner element class. More... | |
ECBehaviorAttachToParent | new (BehaviorElementClass eclass, ECBehaviorCollider collider, ECBehaviorAttachable attachable) |
Create behavior element class. More... | |
ECBehaviorAttachToParent | new (BehaviorElementClass eclass, ECBehaviorCollider collider, ECBehaviorAttachable attachable, String prefix) |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
String | getID () |
Identifier. More... | |
int | getInstanceIndex () |
Instance index. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
Load instance data of another behavior. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading instance data of another behavior. More... | |
Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
ECBehaviorInstance | createInstance (BehaviorElement element) |
Create Behavior instance. More... | |
Static Public Member Functions | |
static ECBehaviorAttachToParent | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
DefaultECBehavior | new (BehaviorElementClass eclass) |
Create default composeable behavior with empty identifier. More... | |
DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
Create default composeable behavior. More... | |
void | setBehaviorID (String identifier) |
Set behavior identifier. More... | |
void | useClassNameAsBehaviorID () |
Set behavior identifier to "<class-name>:<identifier>". More... | |
void | useFullyQualifiedClassNameAsBehaviorID () |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More... | |
Behavior element behavior adding attach to parent support.
Objects can be attached to parent objects in the IGDE World Editor. During enterFrame() BehaviorElement sets the target object as the parent object. The actual attaching needs knowledge about the target object. This is delegated to behavior instances knowing how to do the attaching.
This behavior knows how to attach to BehaviorElement instances. By default the element to attach to is expected to a BehaviorElement. The element will be casted to BehaviorElement and attachToBehaviorElement() called. Optionally an ElementVisitor can be set which disables the default behavior and visits the element instead. This is useful for complex situations where even non-BehaviorElement elements can be used.
If the stub property "attachToParent.attachSlot" is used the element is attached to the named target ECBehaviorAttachSlot. This attach method can only be used if these requirements are fulfilled:
If any of these requirements are not fulfilled an exception will be thrown.
If target element contains ECBehaviorCollider regular attaching is used.
An optional "bone" property is supported to allow attaching the element to a specific bone in the target object ECBehaviorCollider given the collider is a ColliderRig or ColliderComponent instance.
If no "bone" property is used and both colliders are ColliderRig or ColliderComponent and both used rigs have bones then rig attachment is used. This is typically used to attach cloth to actors copying the actor bone states to the cloth bone states.
In all other cases static attaching is used.
Element class properties have the prefix "attachToParent.".
This behavior requires ECBehaviorCollider to be present.
This element behavior can be present only once in a BehaviorElement. Trying to add more than one instance results in an exception thrown.
This behavior does not require the element class to be persistable (setPersistable).
void Dragengine.Scenery.ECBehaviorAttachToParent.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
ECBehaviorAttachable Dragengine.Scenery.ECBehaviorAttachToParent.getAttachable | ( | ) |
Attachable behavior or null if not used.
ECPString Dragengine.Scenery.ECBehaviorAttachToParent.getAttachSlot | ( | ) |
Attach slot to attach to.
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorCollider.
ECPString Dragengine.Scenery.ECBehaviorAttachToParent.getBone | ( | ) |
Bone to attach to.
ECBehaviorCollider Dragengine.Scenery.ECBehaviorAttachToParent.getCollider | ( | ) |
Collider behavior.
ECPVector Dragengine.Scenery.ECBehaviorAttachToParent.getOrientation | ( | ) |
Explicit attach rotation.
ECPVector Dragengine.Scenery.ECBehaviorAttachToParent.getPosition | ( | ) |
Explicit attach position.
ECPBoolean Dragengine.Scenery.ECBehaviorAttachToParent.getRelative | ( | ) |
Attach relative to world position or using explicit position.
ECPBoolean Dragengine.Scenery.ECBehaviorAttachToParent.getRigMode | ( | ) |
Attach using rig mode if supported by colliders.
Instance Dragengine.Scenery.ECBehaviorAttachToParent.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
ECBehaviorAttachToParent Dragengine.Scenery.ECBehaviorAttachToParent.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
ECBehaviorAttachable | attachable | ||
) |
Create behavior element class.
These values are optional and can be null: attachable.
ECBehaviorAttachToParent Dragengine.Scenery.ECBehaviorAttachToParent.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
ECBehaviorAttachable | attachable, | ||
String | prefix | ||
) |