public class SphereWanderBehaviour extends AbstractStrengthSteeringBehaviour
| Modifier and Type | Class and Description |
|---|---|
static class |
SphereWanderBehaviour.SphereWanderInvalidRandomFactor |
static class |
SphereWanderBehaviour.SphereWanderInvalidRotationFactor |
static class |
SphereWanderBehaviour.SphereWanderWithoutRadius |
static class |
SphereWanderBehaviour.SphereWanderWithoutTimeInterval |
AbstractStrengthSteeringBehaviour.negativeScalarMultiplierAbstractSteeringBehaviour.IllegalBrakingFactorBehaviour.behaviourNullAgentException| Modifier and Type | Field and Description |
|---|---|
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 |
|---|
SphereWanderBehaviour(Agent agent,
float timeInterval,
float randomFactor,
float rotationFactor)
Constructor for wander behaviour.
|
SphereWanderBehaviour(Agent agent,
float timeInterval,
float randomFactor,
float rotationFactor,
com.jme3.scene.Spatial spatial) |
| Modifier and Type | Method and Description |
|---|---|
protected com.jme3.math.Vector3f |
calculateFullSteering()
Calculate steering vector.
|
protected void |
calculateNewRandomDir() |
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 |
setSphereRadius(float sphereRadius)
The sphere radius is 0.75 by default.
|
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
public SphereWanderBehaviour(Agent agent, float timeInterval, float randomFactor, float rotationFactor)
agent - to whom behaviour belongstimeInterval - Sets the time interval for changing target position.randomFactor - Defines the maximum random valuerotationFactor - Defines the maximum random variaton for each iteration.SphereWanderBehaviour.SphereWanderWithoutTimeInterval - If timeInterval is lower or equals to 0SphereWanderBehaviour.SphereWanderInvalidRandomFactor - If randomFactor is not contained in the [0,1] intervalSphereWanderBehaviour.SphereWanderInvalidRotationFactor - If rotationFactor is not contained in the [0,1] intervalpublic SphereWanderBehaviour(Agent agent, float timeInterval, float randomFactor, float rotationFactor, com.jme3.scene.Spatial spatial)
public void setSphereRadius(float sphereRadius)
SphereWanderBehaviour.SphereWanderWithoutRadius - If sphereRadius is lower or equals to 0protected 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 frameprotected void calculateNewRandomDir()
public float getTimeInterval()
public void setTimeInterval(float timeInterval)
timeInterval -