public class CompoundSteeringBehaviour extends AbstractStrengthSteeringBehaviour
Modifier and Type | Class and Description |
---|---|
protected class |
CompoundSteeringBehaviour.steerBehavioursLayerList
Ordered list.
|
AbstractStrengthSteeringBehaviour.negativeScalarMultiplier
AbstractSteeringBehaviour.IllegalBrakingFactor
Behaviour.behaviourNullAgentException
Modifier and Type | Field and Description |
---|---|
protected CompoundSteeringBehaviour.steerBehavioursLayerList |
behaviours
Partial behaviours
|
velocity
Constructor and Description |
---|
CompoundSteeringBehaviour(Agent agent) |
CompoundSteeringBehaviour(Agent agent,
com.jme3.scene.Spatial spatial) |
Modifier and Type | Method and Description |
---|---|
void |
addSteerBehaviour(AbstractSteeringBehaviour behaviour)
Adds a behaviour to the compound behaviour.
|
void |
addSteerBehaviour(AbstractSteeringBehaviour behaviour,
int priority,
float minLengthToInvalidSteer)
To optimize the process speed add the behaviours with the lowest priority first.
|
protected com.jme3.math.Vector3f |
calculateFullSteering()
Calculates the composed steering force.
|
protected com.jme3.math.Vector3f |
calculatePartialForce(AbstractSteeringBehaviour behaviour)
Calculates the steering force of a single behaviour
|
protected void |
controlRender(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp) |
protected void |
controlUpdate(float tpf)
Usual update pattern for steering behaviours.
|
void |
removeSteerBehaviour(AbstractSteeringBehaviour behaviour)
Removes a behaviour from the compound steer behaviour.
|
calculateSteering, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, turnOffStrengthControl
agentTotalMass, calculateNewVelocity, getBrakingFactor, getTPF, getVelocity, rotateAgent, setBrakingFactor, setTPF, setVelocity
protected CompoundSteeringBehaviour.steerBehavioursLayerList behaviours
public CompoundSteeringBehaviour(Agent agent)
public CompoundSteeringBehaviour(Agent agent, com.jme3.scene.Spatial spatial)
public void addSteerBehaviour(AbstractSteeringBehaviour behaviour)
behaviour
- Behaviour that you want to addpublic void removeSteerBehaviour(AbstractSteeringBehaviour behaviour)
behaviour
- Behaviour that you want to removepublic void addSteerBehaviour(AbstractSteeringBehaviour behaviour, int priority, float minLengthToInvalidSteer)
priority
- This behaviour will be processed If all higher priority behaviours can be considered inactivesminLengthToInvalidSteer
- If the behaviour steer force length is less than this value It will be considered inactiveaddSteerBehaviour(com.jme3.ai.agents.behaviours.npc.steering.AbstractSteeringBehaviour)
protected com.jme3.math.Vector3f calculateFullSteering()
calculateFullSteering
in class AbstractStrengthSteeringBehaviour
AbstractSteeringBehaviour.calculateSteering()
protected com.jme3.math.Vector3f calculatePartialForce(AbstractSteeringBehaviour behaviour)
behaviour
- The behaviour.protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp)
controlRender
in class com.jme3.scene.control.AbstractControl
protected void controlUpdate(float tpf)
controlUpdate
in class AbstractSteeringBehaviour
tpf
-