public class SlowBehavior extends AbstractSteeringBehavior
CompoundSteeringBehavior
,
SimpleMainBehavior
timePerFrame, 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, setVelocity
controlRender
public 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()
AbstractSteeringBehavior
calculateSteering
in class AbstractSteeringBehavior
public void setMaxBrakingFactor(float maxBrakingFactor)