Class R.components.logic.behaviors.UnalignedCollisionAvoidance
Extends
R.components.logic.behaviors.BaseBehavior.
The unaligned collision avoidance behavior component. This component will actively avoid other moving
objects by examining their future position.
Defined in: unalignedcollisionavoidance.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.logic.behaviors.UnalignedCollisionAvoidance(vehicles, radius, checkLength)
|
- Fields borrowed from class R.components.Base:
- TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Attributes | Method Name and Description |
---|---|
execute(renderContext, time, dt)
This method is called by the game object to run the component,
updating its state.
|
- Methods borrowed from class R.components.logic.behaviors.BaseBehavior:
- getTransformComponent, setTransformComponent
- Methods borrowed from class R.components.Logic:
- getClassName
- Methods borrowed from class R.components.Base:
- getGameObject, getHostObject, getPriority, getType, getTypeString, release, setGameObject, setHostObject, setPriority
- Methods borrowed from class R.engine.BaseObject:
- addEvent, addEvents, destroy, getElement, jQ, removeEvent, setElement, triggerEvent, update
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.components.logic.behaviors.UnalignedCollisionAvoidance(vehicles, radius, checkLength)
- Parameters:
- vehicles
- {Array} The vehicle list to compare against
- radius Optional, Default: 150
- {Number} The radius around each vehicle to use in collision detection
- checkLength Optional, Default: 60
- {Number} The distance in front of the vehicle to perform checking
Method Detail
execute(renderContext, time, dt)
This method is called by the game object to run the component,
updating its state.
- Parameters:
- renderContext
- {R.rendercontexts.AbstractRenderContext} The context the component will render within.
- time
- {Number} The global engine time
- dt
- {Number} The delta between the world time and the last time the world was updated in milliseconds.