|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.odejava.World
public class World
The world object is a container for rigid bodies and joints. Objects in different worlds can not interact, for example rigid bodies from two different worlds can not collide.
All the objects in a world exist at the same point in time, thus one reason to use separate worlds is to simulate systems at different rates.
Most applications will only need one world.
Usage Notes
Odejava supports only single world for now. Support for multiple worlds is added later. Only latest created World class will be used on Odejava. Create this class only once!
The default value for contact surface thickness is zero. This can cause floating point accuracy problems and result in visible jitter of the objects. It is recommended that a small value of around 0.001 be set to avoid this problem.
Unimplemented
| Field Summary | |
|---|---|
protected List<Body> |
bodyList
|
protected Map<String,Body> |
bodyMap
|
protected boolean |
deleted
Flag indicating that this world has been requested to be deleted. |
| Constructor Summary | |
|---|---|
World()
Create a new, empty world. |
|
| Method Summary | |
|---|---|
protected void |
addBody(Body body)
Internal method to add the given body to the World. |
boolean |
containsBody(String name)
Returns true if the space contains a Body with the given name. |
void |
delete()
Request deletion of this world. |
void |
deleteBody(Body body)
Removes the Body from this world and deletes it using Body.delete() . |
Body |
findGeomBody(Geom geom)
Returns the Geom's parent Body, or null if it doesn't have a parent. |
float |
getAngularVelocityDisableThreshold()
Get the threshold for angular velocity at which a body will be automatically disabled. |
int |
getAutoEnableDepthSF1()
|
List<Body> |
getBodies()
Returns a list of bodies that are in this World |
Body |
getBody(String name)
Get body by name. |
float |
getConstantForceMix()
Get the amount of the constant force mix parameter currently set for positions between the two stops. |
float |
getContactSurfaceThickness()
Get the currently set value of the world's contact surface layer thickness. |
float |
getErrorReductionParameter()
Get the amount of the error reduction parameter currently set. |
org.openmali.vecmath2.Vector3f |
getGravity()
Get the gravity vector for the world. |
void |
getGravity(float[] val)
Get the vector for the current gravity and place it in the user-provided array. |
org.openmali.vecmath2.Vector3f |
getGravity(org.openmali.vecmath2.Vector3f val)
Get the vector for the current gravity and place it in the user-provided data structure. |
org.odejava.ode.SWIGTYPE_p_dWorldID |
getId()
|
float |
getLinearVelocityDisableThreshold()
Get the threshold for linear velocity at which a body will be automatically disabled. |
float |
getMaxCorrectionVelocity()
Get the current maximum correction velocity used during cpntacts. |
int |
getStepDisableThreshold()
Get the threshold for the number of steps at which a body will be automatically disabled. |
int |
getStepInteractions()
|
float |
getStepSize()
|
float |
getTimeDisableThreshold()
Get the threshold for the evaluation time at which a body will be automatically disabled. |
boolean |
isAutoDisablingBodies()
Check to see the current state of the auto disable functionality. |
void |
quickStep()
Step uses ODE's dWorldQuickStep with the predefined step size and number of iterations. |
void |
quickStep(float stepTime)
Step uses ODE's dWorldQuickStep with the passed in step size. |
protected void |
removeBody(Body body)
Internal method to remove the given body from the World. |
void |
renameBody(String oldName,
String newName)
Updates the bodymap to reflect a name change of a body |
void |
setAngularVelocityDisableThreshold(float vel)
Set the threshold for the angular velocity that will cause a body to be disabled. |
void |
setAutoDisableBodies(boolean state)
Control whether the world should allow auto-disable of bodies. |
void |
setAutoEnableDepthSF1(int autoEnableDepth)
|
void |
setConstantForceMix(float force)
Set the amount of constant force to mix into the system when the bodies are not at a stop. |
void |
setContactSurfaceThickness(float depth)
Set the contact surface layer thickness around all geometry objects. |
void |
setErrorReductionParameter(float erp)
Set the amount of error reduction. |
void |
setGravity(float x,
float y,
float z)
Set the gravity vector to be applied to this world |
void |
setGravity(org.openmali.vecmath2.Vector3f gravity)
Set the gravity vector to be applied to this world |
void |
setLinearVelocityDisableThreshold(float vel)
Set the threshold for the linear velocity that will cause a body to be disabled. |
void |
setMaxCorrectionVelocity(float vel)
Set the maximum correction velocity that is allowed during a contact. |
void |
setStepDisableThreshold(int steps)
Set the number of evaluation steps before an umoving body is disabled. |
void |
setStepInteractions(int stepInteractions)
Number of interactions, higher gives better accuracy but lower speed in case of many simultaneous collisions. |
void |
setStepSize(float stepSize)
Step size, higher decreases accuracy but gives more speed. |
void |
setTimeDisableThreshold(float time)
Set the total amount of evaluation time an umoving body is disabled. |
void |
step()
Step uses ODE's dWorldStep with the predefined step size |
void |
step(float stepTime)
Step uses ODE's dWorldStep with the passed in step size. |
void |
stepFast()
StepFast uses ODE's dWorldStepFast1. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List<Body> bodyList
protected Map<String,Body> bodyMap
protected boolean deleted
| Constructor Detail |
|---|
public World()
| Method Detail |
|---|
public void setGravity(float x,
float y,
float z)
x - The x component of the gravity vectory - The y component of the gravity vectorz - The z component of the gravity vectorpublic final void setGravity(org.openmali.vecmath2.Vector3f gravity)
gravity - The gravity vectorpublic org.openmali.vecmath2.Vector3f getGravity()
getGravity(null).
public org.openmali.vecmath2.Vector3f getGravity(org.openmali.vecmath2.Vector3f val)
val - An object to place the values into or null
public void getGravity(float[] val)
val - The array to copy the value intopublic final org.odejava.ode.SWIGTYPE_p_dWorldID getId()
public void stepFast()
public void step()
public void step(float stepTime)
stepTime - The time to use for this increment, in secondspublic void quickStep()
public void quickStep(float stepTime)
stepTime - The time to use for this increment, in secondspublic void delete()
public int getStepInteractions()
public void setStepInteractions(int stepInteractions)
stepInteractions - The stepInteractions to set.public float getStepSize()
public void setStepSize(float stepSize)
stepSize - The stepSize to set, in secondsprotected void addBody(Body body)
body - the Body to addprotected void removeBody(Body body)
body - the Body to removepublic List<Body> getBodies()
public Body getBody(String name)
name - The name to look up the body by
public void renameBody(String oldName,
String newName)
oldName - the old body namenewName - the new body namepublic boolean containsBody(String name)
name - the name of the Body
public void deleteBody(Body body)
IllegalArgumentException - if the given Body does not exist in this World.Body.delete()public Body findGeomBody(Geom geom)
geom - The Geom whos parent Body will be seeked
public void setAutoEnableDepthSF1(int autoEnableDepth)
public int getAutoEnableDepthSF1()
public void setContactSurfaceThickness(float depth)
The value provided should be non-negative.
depth - The depth value to allowpublic float getContactSurfaceThickness()
public void setAutoDisableBodies(boolean state)
state - True to enable auto disabling of bodies, false to disablepublic boolean isAutoDisablingBodies()
public void setLinearVelocityDisableThreshold(float vel)
vel - The speed below which the body is disabledpublic float getLinearVelocityDisableThreshold()
public void setAngularVelocityDisableThreshold(float vel)
vel - The speed below which the body is disabledpublic float getAngularVelocityDisableThreshold()
public void setStepDisableThreshold(int steps)
steps - The number of evaluation steps to use or negative to disablepublic int getStepDisableThreshold()
public void setTimeDisableThreshold(float time)
time - The amount of time in seconds or negative to disablepublic float getTimeDisableThreshold()
public void setConstantForceMix(float force)
force - The amount of force to usepublic float getConstantForceMix()
public void setErrorReductionParameter(float erp)
erp - The amount of error reduction to usepublic float getErrorReductionParameter()
public void setMaxCorrectionVelocity(float vel)
vel - The speed at which objects should correct contact problemspublic float getMaxCorrectionVelocity()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||