public interface Force
Modifier and Type | Method and Description |
---|---|
void |
getForce(ForceItem item)
Updates the force calculation on the given ForceItem
|
void |
getForce(Spring spring)
Updates the force calculation on the given Spring.
|
float |
getMaxValue(int param)
Get the suggested maximum value for a parameter.
|
float |
getMinValue(int param)
Get the suggested minimum value for a parameter.
|
float |
getParameter(int i)
Returns the specified, numbered parameter.
|
int |
getParameterCount()
Returns the number of parameters (e.g., gravitational constant or
spring force coefficient) affecting this force function.
|
java.lang.String |
getParameterName(int i)
Gets the text name of the requested parameter.
|
void |
init(ForceSimulator fsim)
Initialize this force function.
|
boolean |
isItemForce()
Indicates if this force function will compute forces
on ForceItem instances
|
boolean |
isSpringForce()
Indicates if this force function will compute forces
on Spring instances.
|
void |
setMaxValue(int i,
float val)
Set the suggested maximum value for a parameter.
|
void |
setMinValue(int i,
float val)
Set the suggested minimum value for a parameter.
|
void |
setParameter(int i,
float val)
Sets the specified parameter value.
|
void init(ForceSimulator fsim)
fsim
- the encompassing ForceSimulatorint getParameterCount()
float getParameter(int i)
i
- the index of the parameter to returnfloat getMinValue(int param)
param
- the parameter indexfloat getMaxValue(int param)
param
- the parameter indexjava.lang.String getParameterName(int i)
i
- the index of the parametervoid setParameter(int i, float val)
i
- the index of the parameterval
- the new value of the parametervoid setMinValue(int i, float val)
i
- the parameter indexval
- the suggested minimum value to usevoid setMaxValue(int i, float val)
i
- the parameter indexboolean isSpringForce()
boolean isItemForce()
void getForce(ForceItem item)
item
- the ForceItem on which to compute updated forcesvoid getForce(Spring spring)
spring
- the Spring on which to compute updated forcesCopyright ? 2013 Regents of the University of California