public class SphereWanderBehavior extends AbstractWanderBehavior
AbstractWander
Modifier and Type | Field and Description |
---|---|
protected com.jme3.math.Vector3f |
targetPosition
Position of target.
|
protected float |
time
Current time.
|
timeInterval
timePerFrame, velocity
Constructor and Description |
---|
SphereWanderBehavior(Agent agent,
float timeInterval,
float randomFactor,
float rotationFactor)
Constructor for wander behavior.
|
SphereWanderBehavior(Agent agent,
float timeInterval,
float randomFactor,
float rotationFactor,
com.jme3.scene.Spatial spatial) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateNewRandomDir() |
protected com.jme3.math.Vector3f |
calculateRawSteering()
Calculate steering vector.
|
protected void |
changeTargetPosition(float tpf)
Metod for changing target position.
|
void |
setSphereRadius(float sphereRadius)
The sphere radius is 0.75 by default.
|
getTimeInterval, setTimeInterval
calculateSteering, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, setupStrengthControl, turnOffStrengthControl
agentTotalMass, calculateNewVelocity, controlUpdate, convertToGameEntities, getBrakingFactor, getTimePerFrame, getVelocity, rotateAgent, setBrakingFactor, setTimePerFrame, setVelocity
controlRender
protected com.jme3.math.Vector3f targetPosition
protected float time
public SphereWanderBehavior(Agent agent, float timeInterval, float randomFactor, float rotationFactor)
agent
- to whom behavior belongstimeInterval
- Sets the time interval for changing target position.randomFactor
- Defines the maximum random valuerotationFactor
- Defines the maximum random variaton for each
iteration.SteeringExceptions.NegativeValueException
- If timeInterval is
lower or equals to 0SteeringExceptions.IllegalIntervalException
- If randomFactor is
not contained in the [0,1] interval or if rotationFactor is not contained
in the [0,1] intervalpublic SphereWanderBehavior(Agent agent, float timeInterval, float randomFactor, float rotationFactor, com.jme3.scene.Spatial spatial)
protected com.jme3.math.Vector3f calculateRawSteering()
calculateRawSteering
in class AbstractStrengthSteeringBehavior
AbstractSteeringBehavior.calculateSteering()
protected void changeTargetPosition(float tpf)
tpf
- time per frameprotected void calculateNewRandomDir()
public void setSphereRadius(float sphereRadius)
SteeringExceptions.NegativeValueException
- If sphereRadius is
lower or equals to 0