public class WanderAreaBehavior extends AbstractWanderBehavior
AbstractWander
Modifier and Type | Class and Description |
---|---|
protected class |
WanderAreaBehavior.Offset
Offset from the center of the area
|
Modifier and Type | Field and Description |
---|---|
protected com.jme3.math.Vector3f |
center
Area in which agent will wander.
|
protected WanderAreaBehavior.Offset |
offset |
protected com.jme3.math.Vector3f |
targetPosition
Position of target.
|
protected float |
time
Current time.
|
timeInterval
timePerFrame, velocity
Constructor and Description |
---|
WanderAreaBehavior(Agent agent)
Constructor for wander behavior.
|
WanderAreaBehavior(Agent agent,
com.jme3.scene.Spatial spatial)
Constructor for wander behavior.
|
Modifier and Type | Method and Description |
---|---|
protected com.jme3.math.Vector3f |
calculateRawSteering()
Calculate steering vector.
|
protected void |
changeTargetPosition(float tpf)
Metod for changing target position.
|
void |
setArea(com.jme3.math.Vector3f center,
float offsetX,
float offsetY,
float offsetZ)
Setting area for wander.
|
void |
setArea(com.jme3.math.Vector3f center,
com.jme3.math.Vector3f offset)
Setting area for wander.
|
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
protected com.jme3.math.Vector3f center
protected WanderAreaBehavior.Offset offset
WanderAreaBehavior.Offset
public WanderAreaBehavior(Agent agent)
agent
- to whom behavior belongspublic WanderAreaBehavior(Agent agent, com.jme3.scene.Spatial spatial)
agent
- to whom behavior belongsspatial
- active spatial during excecution of behaviorprotected com.jme3.math.Vector3f calculateRawSteering()
calculateRawSteering
in class AbstractStrengthSteeringBehavior
AbstractSteeringBehavior.calculateSteering()
protected void changeTargetPosition(float tpf)
tpf
- time per framepublic void setArea(com.jme3.math.Vector3f center, float offsetX, float offsetY, float offsetZ)
center
- center of the areaoffsetX
- max random offset from centeroffsetY
- max random offset from centeroffsetZ
- max random offset from centerpublic void setArea(com.jme3.math.Vector3f center, com.jme3.math.Vector3f offset)
center
- center of the areaoffset
- max random offset from center