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

behavior adding body tilting support for actors projected to ground. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorBodyTilting:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Instance
 Behavior instance. More...
 

Public Member Functions

ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 
void dispose ()
 Dispose of behavior. More...
 
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior. More...
 
ECBehaviorProjectToGround getProjectToGround ()
 Project to ground behavior. More...
 
ECPFloat getTestDirection ()
 Test direction. More...
 
ECPVector getTestOrigin ()
 Test origin. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
ECBehaviorBodyTilting new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, ECBehaviorProjectToGround projectToGround)
 Create behavior element class. More...
 
ECBehaviorBodyTilting new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, ECBehaviorProjectToGround projectToGround, 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...
 

Static Public Member Functions

static ECBehaviorBodyTilting getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 
static Instance getInstanceIn (BehaviorElement element)
 Get instance in element 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...
 

Detailed Description

behavior adding body tilting support for actors projected to ground.

Helps actors with appropriate animator setup to align their body to uneven ground underneath. This is done by using a set of collider collision tests to probe the terain. The result is handed over to a Locomotion insatance to calculate the tilting values. These values are then set to animator controlled linked to tilting values.

Behavior uses 4 collider collision tests located front-left, front-right, back-left and back-right.

Requires these behaviors to be present:

To this behavior add it and either set the class properties or call setShape(), setOrigin() and setDirection() to initialize. Then use Locomotion.addControllerMapping() with Locomotion.ATTR_TILT_OFFSET, Locomotion.ATTR_TILT_VERTICAL and Locomotion.ATTR_TILT_HORIZONTAL for animators supporting tilting

Member Function Documentation

◆ createInstance()

ECBehaviorInstance Dragengine.Scenery.ECBehaviorBodyTilting.createInstance ( BehaviorElement  element)

Create Behavior instance.

Implements Dragengine.Scenery.ECBehavior.

◆ dispose()

void Dragengine.Scenery.ECBehaviorBodyTilting.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getBehaviorIn()

static ECBehaviorBodyTilting Dragengine.Scenery.ECBehaviorBodyTilting.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorBodyTilting.

◆ getInstanceIn()

static Instance Dragengine.Scenery.ECBehaviorBodyTilting.getInstanceIn ( BehaviorElement  element)
static

Get instance in element or null if absent.

Use this method to check if a particular BehaviorElement contains a behavior instance of type ECBehaviorBodyTilting.Instance .

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorBodyTilting.getLocomotion ( )

Locomotion behavior.

◆ getProjectToGround()

ECBehaviorProjectToGround Dragengine.Scenery.ECBehaviorBodyTilting.getProjectToGround ( )

Project to ground behavior.

◆ getTestDirection()

ECPFloat Dragengine.Scenery.ECBehaviorBodyTilting.getTestDirection ( )

Test direction.

◆ getTestOrigin()

ECPVector Dragengine.Scenery.ECBehaviorBodyTilting.getTestOrigin ( )

Test origin.

Used as Instance.setOrigin(x, z, y) hence right=x, front=z, up=y .

◆ instance()

Instance Dragengine.Scenery.ECBehaviorBodyTilting.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/2]

ECBehaviorBodyTilting Dragengine.Scenery.ECBehaviorBodyTilting.new ( BehaviorElementClass  eclass,
ECBehaviorLocomotion  locomotion,
ECBehaviorProjectToGround  projectToGround 
)

Create behavior element class.

◆ new() [2/2]

ECBehaviorBodyTilting Dragengine.Scenery.ECBehaviorBodyTilting.new ( BehaviorElementClass  eclass,
ECBehaviorLocomotion  locomotion,
ECBehaviorProjectToGround  projectToGround,
String  prefix 
)

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