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, updateStatepublic 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)
AnimationElementelementStart in class AnimationElementpublic void initWithDefaults()
public boolean isFinished()
AnimationElementisFinished in class AnimationElementpublic void reset()
AnimationElementisFinished()reset in class AnimationElementpublic void updateAnimationState(float tpf)
AnimationElementupdateAnimationState in class AnimationElement