Drag[en]gine Script Module DragonScript
1.23
|
Behavior instance. More...
Classes | |
class | BTActionSet |
Behavior tree action "avoidCollision.set". More... | |
Public Member Functions | |
void | addIgnoreCollider (Collider collider) |
Add collider to ignore to colliders required for avoiding. More... | |
void | addIgnoreCollidersTo (Collider collider) |
Add colliders required for avoiding as colliders to ignore. More... | |
void | armTest (Vector direction) |
Arm collision test with direction. More... | |
void | avoidBehaviorElement (BehaviorElement element) |
Avoid behavior element. More... | |
void | avoidCollision (float elapsed) |
Avoid collision if required. More... | |
Collider | bestColliderFor (ECBehaviorAvoidedByActor.Instance behavior) |
Find best collider for avoided by actor behavior. More... | |
void | clearAvoiding () |
Clear avoiding. More... | |
void | disarmTest () |
Disarm collision test. More... | |
void | dispose () |
Dispose of behavior instance. More... | |
void | enterFrame () |
Frame update started. More... | |
ECBehaviorActorMover.Instance | getActorMover () |
Actor mover behavior. More... | |
ElementVisitor | getAvoidElement () |
Avoid element visitor. More... | |
float | getAvoidTimeContactCollision () |
Avoid time contact collision. More... | |
ColliderCollisionTest | getCCTAvoidCollision () |
Avoid collider collision test. More... | |
ColliderCollisionTest | getCCTCheckLeft () |
Check left collider collision test. More... | |
ColliderCollisionTest | getCCTCheckRight () |
Check right collider collision test. More... | |
float | getCheckInterval () |
Check interval in seconds. More... | |
float | getCheckOffset () |
Check offset. More... | |
float | getCheckTimer () |
Check timer. More... | |
float | getDeviationAngle () |
Deviation angle. More... | |
float | getDeviationTime () |
Deviation time. More... | |
ECBehaviorAvoidCollision | getECBehavior () |
Behavior. More... | |
ElementResolver | getElementResolver () |
Element resolver used during loading or null if not set. More... | |
bool | getEnabled () |
Collision avoiding is enabled. More... | |
float | getRadius () |
Avoid radius. More... | |
ECBehaviorRidable.Instance | getRidable () |
Rideable the actor is standing upon or null. More... | |
ECBehaviorRideOn.Instance | getRideOn () |
Ride on behavior. More... | |
float | getSpeedMultiplier () |
Speed multiplier. More... | |
bool | getWaitBehindObstacles () |
Wait behind obstacles instead of moving around them. More... | |
void | init (StubElement stub) |
Initialize from stub. More... | |
bool | isTestArmed () |
Collision test is armed. More... | |
void | moveAroundAvoidedByActor (ECBehaviorAvoidedByActor.Instance behavior) |
Move around avoided by actor. More... | |
void | mutualIgnoreColliders (Collider collider) |
Mutually ignore colliders. More... | |
Instance | new (ECBehaviorAvoidCollision ecbehavior, BehaviorElement element) |
Create behavior instance. More... | |
void | onModifyMoveTowards (DVector position, float elapsed) |
Apply avoiding to actor mover. More... | |
void | onRidableChanged () |
Ridable changed. More... | |
void | readFromFile (PersistencyEnvironment env, FileReader reader) |
Read behavior from file. More... | |
void | removeFromGameWorld () |
Remove element from game world. More... | |
void | setAvoidElement (ElementVisitor visitor) |
Set avoid element visitor. More... | |
void | setAvoidTimeContactCollision (float time) |
Set avoid time contact collision. More... | |
void | setCheckInterval (float interval) |
Set check interval in seconds. More... | |
void | setCheckOffset (float offset) |
Set check offset. More... | |
void | setCheckTimer (float timer) |
Set check timer. More... | |
void | setDeviationAngle (float angle) |
Set deviation angle. More... | |
void | setDeviationTime (float time) |
Set deviation time. More... | |
void | setEnabled (bool enabled) |
Set if collision avoiding is enabled. More... | |
void | setRadius (float radius) |
Set avoid radius. More... | |
void | setShapesSphere (float radius, float distanceAboveGround) |
Set sphere collision test collider shapes. More... | |
void | setSpeedMultiplier (float multiplier) |
Set speed multiplier. More... | |
void | setWaitBehindObstacles (bool moveAroundActors) |
Set wait behind obstacles instead of moving around them. More... | |
void | startTests (float elapsed) |
Start collision tests for the next interval if applicable. More... | |
void | think (float elapsed) |
Think about what to do for the next frame update. More... | |
void | update (float elapsed) |
Avoid collision if enabled and a collision has been found. More... | |
void | waitBehindAvoidedByActor (ECBehaviorAvoidedByActor.Instance behavior) |
Wait behind element. More... | |
void | waitBehindContactCollision () |
Wait behind object contact collision. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance | |
void | addToGameWorld () |
Add element to game world. More... | |
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 | stateChanged () |
State changed (visble, touchable). More... | |
void | writeToFile (PersistencyEnvironment env, FileWriter writer) |
Write behavior instance to file. More... | |
Protected Member Functions | |
void | avoidElement (Element element) |
Avoid collision with an element if deemded necessary. More... | |
void | contactCollision () |
Get out of contact collision. More... | |
Pair | getPointsBorder (Array points, DVector origin) |
Get point with smallest and largest angle relative to origin Y-axis. More... | |
Array | getShapeCorners (ECBehaviorAvoidedByActor.Instance behavior, DMatrix matrix) |
Calculate shape corner points transformed to world space 2D coordinates. More... | |
void | initBehaviorTree (StubElement stub, ECBehaviorBehaviorTree.Instance behavior) |
Init behavior tree. More... | |
int | navSpaceEvadeSide (DVector position, float orientation, float leftAngle, float leftDistance, float rightAngle, float rightDistance) |
Determine side to evade using navigation space. 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... | |
Behavior instance.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.addIgnoreCollider | ( | Collider | collider | ) |
Add collider to ignore to colliders required for avoiding.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.addIgnoreCollidersTo | ( | Collider | collider | ) |
Add colliders required for avoiding as colliders to ignore.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.armTest | ( | Vector | direction | ) |
Arm collision test with direction.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.avoidBehaviorElement | ( | BehaviorElement | element | ) |
Avoid behavior element.
Called by AvoidElement visitor. Default implementation calls avoidAvoidedByActor for all ECBehaviorAvoidedByActor instances present in the element.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.avoidCollision | ( | float | elapsed | ) |
Avoid collision if required.
|
protected |
Avoid collision with an element if deemded necessary.
Default implementation does nothing if element is null. Otherwise uses avoid-element visitor on element to apply element specific avoiding.
Collider Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.bestColliderFor | ( | ECBehaviorAvoidedByActor.Instance | behavior | ) |
Find best collider for avoided by actor behavior.
Uses ECBehaviorColliderAI if present otherwise ECBehaviorCollider.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.clearAvoiding | ( | ) |
Clear avoiding.
|
protected |
Get out of contact collision.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.disarmTest | ( | ) |
Disarm collision test.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.dispose | ( | ) |
Dispose of behavior instance.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.enterFrame | ( | ) |
Frame update started.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
ECBehaviorActorMover.Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getActorMover | ( | ) |
Actor mover behavior.
ElementVisitor Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getAvoidElement | ( | ) |
Avoid element visitor.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getAvoidTimeContactCollision | ( | ) |
Avoid time contact collision.
ColliderCollisionTest Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getCCTAvoidCollision | ( | ) |
Avoid collider collision test.
ColliderCollisionTest Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getCCTCheckLeft | ( | ) |
Check left collider collision test.
ColliderCollisionTest Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getCCTCheckRight | ( | ) |
Check right collider collision test.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getCheckInterval | ( | ) |
Check interval in seconds.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getCheckOffset | ( | ) |
Check offset.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getCheckTimer | ( | ) |
Check timer.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getDeviationAngle | ( | ) |
Deviation angle.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getDeviationTime | ( | ) |
Deviation time.
ECBehaviorAvoidCollision Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getECBehavior | ( | ) |
Behavior.
ElementResolver Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getElementResolver | ( | ) |
Element resolver used during loading or null if not set.
bool Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getEnabled | ( | ) |
Collision avoiding is enabled.
|
protected |
Get point with smallest and largest angle relative to origin Y-axis.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getRadius | ( | ) |
Avoid radius.
ECBehaviorRidable.Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getRidable | ( | ) |
Rideable the actor is standing upon or null.
ECBehaviorRideOn.Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getRideOn | ( | ) |
Ride on behavior.
|
protected |
Calculate shape corner points transformed to world space 2D coordinates.
If shape has no size 1 point is returned. If shape has size 4 points are returned.
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getSpeedMultiplier | ( | ) |
Speed multiplier.
bool Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.getWaitBehindObstacles | ( | ) |
Wait behind obstacles instead of moving around them.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.init | ( | StubElement | stub | ) |
Initialize from stub.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
|
protected |
Init behavior tree.
bool Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.isTestArmed | ( | ) |
Collision test is armed.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.moveAroundAvoidedByActor | ( | ECBehaviorAvoidedByActor.Instance | behavior | ) |
Move around avoided by actor.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.mutualIgnoreColliders | ( | Collider | collider | ) |
Mutually ignore colliders.
Same as calling addIgnoreCollidersTo() and addIgnoreCollider() for the same collider. Use this call to make sure the given collider is ignored by all colliders required or avoiding and vice versa. The ECBehaviorColliderAI reachable from ECBehaviorActorMover is automatically made mutually ignore.
|
protected |
Determine side to evade using navigation space.
Evaluates the left and right side using deviation angle and deviation distance. If both sides are possible compares the costs. The angles are positive in the respective direction.
-1 | No side is possible to evade to. |
0 | Evade to both sides is equally recommended. |
1 | Evade to the left side is recommended. |
2 | Evade to the right side is recommended. |
Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.new | ( | ECBehaviorAvoidCollision | ecbehavior, |
BehaviorElement | element | ||
) |
Create behavior instance.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.onModifyMoveTowards | ( | DVector | position, |
float | elapsed | ||
) |
Apply avoiding to actor mover.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.onRidableChanged | ( | ) |
Ridable changed.
Called by RidableChanged. If overwritten do not forget to super-call.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.readFromFile | ( | PersistencyEnvironment | env, |
FileReader | reader | ||
) |
Read behavior from file.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.removeFromGameWorld | ( | ) |
Remove element from game world.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setAvoidElement | ( | ElementVisitor | visitor | ) |
Set avoid element visitor.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setAvoidTimeContactCollision | ( | float | time | ) |
Set avoid time contact collision.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setCheckInterval | ( | float | interval | ) |
Set check interval in seconds.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setCheckOffset | ( | float | offset | ) |
Set check offset.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setCheckTimer | ( | float | timer | ) |
Set check timer.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setDeviationAngle | ( | float | angle | ) |
Set deviation angle.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setDeviationTime | ( | float | time | ) |
Set deviation time.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setEnabled | ( | bool | enabled | ) |
Set if collision avoiding is enabled.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setRadius | ( | float | radius | ) |
Set avoid radius.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setShapesSphere | ( | float | radius, |
float | distanceAboveGround | ||
) |
Set sphere collision test collider shapes.
Uses sphere shape located a distance above ground.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setSpeedMultiplier | ( | float | multiplier | ) |
Set speed multiplier.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.setWaitBehindObstacles | ( | bool | moveAroundActors | ) |
Set wait behind obstacles instead of moving around them.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.startTests | ( | float | elapsed | ) |
Start collision tests for the next interval if applicable.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.think | ( | float | elapsed | ) |
Think about what to do for the next frame update.
Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.update | ( | float | elapsed | ) |
Avoid collision if enabled and a collision has been found.
Called by think().
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.waitBehindAvoidedByActor | ( | ECBehaviorAvoidedByActor.Instance | behavior | ) |
Wait behind element.
void Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.waitBehindContactCollision | ( | ) |
Wait behind object contact collision.
ECBehaviorActorMover.Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pActorMover |
ElementVisitor Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pAvoidElement |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pAvoidTimeContactCollision |
ColliderCollisionTest Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pCCTAvoidCollision |
ColliderCollisionTest Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pCCTCheckLeft |
ColliderCollisionTest Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pCCTCheckRight |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pCheckInterval |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pCheckOffset |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pCheckTimer |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pDeviationAngle |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pDeviationTime |
ECBehaviorAvoidCollision Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pECBehavior |
ElementResolver Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pElementResolver |
bool Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pEnabled |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pRadius |
ECBehaviorRidable.Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pRidable |
ECBehaviorRideOn.Instance Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pRideOn |
float Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pSpeedMultiplier |
bool Dragengine.Scenery.ECBehaviorAvoidCollision.Instance.pWaitBehindObstacles |