Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorAttachToParent.Instance Class Reference

Behavior instance. More...

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

Classes

class  DefaultAttachElement
 Example attach element visitor. More...

Public Member Functions

void addToAttachments (BehaviorElement parent)
 Add as attachment to ECBehaviorAttachments if parent has this behavior.
void attachToAttachSlot (BehaviorElement parent)
 Attach to attach slot in world coordinates.
void attachToBehaviorElement (BehaviorElement parent)
 Attach to behavior element.
void attachToCollider (Collider collider)
 Attach to collider.
void attachToParent (Element parent)
 Attach element to object set by the mapper in the IGDE World Editor.
void dispose ()
 Dispose of behavior instance.
ECBehaviorAttachable.Instance getAttachable ()
 Attachable behavior.
String getAttachSlot ()
 Attach slot to attach to.
String getBone ()
 Name of bone to attach to or empty string to attach statically.
ECBehaviorCollider.Instance getCollider ()
 Collider behavior.
ECBehaviorAttachToParent getECBehavior ()
 Behavior.
Quaternion getOrientation ()
 Explicit attach rotation.
Vector getPosition ()
 Explicit attach position.
bool getRelative ()
 Attach relative to world position or using explicit position.
bool getRigMode ()
 Attach using rig mode if supported by colliders.
void init (StubElement stub)
 Initialize element from stub.
Instance new (ECBehaviorAttachToParent ecbehavior, BehaviorElement element)
 Create element.
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance
void addToGameWorld ()
 Add element to game world.
void enterFrame ()
 Frame update started.
void geometryChanged ()
 Position or orientation changed.
BehaviorElement getElement ()
 Behavior element to apply behavior to.
int getInstanceIndex ()
 Behavior instance index.
DefaultECBehaviorInstance new (BehaviorElement element)
 Create default composeable instance.
void postThink (float elapsed)
 Post thinking after physics processing is finished.
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read behavior instance from file.
void removeFromGameWorld ()
 Remove element from game world.
bool requiresEnterFrame ()
 Behavior instance requires enterFrame() to be called.
bool requiresThink ()
 Behavior instance requires think() to be called.
void stateChanged ()
 State changed (visble, touchable).
void think (float elapsed)
 Think about what to do for the next frame update.
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write behavior instance to file.

Protected Member Functions

ElementVisitor getAttachVisitor ()
 Element visitor used to attach elements or null to use default behavior.
void setAttachVisitor (ElementVisitor visitor)
 Set element visitor used to attach elements or null to use default behavior.
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance
void setRequiresEnterFrame (bool required)
 Set if behavior instance requires enterFrame() to be called.
void setRequiresThink (bool required)
 Set if behavior instance requires think() to be called.

Additional Inherited Members

Public Attributes inherited from Dragengine.Scenery.DefaultECBehaviorInstance
BehaviorElement pElement
int pInstanceIndex
bool pRequiresEnterFrame
bool pRequiresThink

Detailed Description

Behavior instance.

Member Function Documentation

◆ addToAttachments()

void Dragengine.Scenery.ECBehaviorAttachToParent.Instance.addToAttachments ( BehaviorElement parent)

Add as attachment to ECBehaviorAttachments if parent has this behavior.

References getAttachVisitor(), getOrientation(), and setAttachVisitor().

◆ attachToAttachSlot()

void Dragengine.Scenery.ECBehaviorAttachToParent.Instance.attachToAttachSlot ( BehaviorElement parent)

Attach to attach slot in world coordinates.

Element has to be in the correct position before attaching.

References getPosition().

◆ attachToBehaviorElement()

void Dragengine.Scenery.ECBehaviorAttachToParent.Instance.attachToBehaviorElement ( BehaviorElement parent)

Attach to behavior element.

Calls attachToCollider() if behavior element has ECBehaviorCollider. Overwrite in subclass if you use only behavior elements and you do not want to use custom visitor.

References getAttachSlot(), and getRelative().

Referenced by Dragengine.Scenery.ECBehaviorAttachToParent.Instance.DefaultAttachElement.visitBehaviorElement().

◆ attachToCollider()

void Dragengine.Scenery.ECBehaviorAttachToParent.Instance.attachToCollider ( Collider collider)

Attach to collider.

If collider is castable to ColliderRig and bone is not null the element is attach to the collider bone. Otherwise the element is attached statically.

References getRigMode().

◆ attachToParent()

void Dragengine.Scenery.ECBehaviorAttachToParent.Instance.attachToParent ( Element parent)

Attach element to object set by the mapper in the IGDE World Editor.

Behavior instance is responsible to call BehaviorElement.setParent() if the attaching succeedes. If multiple behaviors support attaching they have to negotiate with each other who does the attaching for example by using BehaviorElement.getParent().

Implementation either visits the element using getAttachVisitor() or by calling attachToBehaviorElement() if the element is castable to BehaviorElement.

Furthermore If the parent has ECBehaviorAttachments behavior add element as attachment. This is not done if special attaching is used like ECBehaviorAttachSlot.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

References getAttachable(), and getBone().

◆ dispose()

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

Dispose of behavior instance.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

Referenced by getAttachable(), and getAttachSlot().

◆ getAttachable()

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

Attachable behavior.

References dispose().

Referenced by attachToParent(), and getRigMode().

◆ getAttachSlot()

String Dragengine.Scenery.ECBehaviorAttachToParent.Instance.getAttachSlot ( )

Attach slot to attach to.

References dispose().

Referenced by attachToBehaviorElement(), and getOrientation().

◆ getAttachVisitor()

ElementVisitor Dragengine.Scenery.ECBehaviorAttachToParent.Instance.getAttachVisitor ( )
protected

Element visitor used to attach elements or null to use default behavior.

References getPosition(), getRelative(), and getRigMode().

Referenced by addToAttachments().

◆ getBone()

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

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

Referenced by attachToParent(), and getOrientation().

◆ getCollider()

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

◆ getECBehavior()

ECBehaviorAttachToParent Dragengine.Scenery.ECBehaviorAttachToParent.Instance.getECBehavior ( )

Behavior.

References new().

Referenced by setAttachVisitor().

◆ getOrientation()

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

Explicit attach rotation.

References getAttachSlot(), and getBone().

Referenced by addToAttachments().

◆ getPosition()

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

◆ getRelative()

bool Dragengine.Scenery.ECBehaviorAttachToParent.Instance.getRelative ( )

Attach relative to world position or using explicit position.

Referenced by attachToBehaviorElement(), and getAttachVisitor().

◆ getRigMode()

bool Dragengine.Scenery.ECBehaviorAttachToParent.Instance.getRigMode ( )

Attach using rig mode if supported by colliders.

References getAttachable(), init(), and Dragengine.Scenery.ECBehaviorAttachToParent.instance().

Referenced by attachToCollider(), and getAttachVisitor().

◆ init()

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

Initialize element from stub.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

Referenced by getRigMode().

◆ new()

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

Create element.

Referenced by getECBehavior().

◆ setAttachVisitor()

void Dragengine.Scenery.ECBehaviorAttachToParent.Instance.setAttachVisitor ( ElementVisitor visitor)
protected

Set element visitor used to attach elements or null to use default behavior.

References getCollider(), and getECBehavior().

Referenced by addToAttachments().


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