|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.speckled.specksim.imp.motion.CacheingMovementModel
com.speckled.specksim.imp.motion.GridMovementModel
public class GridMovementModel
Models a static grid of specks
| Constructor Summary | |
|---|---|
GridMovementModel()
|
|
| Method Summary | |
|---|---|
protected SpeckPosition |
computeLocation(Speck speck,
float time)
Override this to compute a speck's location |
Vector3d |
computeVelocity(Speck speck,
float time)
Override this to compute a speck's velocity |
void |
deInit()
Called when this model is replaced as the current model |
Configurator |
getConfigurator()
Gets a Configurator object that describes and can manipulate the variables of this Configurable. |
double |
getMaxSpeed()
Gets the maximum possible speed that any Speck can move under this movement model. |
java.lang.String |
getName()
Gets the name of this model |
SerializableState |
getState(float time)
Gets a state object from this model. |
void |
init(SpeckSim simulator)
Called when this model is set to be the current model, or when the simulator is reset. |
void |
removeSpeck(Speck speck)
Called when a speck is removed from the simulator. |
void |
speckAdded(Speck speck)
Notifies the listener that an arbitrary Speck has been added |
void |
speckPopulationSet(int pop)
Notifies that the population of specks has changed size |
void |
speckRemoved(Speck speck)
Notifies the listener that a speck has been removed |
| Methods inherited from class com.speckled.specksim.imp.motion.CacheingMovementModel |
|---|
clearCache, getSpeckOrientation, getSpeckVelocity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GridMovementModel()
| Method Detail |
|---|
protected SpeckPosition computeLocation(Speck speck,
float time)
CacheingMovementModel
computeLocation in class CacheingMovementModelspeck - The speck to locatetime - The time to locate at
public Vector3d computeVelocity(Speck speck,
float time)
CacheingMovementModel
computeVelocity in class CacheingMovementModelspeck - The speck to compute fortime - The time to compute at
public java.lang.String getName()
MovementModel
getName in interface MovementModelpublic void init(SpeckSim simulator)
MovementModel
init in interface MovementModelsimulator - The simulator that this model is current in.public void deInit()
MovementModel
deInit in interface MovementModelpublic void removeSpeck(Speck speck)
MovementModel
removeSpeck in interface MovementModelpublic double getMaxSpeed()
MovementModel
getMaxSpeed in interface MovementModelpublic SerializableState getState(float time)
MovementModelSpeckledBodyModels use it to pass the
vertices of their bodies for visualisation. Feel free to pass
null if you want to. This implementation of this method should
not assume that the init() method has been called, so return an
empty instance of the state object if this is the case
getState in interface MovementModeltime - The time at which the state should be captured
public Configurator getConfigurator()
Configurable
getConfigurator in interface Configurablepublic void speckPopulationSet(int pop)
PopulationListener
speckPopulationSet in interface PopulationListenerpop - The new number of speckspublic void speckAdded(Speck speck)
PopulationListener
speckAdded in interface PopulationListenerspeck - The new speckpublic void speckRemoved(Speck speck)
PopulationListener
speckRemoved in interface PopulationListenerspeck - The ousted speck
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||