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

Behavior adding support to actors to avoid collisions with ECBehaviorAvoidedByActor. More...

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

Classes

class  Instance
 Behavior instance. More...
 

Public Member Functions

void dispose ()
 Dispose of behavior. More...
 
ECBehaviorActorMover getActorMover ()
 Actor mover behavior. More...
 
ECBehaviorBehaviorTree getBehaviorTree ()
 Behavior tree behavior or null. More...
 
ECComposeCollisionFilter getCollisionFilter ()
 Collision filter. More...
 
ECPFloat getRadius ()
 Avoid radius. More...
 
ECBehaviorRideOn getRideOn ()
 RideOn behavior or null. More...
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class. More...
 
ECBehaviorAvoidCollision new (BehaviorElementClass eclass, ECBehaviorActorMover actorMover, ECBehaviorRideOn rideOn)
 Create behavior element class. More...
 
ECBehaviorAvoidCollision new (BehaviorElementClass eclass, ECBehaviorActorMover actorMover, ECBehaviorRideOn rideOn, String prefix)
 
void setBehaviorTree (ECBehaviorBehaviorTree behavior)
 Set behavior tree behavior or null. More...
 
- 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...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorAvoidCollision getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Public Attributes

ECBehaviorActorMover pActorMover
 
ECBehaviorBehaviorTree pBehaviorTree
 
ECComposeCollisionFilter pCollisionFilter
 
ECPFloat pRadius
 
ECBehaviorRideOn pRideOn
 

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 support to actors to avoid collisions with ECBehaviorAvoidedByActor.

Behavior attaches to ECBehaviorActorMover to modify walking path while moving.

To use this behavior add it to the element class and make sure to call setShapesSphere() to set up the collision test shapes. The best time to do this is either in BehaviorElement.init() or inside BaseActorAction if you need to change them per action.

Requires these behaviors to be present:

Uses these behaviors if present.

The following behavior tree actions are added if an ECBehaviorBehaviorTree is presen:

Action "avoidCollision.set"

Set behavior parameters. Supports these optional action parameters:

  • waitBehindObstacles: calls setWaitBehindObstacles(). Value: "true", "false".
  • enabled: calls setEnabled(). Value: "true", "false".

This is an example of using this action:

<action name='avoidCollision.set'>
<parameter name='waitBehindObstacles'>true</parameter>
<parameter name='enabled'>true</parameter>
</action>

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorAvoidCollision.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getActorMover()

ECBehaviorActorMover Dragengine.Scenery.ECBehaviorAvoidCollision.getActorMover ( )

Actor mover behavior.

◆ getBehaviorIn()

static ECBehaviorAvoidCollision Dragengine.Scenery.ECBehaviorAvoidCollision.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 ECBehaviorAvoidCollision.

◆ getBehaviorTree()

ECBehaviorBehaviorTree Dragengine.Scenery.ECBehaviorAvoidCollision.getBehaviorTree ( )

Behavior tree behavior or null.

Version
1.19

◆ getCollisionFilter()

ECComposeCollisionFilter Dragengine.Scenery.ECBehaviorAvoidCollision.getCollisionFilter ( )

Collision filter.

◆ getRadius()

ECPFloat Dragengine.Scenery.ECBehaviorAvoidCollision.getRadius ( )

Avoid radius.

◆ getRideOn()

ECBehaviorRideOn Dragengine.Scenery.ECBehaviorAvoidCollision.getRideOn ( )

RideOn behavior or null.

◆ instance()

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

Get instance in element from owner element class.

◆ new() [1/2]

ECBehaviorAvoidCollision Dragengine.Scenery.ECBehaviorAvoidCollision.new ( BehaviorElementClass  eclass,
ECBehaviorActorMover  actorMover,
ECBehaviorRideOn  rideOn 
)

Create behavior element class.

These values are optional and can be null: rideOn.

◆ new() [2/2]

ECBehaviorAvoidCollision Dragengine.Scenery.ECBehaviorAvoidCollision.new ( BehaviorElementClass  eclass,
ECBehaviorActorMover  actorMover,
ECBehaviorRideOn  rideOn,
String  prefix 
)

◆ setBehaviorTree()

void Dragengine.Scenery.ECBehaviorAvoidCollision.setBehaviorTree ( ECBehaviorBehaviorTree  behavior)

Set behavior tree behavior or null.

Version
1.19

Member Data Documentation

◆ pActorMover

ECBehaviorActorMover Dragengine.Scenery.ECBehaviorAvoidCollision.pActorMover

◆ pBehaviorTree

ECBehaviorBehaviorTree Dragengine.Scenery.ECBehaviorAvoidCollision.pBehaviorTree

◆ pCollisionFilter

ECComposeCollisionFilter Dragengine.Scenery.ECBehaviorAvoidCollision.pCollisionFilter

◆ pRadius

ECPFloat Dragengine.Scenery.ECBehaviorAvoidCollision.pRadius

◆ pRideOn

ECBehaviorRideOn Dragengine.Scenery.ECBehaviorAvoidCollision.pRideOn

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