|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.physics.simulation.SurfaceParameters
public abstract class SurfaceParameters
This class contains parameters used when solving collision constraints.
It's implemented using a HashMap, because not all physics engines
use the same surface parameters :).
Physics engine developer, if you implement the XPAL interfaces, you
should tell in your documentation which surface parameters you accept,
which type they are and what do they correspond to.
PLEASE BE CLEAR ABOUT THAT. Think about your users.
The supported parameters can also pe programmatically read through the
getAvailableParameters() method and additional info is returned
by the getParameterInfo(String) method.
SimulationWorld.resolveCollision(org.xith3d.physics.collision.Collision, Body, Body, SurfaceParameters)| Constructor Summary | |
|---|---|
protected |
SurfaceParameters(java.util.HashMap<java.lang.String,java.lang.Object> defaultParamers,
java.lang.String[] paramStrings,
java.lang.Object[] paramValues)
Creates a new SurfaceParameters with specified params. |
| Method Summary | |
|---|---|
void |
dumpAvailableParameters()
This method simply dumps all available parameter names. |
void |
dumpParameterInfo()
This method dumps the result of getParameterInfo(String)
for each available parameter. |
java.lang.String[] |
getAvailableParameters()
|
boolean |
getBooleanParameter(java.lang.String paramName)
Gets a boolean parameter from the HashMap. |
float |
getFloatParameter(java.lang.String paramName)
Gets a float parameter from the HashMap. |
java.lang.Object |
getParameter(java.lang.String paramName)
Gets a parameter as an Object. |
abstract java.lang.String |
getParameterInfo(java.lang.String paramName)
This method returns info about the given parameter's type and supported values. |
boolean |
isParamAvailable(java.lang.String paramName)
|
boolean |
isParameterSet(java.lang.String paramName)
|
void |
resetParameter(java.lang.String paramName)
Resets the given parameter to its default value. |
void |
setParameter(java.lang.String paramName,
java.lang.Object paramValue)
Sets a parameter's value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SurfaceParameters(java.util.HashMap<java.lang.String,java.lang.Object> defaultParamers,
java.lang.String[] paramStrings,
java.lang.Object[] paramValues)
defaultParamers - the default parameters set by teh implementationparamStrings - the param strings to be specified, e.g. "mu" or "bounce"paramValues - the values of the params to be specified, e.g. ".1f" or "true"
In order to know which params are valid, you should consult the documentation of
the XPAL implementation of your physic engine.setParameter(String, Object)| Method Detail |
|---|
public final java.lang.String[] getAvailableParameters()
getParameterInfo(String),
dumpAvailableParameters()public final void dumpAvailableParameters()
getAvailableParameters(),
getParameterInfo(String),
dumpParameterInfo()public abstract java.lang.String getParameterInfo(java.lang.String paramName)
paramName -
getAvailableParameters(),
dumpParameterInfo()public final void dumpParameterInfo()
getParameterInfo(String)
for each available parameter.
getAvailableParameters()public final boolean isParamAvailable(java.lang.String paramName)
paramName -
true, if the queried parameter is available.
public void setParameter(java.lang.String paramName,
java.lang.Object paramValue)
paramName - the parameter's name to be specified, e.g. "mu" or "bounce"paramValue - the values of the params to be specified, e.g. "0.1f" or "true"getAvailableParameters()public void resetParameter(java.lang.String paramName)
paramName - the parameter's name to be resettedgetAvailableParameters()public final java.lang.Object getParameter(java.lang.String paramName)
Object. (you should cast it to whatever it actually is.)
paramName - the name of the requested parameter
public final boolean isParameterSet(java.lang.String paramName)
paramName -
public final float getFloatParameter(java.lang.String paramName)
paramName - the name of the requested parameter
public final boolean getBooleanParameter(java.lang.String paramName)
paramName - the name of the requested parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||