public class AlignmentBehavior extends AbstractStrengthSteeringBehavior
timePerFrame, velocity
Constructor and Description |
---|
AlignmentBehavior(Agent agent)
maxAngle is setted to PI / 2 by default and maxDistance to infinite.
|
AlignmentBehavior(Agent agent,
float maxDistance,
float maxAngle)
Neighbours of agent will be his team members.
|
AlignmentBehavior(Agent agent,
float maxDistance,
float maxAngle,
com.jme3.scene.Spatial spatial)
Neighbours of agent will be his team members.
|
AlignmentBehavior(Agent agent,
java.util.List<GameEntity> neighbours)
maxAngle is setted to PI / 2 by default and maxDistance to infinite.
|
AlignmentBehavior(Agent agent,
java.util.List<GameEntity> neighbours,
float maxDistance,
float maxAngle) |
AlignmentBehavior(Agent agent,
java.util.List<GameEntity> neighbours,
float maxDistance,
float maxAngle,
com.jme3.scene.Spatial spatial) |
AlignmentBehavior(Agent agent,
java.util.List<GameEntity> neighbours,
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 AlignmentBehavior(Agent agent)
agent
- public AlignmentBehavior(Agent agent, float maxDistance, float maxAngle)
maxDistance
- In order to consider a neighbour inside the
neighbourhoodmaxAngle
- In order to consider a neighbour inside the neighbourhoodagent
- public AlignmentBehavior(Agent agent, float maxDistance, float maxAngle, com.jme3.scene.Spatial spatial)
maxDistance
- In order to consider a neighbour inside the
neighbourhoodmaxAngle
- In order to consider a neighbour inside the neighbourhood
Neighbours of agent will be his team members.spatial
- active spatial during excecution of behavioragent
- public AlignmentBehavior(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 AlignmentBehavior(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 neighbourhoodNegativeMaxDistanceException
- If maxDistance is lower than 0Agent#inBoidNeighborhoodMaxAngle(com.jme3.ai.agents.Agent, float,
float, float)
,
AlignmentBehavior(com.jme3.ai.agents.Agent,
java.util.List)
public AlignmentBehavior(Agent agent, java.util.List<GameEntity> neighbours, com.jme3.scene.Spatial spatial)
spatial
- active spatial during excecution of behaviorAlignmentBehavior(com.jme3.ai.agents.Agent,
java.util.List)
public AlignmentBehavior(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
AbstractSteeringBehaviour#calculateSteering()
public void setNeighbours(java.util.List<GameEntity> neighbours)
public void setNeighboursFromTeam(Team team)