public class ObstacleAvoidanceBehavior extends AbstractStrengthSteeringBehavior
GameEntity.setRadius(float)
timePerFrame, velocity
Constructor and Description |
---|
ObstacleAvoidanceBehavior(Agent agent,
java.util.List<GameEntity> obstacles,
float minTimeToCollision) |
ObstacleAvoidanceBehavior(Agent agent,
java.util.List<GameEntity> obstacles,
float minTimeToCollision,
float minDistance) |
ObstacleAvoidanceBehavior(Agent agent,
java.util.List<GameEntity> obstacles,
float minTimeToCollision,
float minDistance,
com.jme3.scene.Spatial spatial) |
ObstacleAvoidanceBehavior(Agent agent,
java.util.List<GameEntity> obstacles,
float minTimeToCollision,
com.jme3.scene.Spatial spatial) |
Modifier and Type | Method and Description |
---|---|
protected com.jme3.math.Vector3f |
calculateRawSteering()
If a behavior class extend from CompoundSteeringBehaviour instead of
AbstractSteeringBehavior, it must implement this method instead of
calculateSteering().
|
protected float |
getMinDistance() |
protected float |
getMinTimeToCollision() |
protected java.util.List<GameEntity> |
getObstacles() |
protected com.jme3.math.Vector3f |
randomVectInPlane(com.jme3.math.Vector3f planeNormalV,
com.jme3.math.Vector3f planePoint)
Generates a random vector inside a plane defined by a normal vector and a
point
|
void |
setObstacles(java.util.List<GameEntity> obstacles) |
calculateSteering, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, turnOffStrengthControl
agentTotalMass, calculateNewVelocity, controlUpdate, convertToGameEntities, getBrakingFactor, getTimePerFrame, getVelocity, rotateAgent, setBrakingFactor, setTimePerFrame, setVelocity
controlRender
public ObstacleAvoidanceBehavior(Agent agent, java.util.List<GameEntity> obstacles, float minTimeToCollision)
obstacles
- A list with the obstacles (Agents)minTimeToCollision
- When the time to collision is lower than this
value the steer force will appear. Time is measured in seconds.SteeringExceptions.NegativeValueException
- If minTimeToCollision
is lower or equals to 0AbstractSteeringBehavior.AbstractSteeringBehavior(com.jme3.ai.agents.Agent)
public ObstacleAvoidanceBehavior(Agent agent, java.util.List<GameEntity> obstacles, float minTimeToCollision, com.jme3.scene.Spatial spatial)
public ObstacleAvoidanceBehavior(Agent agent, java.util.List<GameEntity> obstacles, float minTimeToCollision, float minDistance)
minDistance
- Min. distance from center to center to consider an
obstacleSteeringExceptions.NegativeValueException
- If minTimeToCollision
is lower than 0ObstacleAvoidanceBehavior(com.jme3.ai.agents.Agent,
java.util.List, float)
public ObstacleAvoidanceBehavior(Agent agent, java.util.List<GameEntity> obstacles, float minTimeToCollision, float minDistance, com.jme3.scene.Spatial spatial)
ObstacleAvoidanceBehavior#ObstacleAvoidanceBehavior(com.jme3.ai.agents.Agent,
com.jme3.scene.Spatial, java.util.List, float)
,
AbstractSteeringBehavior.AbstractSteeringBehavior(com.jme3.ai.agents.Agent,
com.jme3.scene.Spatial)
protected com.jme3.math.Vector3f calculateRawSteering()
AbstractStrengthSteeringBehavior
calculateRawSteering
in class AbstractStrengthSteeringBehavior
AbstractSteeringBehavior.calculateSteering()
protected com.jme3.math.Vector3f randomVectInPlane(com.jme3.math.Vector3f planeNormalV, com.jme3.math.Vector3f planePoint)
protected java.util.List<GameEntity> getObstacles()
public void setObstacles(java.util.List<GameEntity> obstacles)
protected float getMinTimeToCollision()
protected float getMinDistance()