public class WanderBehaviour extends AbstractStrengthSteeringBehaviour
| Modifier and Type | Class and Description |
|---|---|
static class |
WanderBehaviour.WanderWithoutWanderArea |
AbstractStrengthSteeringBehaviour.negativeScalarMultiplierAbstractSteeringBehaviour.IllegalBrakingFactorBehaviour.behaviourNullAgentException| Modifier and Type | Field and Description |
|---|---|
protected com.jme3.math.Vector3f[] |
area
Area in which agent will wander.
|
protected com.jme3.math.Vector3f |
targetPosition
Position of target
|
protected float |
time
Current time.
|
protected float |
timeInterval
Time interval durring which target position doesn't change.
|
velocity| Constructor and Description |
|---|
WanderBehaviour(Agent agent)
Constructor for wander behaviour.
|
WanderBehaviour(Agent agent,
com.jme3.scene.Spatial spatial)
Constructor for wander behaviour.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.jme3.math.Vector3f |
calculateFullSteering()
Calculate steering vector.
|
protected void |
changeTargetPosition(float tpf)
Metod for changing target position.
|
protected void |
controlRender(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp) |
float |
getTimeInterval()
Get time interval for changing target position.
|
void |
setArea(com.jme3.math.Vector3f from,
com.jme3.math.Vector3f to)
Setting area for wander.
|
void |
setTimeInterval(float timeInterval)
Setting time interval for changing target position.
|
calculateSteering, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, turnOffStrengthControlagentTotalMass, calculateNewVelocity, controlUpdate, getBrakingFactor, getTPF, getVelocity, rotateAgent, setBrakingFactor, setTPF, setVelocityprotected com.jme3.math.Vector3f targetPosition
protected float timeInterval
protected float time
protected com.jme3.math.Vector3f[] area
public WanderBehaviour(Agent agent)
agent - to whom behaviour belongspublic WanderBehaviour(Agent agent, com.jme3.scene.Spatial spatial)
agent - to whom behaviour belongsspatial - active spatial during excecution of behaviourprotected void controlRender(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp)
controlRender in class com.jme3.scene.control.AbstractControlprotected com.jme3.math.Vector3f calculateFullSteering()
calculateFullSteering in class AbstractStrengthSteeringBehaviourAbstractSteeringBehaviour.calculateSteering()protected void changeTargetPosition(float tpf)
tpf - time per framepublic float getTimeInterval()
public void setTimeInterval(float timeInterval)
timeInterval - public void setArea(com.jme3.math.Vector3f from,
com.jme3.math.Vector3f to)
from - to - WanderBehaviour.WanderWithoutWanderArea - If any component from the area vectors match