public class FlockingSimulator extends AnimationElement
Constructor and Description |
---|
FlockingSimulator(BirdCollection birds)
Instantiates a new flocking simulator.
|
Modifier and Type | Method and Description |
---|---|
void |
addBirdsAt(java.awt.Color c,
com.jme3.math.Vector2f pos)
Adds the birds at.
|
void |
addFoodAt(com.jme3.math.Vector2f pos)
Adds the food at.
|
void |
addObstacleAt(com.jme3.math.Vector2f pos)
Adds the obstacle at.
|
void |
addPredatorsBirdsAt(com.jme3.math.Vector2f pos)
Adds the predators birds at.
|
void |
elementStart(float tpf)
Called on the first
|
void |
initWithDefaults()
Inits the with defaults.
|
boolean |
isFinished()
When this method returns true, the animation element will be reset.
|
void |
reset()
Called when the animation element is finished.
|
void |
updateAnimationState(float tpf)
Called each frame in the game loop.
|
enable, toString, updateState
public FlockingSimulator(BirdCollection birds)
birds
- the birdspublic void addBirdsAt(java.awt.Color c, com.jme3.math.Vector2f pos)
c
- the cpos
- the pospublic void addFoodAt(com.jme3.math.Vector2f pos)
pos
- the pospublic void addObstacleAt(com.jme3.math.Vector2f pos)
pos
- the pospublic void addPredatorsBirdsAt(com.jme3.math.Vector2f pos)
pos
- the pospublic void elementStart(float tpf)
AnimationElement
elementStart
in class AnimationElement
public void initWithDefaults()
public boolean isFinished()
AnimationElement
isFinished
in class AnimationElement
public void reset()
AnimationElement
isFinished()
reset
in class AnimationElement
public void updateAnimationState(float tpf)
AnimationElement
updateAnimationState
in class AnimationElement