public class CohesionBehavior extends AbstractStrengthSteeringBehavior
timePerFrame, velocity
Constructor and Description |
---|
CohesionBehavior(Agent agent)
maxAngle is setted to PI / 2 by default and maxDistance to infinite.
|
CohesionBehavior(Agent agent,
float maxDistance,
float maxAngle) |
CohesionBehavior(Agent agent,
float maxDistance,
float maxAngle,
com.jme3.scene.Spatial spatial) |
CohesionBehavior(Agent agent,
java.util.List<GameEntity> neighbours)
maxAngle is setted to PI / 2 by default and maxDistance to infinite.
|
CohesionBehavior(Agent agent,
java.util.List<GameEntity> neighbours,
float maxDistance,
float maxAngle) |
CohesionBehavior(Agent agent,
java.util.List<GameEntity> neighbours,
float maxDistance,
float maxAngle,
com.jme3.scene.Spatial spatial) |
CohesionBehavior(Agent agent,
java.util.List<GameEntity> neighbours,
com.jme3.scene.Spatial spatial) |
CohesionBehavior(Agent agent,
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().
|
void |
setNeighbours(java.util.List<GameEntity> neighbours) |
void |
setNeighboursFromTeam(Team team) |
calculateSteering, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, turnOffStrengthControl
agentTotalMass, calculateNewVelocity, controlUpdate, convertToGameEntities, getBrakingFactor, getTimePerFrame, getVelocity, rotateAgent, setBrakingFactor, setTimePerFrame, setVelocity
controlRender
public CohesionBehavior(Agent agent)
agent
- To whom behavior belongs.neighbours
- Neighbours, this agent is moving toward the center of
this neighbours.public CohesionBehavior(Agent agent, float maxDistance, float maxAngle)
maxDistance
- In order to consider a neighbour inside the
neighbourhoodmaxAngle
- In order to consider a neighbour inside the neighbourhoodNegativeMaxDistanceException
- If maxDistance is lower than 0Agent#inBoidNeighborhoodMaxAngle(com.jme3.ai.agents.Agent, float,
float, float)
,
CohesionBehavior(com.jme3.ai.agents.Agent,
java.util.List)
public CohesionBehavior(Agent agent, com.jme3.scene.Spatial spatial)
spatial
- active spatial during excecution of behaviorCohesionBehavior(com.jme3.ai.agents.Agent,
java.util.List)
public CohesionBehavior(Agent agent, float maxDistance, float maxAngle, com.jme3.scene.Spatial spatial)
public CohesionBehavior(Agent agent, java.util.List<GameEntity> neighbours)
agent
- To whom behavior belongs.neighbours
- Neighbours, this agent is moving toward the center of
this neighbours.public CohesionBehavior(Agent agent, java.util.List<GameEntity> neighbours, float maxDistance, float maxAngle)
maxDistance
- In order to consider a neighbour inside the
neighbourhoodmaxAngle
- In order to consider a neighbour inside the neighbourhoodSteeringExceptions.NegativeValueException
- If maxDistance is lower than 0Agent#inBoidNeighborhoodMaxAngle(com.jme3.ai.agents.Agent, float,
float, float)
,
CohesionBehavior(com.jme3.ai.agents.Agent,
java.util.List)
public CohesionBehavior(Agent agent, java.util.List<GameEntity> neighbours, com.jme3.scene.Spatial spatial)
spatial
- active spatial during excecution of behaviorCohesionBehavior(com.jme3.ai.agents.Agent,
java.util.List)
public CohesionBehavior(Agent agent, java.util.List<GameEntity> neighbours, float maxDistance, float maxAngle, com.jme3.scene.Spatial spatial)
protected com.jme3.math.Vector3f calculateRawSteering()
AbstractStrengthSteeringBehavior
calculateRawSteering
in class AbstractStrengthSteeringBehavior
AbstractSteeringBehavior.calculateSteering()
public void setNeighbours(java.util.List<GameEntity> neighbours)
public void setNeighboursFromTeam(Team team)