Drag[en]gine Script Module DragonScript
1.23
|
Behavior instance. More...
Public Member Functions | |
void | addListener (Listener listener) |
Add listener. More... | |
void | addToGameWorld () |
Add element to game world. More... | |
void | attach (ECBehaviorAttachable.Instance attachable) |
Attach attachable to attachment slot. More... | |
void | attach (ECBehaviorAttachable.Instance attachable, Vector position) |
void | attach (ECBehaviorAttachable.Instance attachable, Vector position, Quaternion orientation) |
bool | canAttach (ECBehaviorAttachable.Instance attachable) |
Attachable can be attached to this attachment slot. More... | |
void | detach () |
Detach attachable if one is attached. More... | |
void | detachAndDispose () |
Detach and dispose attachable if one is attached. More... | |
void | dispose () |
Dispose of composeable instance. More... | |
void | enterFrame () |
Frame update started. More... | |
ECBehaviorAttachable.Instance | getAttachable () |
Attached attachable or null. More... | |
Quaternion | getAttachableOrientation () |
Attachable orientation or null. More... | |
Vector | getAttachablePosition () |
Attachable position or null. More... | |
String | getBone () |
Name of bone to attach to or empty string to attach statically. More... | |
ECBehaviorCollider.Instance | getCollider () |
Collider behavior instance or null if not used. More... | |
ECBehaviorAttachSlot | getECBehavior () |
Behavior. More... | |
ElementResolver | getElementResolver () |
Element resolver used during loading or null if not set. More... | |
Matrix | getInverseMatrix () |
Inverse attach slot matrix relative to element or bone. More... | |
DMatrix | getInverseWorldMatrix () |
Inverse attach slot matrix in world space. More... | |
Matrix | getMatrix () |
Attach slot matrix relative to element or bone. More... | |
Quaternion | getOrientation () |
Orientation to attach to. More... | |
Vector | getPosition () |
Position to attach to. More... | |
Collider | getSlotCollider () |
Collider resource to use for slot. More... | |
ECBehaviorVRHand.Instance | getVRHand () |
VR Hand behavior instance or null if not used. More... | |
DMatrix | getWorldMatrix () |
Attach slot matrix in world space. More... | |
void | init (StubElement stub) |
Initialize element from stub. More... | |
bool | isAttached (BehaviorElement element) |
Element is attached to slot. More... | |
bool | isEmpty () |
Slot is empty. More... | |
bool | isNotAttached (BehaviorElement element) |
Element is not attached to slot. More... | |
bool | isNotEmpty () |
Slot is occupied. More... | |
Instance | new (ECBehaviorAttachSlot ecbehavior, BehaviorElement element) |
Create element. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read element 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... | |
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 | geometryChanged () |
Position or orientation changed. 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... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write behavior instance to file. More... | |
Protected Member Functions | |
void | attachAttachable (ECBehaviorAttachable.Instance attachable, Vector position, Quaternion orientation) |
Attach attachable to attachment slot. 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.ECBehaviorAttachSlot.Instance.addListener | ( | Listener | listener | ) |
Add listener.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.addToGameWorld | ( | ) |
Add element to game world.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attach | ( | ECBehaviorAttachable.Instance | attachable | ) |
Attach attachable to attachment slot.
EInvalidParam | attachable is null. |
EInvalidParam | Slot is not empty. |
EInvalidParam | attachable is already attached to another slot. |
EInvalidParam | attachable Element.getParent() is not null. |
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attach | ( | ECBehaviorAttachable.Instance | attachable, |
Vector | position | ||
) |
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attach | ( | ECBehaviorAttachable.Instance | attachable, |
Vector | position, | ||
Quaternion | orientation | ||
) |
|
protected |
Attach attachable to attachment slot.
Hook for subclasses to do custom attachment logic. Default implementation attaches attachable ECBehaviorCollider to the slot ECBehaviorCollider or ECBehaviorVRHand. From the following list the first matching method is chosen and applied.
If bone is not empty string the attachable collider is attached in bone mode. This attaches the entire collider to the slot bone. This requires the attachment slot collider to be castable to ColliderRig. This works best for example for actors holding a prop in their hands.
If slot collider is castable to ColliderRig and has bones attachable collider is attached in rig mode. This copies bone states from slot collider to attachable collider using bone name matching. This works best for example for actors wearing cloth.
If slot collider is present attachable is attached in static mode. This is often used together with volmue or ghost slot collider. This works best for static attachment positions like a wall mount where props are presented to the player to pick up.
If no slot collider is present attachable is just moved into the correct position. This works best for situations where elements technically should use an attach slot without needing to create a dummy collider just for this purpose.
bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.canAttach | ( | ECBehaviorAttachable.Instance | attachable | ) |
Attachable can be attached to this attachment slot.
false | Slot is not empty. |
false | Attachable is already attached to another slot. |
false | Attachable Element.getParent() is not null. |
true | Attaching is possible |
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.detach | ( | ) |
Detach attachable if one is attached.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.detachAndDispose | ( | ) |
Detach and dispose attachable if one is attached.
Calls removeFromGameWorldIfPresent() then dispose() on the attachable.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.dispose | ( | ) |
Dispose of composeable instance.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.enterFrame | ( | ) |
Frame update started.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
ECBehaviorAttachable.Instance Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getAttachable | ( | ) |
Attached attachable or null.
Quaternion Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getAttachableOrientation | ( | ) |
Attachable orientation or null.
Vector Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getAttachablePosition | ( | ) |
Attachable position or null.
String Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getBone | ( | ) |
Name of bone to attach to or empty string to attach statically.
ECBehaviorCollider.Instance Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getCollider | ( | ) |
Collider behavior instance or null if not used.
ECBehaviorAttachSlot Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getECBehavior | ( | ) |
Behavior.
ElementResolver Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getElementResolver | ( | ) |
Element resolver used during loading or null if not set.
Matrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getInverseMatrix | ( | ) |
Inverse attach slot matrix relative to element or bone.
DMatrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getInverseWorldMatrix | ( | ) |
Inverse attach slot matrix in world space.
Matrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getMatrix | ( | ) |
Attach slot matrix relative to element or bone.
Quaternion Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getOrientation | ( | ) |
Orientation to attach to.
Vector Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getPosition | ( | ) |
Position to attach to.
Collider Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getSlotCollider | ( | ) |
Collider resource to use for slot.
Can be ECBehaviorCollider collider, ECBehaviorVRHand collider or null.
ECBehaviorVRHand.Instance Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getVRHand | ( | ) |
VR Hand behavior instance or null if not used.
DMatrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getWorldMatrix | ( | ) |
Attach slot matrix in world space.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.init | ( | StubElement | stub | ) |
Initialize element from stub.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isAttached | ( | BehaviorElement | element | ) |
Element is attached to slot.
bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isEmpty | ( | ) |
Slot is empty.
bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isNotAttached | ( | BehaviorElement | element | ) |
Element is not attached to slot.
bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isNotEmpty | ( | ) |
Slot is occupied.
Instance Dragengine.Scenery.ECBehaviorAttachSlot.Instance.new | ( | ECBehaviorAttachSlot | ecbehavior, |
BehaviorElement | element | ||
) |
Create element.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read element from file.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.removeFromGameWorld | ( | ) |
Remove element from game world.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.removeListener | ( | Listener | listener | ) |
Remove listener.
void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.stateChanged | ( | ) |
State changed (visble, touchable).
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.