public class SlowBehavior extends AbstractSteeringBehavior
CompoundSteeringBehavior,
SimpleMainBehaviortimePerFrame, velocity| Constructor and Description |
|---|
SlowBehavior(Agent agent,
int timeInterval,
float slowPercentage)
Slows a steer behavior resultant velocity.
|
SlowBehavior(Agent agent,
int timeInterval,
float slowPercentage,
com.jme3.scene.Spatial spatial) |
| Modifier and Type | Method and Description |
|---|---|
protected com.jme3.math.Vector3f |
calculateSteering()
Method for calculating steering vector.
|
void |
reset()
Reset the slow behavior.
|
void |
setAcive(boolean active)
Turns on or off the slow behavior.
|
void |
setMaxBrakingFactor(float maxBrakingFactor) |
void |
setSlowPercentage(float slowPercentage) |
agentTotalMass, calculateNewVelocity, controlUpdate, convertToGameEntities, getBrakingFactor, getTimePerFrame, getVelocity, rotateAgent, setBrakingFactor, setTimePerFrame, setVelocitycontrolRenderpublic SlowBehavior(Agent agent, int timeInterval, float slowPercentage)
behaviour - Steer behaviortimeInterval - How much time for each slow iteration in nsslowPercentage - What percentage will be reduced the vecocity for
each iteration, a float betwen 0 and 1SteeringExceptions.NegativeValueException - If time interval is not
a positive integerAbstractSteeringBehavior.AbstractSteeringBehavior(com.jme3.ai.agents.Agent)public SlowBehavior(Agent agent, int timeInterval, float slowPercentage, com.jme3.scene.Spatial spatial)
public void setSlowPercentage(float slowPercentage)
slowPercentage - float in the interval [0, 1]public void setAcive(boolean active)
active - public void reset()
protected com.jme3.math.Vector3f calculateSteering()
AbstractSteeringBehaviorcalculateSteering in class AbstractSteeringBehaviorpublic void setMaxBrakingFactor(float maxBrakingFactor)