java.lang.Object
com.marginallyclever.ro3.physics.ODEPhysics
Manages the ODE4J physics world, space, and contact handling. There must be exactly one of these in the scene for physics to work.
ActionListeners can subscribe to get "Physics started" (1) and "Physics stopped" (0) events.
CollisionListeners can subscribe to get collision events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSubscribe to listen for "Physics started" (1) and "Physics stopped" (0) events.voidaddCollisionListener(CollisionListener listener) Subscribe to listen for collision events.voiddeferredAction(Node created) Deferred action to be taken after some nodes have been added to the scene.doublegetCFM()doublegetERP()doubleorg.ode4j.ode.DSpaceorg.ode4j.ode.DWorldbooleanisPaused()voidvoidremoveCollisionListener(CollisionListener listener) voidreset()voidsetCFM(double WORLD_CFM) voidsetERP(double WORLD_ERP) voidsetGravity(double WORLD_GRAVITY) voidsetPaused(boolean state) voidupdate(double dt)
-
Constructor Details
-
ODEPhysics
public ODEPhysics()
-
-
Method Details
-
reset
public void reset() -
getODEWorld
public org.ode4j.ode.DWorld getODEWorld() -
getODESpace
public org.ode4j.ode.DSpace getODESpace() -
update
public void update(double dt) -
addCollisionListener
Subscribe to listen for collision events.- Parameters:
listener- the listener
-
removeCollisionListener
-
isPaused
public boolean isPaused() -
setPaused
public void setPaused(boolean state) -
getCFM
public double getCFM() -
setCFM
public void setCFM(double WORLD_CFM) -
getERP
public double getERP() -
setERP
public void setERP(double WORLD_ERP) -
getGravity
public double getGravity() -
setGravity
public void setGravity(double WORLD_GRAVITY) -
deferredAction
Deferred action to be taken after some nodes have been added to the scene. -
addActionListener
Subscribe to listen for "Physics started" (1) and "Physics stopped" (0) events.- Parameters:
a- the listener
-
removeActionListener
-