Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...

Public Member Functions

ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.
void dispose ()
 Dispose of behavior.
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior.
ECBehaviorProjectToGround getProjectToGround ()
 Project to ground behavior.
ECPFloat getTestDirection ()
 Test direction.
ECPVector getTestOrigin ()
 Test origin.
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
ECBehaviorBodyTilting new (BehaviorElementClass eclass, ECBehaviorLocomotion locomotion, ECBehaviorProjectToGround projectToGround)
 Create behavior element class.
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.
String getBehaviorID ()
 Unique identifier of behavior.
String getID ()
 Identifier.
int getInstanceIndex ()
 Instance index.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.

Static Public Member Functions

static ECBehaviorBodyTilting getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.
static Instance getInstanceIn (BehaviorElement element)
 Get instance in element or null if absent.

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier.
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
void setBehaviorID (String identifier)
 Set behavior identifier.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

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.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_bodytilting

Member Function Documentation

◆ createInstance()

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

◆ dispose()

void Dragengine.Scenery.ECBehaviorBodyTilting.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

Referenced by createInstance().

◆ getBehaviorIn()

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.

References new().

Referenced by createInstance().

◆ getInstanceIn()

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 .

Referenced by createInstance().

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorBodyTilting.getLocomotion ( )

Locomotion behavior.

Referenced by createInstance().

◆ getProjectToGround()

ECBehaviorProjectToGround Dragengine.Scenery.ECBehaviorBodyTilting.getProjectToGround ( )

Project to ground behavior.

Referenced by createInstance().

◆ getTestDirection()

ECPFloat Dragengine.Scenery.ECBehaviorBodyTilting.getTestDirection ( )

Test direction.

Referenced by createInstance().

◆ getTestOrigin()

ECPVector Dragengine.Scenery.ECBehaviorBodyTilting.getTestOrigin ( )

Test origin.

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

Referenced by createInstance(), and Dragengine.Scenery.ECBehaviorBodyTilting.Instance.setCollisionFilter().

◆ instance()

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

Get instance in element from owner element class.

Referenced by createInstance(), and Dragengine.Scenery.ECBehaviorBodyTilting.Instance.getECBehavior().

◆ new() [1/2]

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

Create behavior element class.

Referenced by createInstance(), and getBehaviorIn().

◆ 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: