public abstract class AbstractSteeringBehaviour extends Behaviour
Modifier and Type | Class and Description |
---|---|
static class |
AbstractSteeringBehaviour.IllegalBrakingFactor |
Behaviour.behaviourNullAgentException
Modifier and Type | Field and Description |
---|---|
protected com.jme3.math.Vector3f |
velocity
Velocity of our agent.
|
Constructor and Description |
---|
AbstractSteeringBehaviour(Agent agent) |
AbstractSteeringBehaviour(Agent agent,
com.jme3.scene.Spatial spatial) |
Modifier and Type | Method and Description |
---|---|
protected float |
agentTotalMass()
Method for calculating agent total mass.
|
protected com.jme3.math.Vector3f |
calculateNewVelocity()
Method for calculating new velocity of agent based on steering vector.
|
protected abstract com.jme3.math.Vector3f |
calculateSteering()
Method for calculating steering vector.
|
protected void |
controlUpdate(float tpf)
Usual update pattern for steering behaviours.
|
float |
getBrakingFactor() |
protected float |
getTPF() |
com.jme3.math.Vector3f |
getVelocity() |
protected void |
rotateAgent(float tpf)
Method for rotating agent in direction of velocity of agent.
|
protected void |
setBrakingFactor(float brakingFactor)
Note that 0 means the maximum braking force and 1 No braking force
|
protected void |
setTPF(float tpf)
Manually update the tpf
|
void |
setVelocity(com.jme3.math.Vector3f velocity)
Setting current velocity of agent.
|
public AbstractSteeringBehaviour(Agent agent)
public AbstractSteeringBehaviour(Agent agent, com.jme3.scene.Spatial spatial)
protected final void setBrakingFactor(float brakingFactor)
AbstractSteeringBehaviour.IllegalBrakingFactor
- If the braking factor is not contained in the [0,1] intervalpublic final float getBrakingFactor()
protected float getTPF()
protected void setTPF(float tpf)
tpf
- tpfprotected abstract com.jme3.math.Vector3f calculateSteering()
protected com.jme3.math.Vector3f calculateNewVelocity()
calculateSteering()
protected void rotateAgent(float tpf)
tpf
- time per frameprotected float agentTotalMass()
public com.jme3.math.Vector3f getVelocity()
public void setVelocity(com.jme3.math.Vector3f velocity)
velocity
- protected void controlUpdate(float tpf)
controlUpdate
in class com.jme3.scene.control.AbstractControl
tpf
-