Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorAttachSlot.Instance Class Reference

Behavior instance. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorAttachSlot.Instance:
Dragengine.Scenery.DefaultECBehaviorInstance Dragengine.Scenery.ECBehaviorInstance

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

Detailed Description

Behavior instance.

Member Function Documentation

◆ addListener()

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

Add listener.

◆ addToGameWorld()

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

Add element to game world.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ attach() [1/3]

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attach ( ECBehaviorAttachable.Instance  attachable)

Attach attachable to attachment slot.

Exceptions
EInvalidParamattachable is null.
EInvalidParamSlot is not empty.
EInvalidParamattachable is already attached to another slot.
EInvalidParamattachable Element.getParent() is not null.

◆ attach() [2/3]

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attach ( ECBehaviorAttachable.Instance  attachable,
Vector  position 
)

◆ attach() [3/3]

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attach ( ECBehaviorAttachable.Instance  attachable,
Vector  position,
Quaternion  orientation 
)

◆ attachAttachable()

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.attachAttachable ( 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.

◆ canAttach()

bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.canAttach ( ECBehaviorAttachable.Instance  attachable)

Attachable can be attached to this attachment slot.

Return values
falseSlot is not empty.
falseAttachable is already attached to another slot.
falseAttachable Element.getParent() is not null.
trueAttaching is possible

◆ detach()

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.detach ( )

Detach attachable if one is attached.

◆ detachAndDispose()

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.detachAndDispose ( )

Detach and dispose attachable if one is attached.

Calls removeFromGameWorldIfPresent() then dispose() on the attachable.

◆ dispose()

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

Dispose of composeable instance.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ enterFrame()

void Dragengine.Scenery.ECBehaviorAttachSlot.Instance.enterFrame ( )

Frame update started.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ getAttachable()

ECBehaviorAttachable.Instance Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getAttachable ( )

Attached attachable or null.

◆ getAttachableOrientation()

Quaternion Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getAttachableOrientation ( )

Attachable orientation or null.

◆ getAttachablePosition()

Vector Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getAttachablePosition ( )

Attachable position or null.

◆ getBone()

String Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getBone ( )

Name of bone to attach to or empty string to attach statically.

◆ getCollider()

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

Collider behavior instance or null if not used.

◆ getECBehavior()

ECBehaviorAttachSlot Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getECBehavior ( )

Behavior.

◆ getElementResolver()

ElementResolver Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getElementResolver ( )

Element resolver used during loading or null if not set.

◆ getInverseMatrix()

Matrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getInverseMatrix ( )

Inverse attach slot matrix relative to element or bone.

◆ getInverseWorldMatrix()

DMatrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getInverseWorldMatrix ( )

Inverse attach slot matrix in world space.

Version
1.9

◆ getMatrix()

Matrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getMatrix ( )

Attach slot matrix relative to element or bone.

◆ getOrientation()

Quaternion Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getOrientation ( )

Orientation to attach to.

◆ getPosition()

Vector Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getPosition ( )

Position to attach to.

◆ getSlotCollider()

Collider Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getSlotCollider ( )

Collider resource to use for slot.

Version
1.9

Can be ECBehaviorCollider collider, ECBehaviorVRHand collider or null.

◆ getVRHand()

ECBehaviorVRHand.Instance Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getVRHand ( )

VR Hand behavior instance or null if not used.

◆ getWorldMatrix()

DMatrix Dragengine.Scenery.ECBehaviorAttachSlot.Instance.getWorldMatrix ( )

Attach slot matrix in world space.

Version
1.9

◆ init()

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

Initialize element from stub.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ isAttached()

bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isAttached ( BehaviorElement  element)

Element is attached to slot.

◆ isEmpty()

bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isEmpty ( )

Slot is empty.

◆ isNotAttached()

bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isNotAttached ( BehaviorElement  element)

Element is not attached to slot.

◆ isNotEmpty()

bool Dragengine.Scenery.ECBehaviorAttachSlot.Instance.isNotEmpty ( )

Slot is occupied.

◆ new()

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

Create element.

◆ readFromFile()

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

Read element from file.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ removeFromGameWorld()

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

Remove element from game world.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ removeListener()

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

Remove listener.

◆ stateChanged()

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

State changed (visble, touchable).

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.


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