|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ForceSimulator
Method Summary | |
---|---|
void |
accumulate()
Accumulate all forces acting on the items in this simulation |
void |
addForce(Force f)
Add a new Force function to the simulator. |
void |
addItem(ForceItem item)
Add a ForceItem to the simulation. |
Spring |
addSpring(ForceItem item1,
ForceItem item2)
Add a Spring to the simulation. |
Spring |
addSpring(ForceItem item1,
ForceItem item2,
float length)
Add a Spring to the simulation. |
Spring |
addSpring(ForceItem item1,
ForceItem item2,
float coeff,
float length)
Add a Spring to the simulation. |
void |
clear()
Clear this simulator, removing all ForceItem and Spring instances for the simulator. |
Force[] |
getForces()
Get an array of all the Force functions used in this simulator. |
java.util.List<ForceItem> |
getItems()
Get an iterator over all registered ForceItems. |
float |
getSpeedLimit()
Get the speed limit, or maximum velocity value allowed by this simulator. |
java.util.List<Spring> |
getSprings()
Get an iterator over all registered Springs. |
boolean |
removeItem(ForceItem item)
Remove a ForceItem to the simulation. |
void |
runSimulator(long timestep)
Run the simulator for one timestep. |
Method Detail |
---|
float getSpeedLimit()
void clear()
void addForce(Force f)
f
- the Force function to addForce[] getForces()
void addItem(ForceItem item)
item
- the ForceItem to addboolean removeItem(ForceItem item)
item
- the ForceItem to removejava.util.List<ForceItem> getItems()
Spring addSpring(ForceItem item1, ForceItem item2)
item1
- the first endpoint of the springitem2
- the second endpoint of the spring
Spring addSpring(ForceItem item1, ForceItem item2, float length)
item1
- the first endpoint of the springitem2
- the second endpoint of the springlength
- the spring length
Spring addSpring(ForceItem item1, ForceItem item2, float coeff, float length)
item1
- the first endpoint of the springitem2
- the second endpoint of the springcoeff
- the spring coefficientlength
- the spring length
java.util.List<Spring> getSprings()
void runSimulator(long timestep)
timestep
- the span of the timestep for which to run the simulatorvoid accumulate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |