org.xith3d.physics
Class PhysicsEngine

java.lang.Object
  extended by org.xith3d.physics.PhysicsEngine
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, Updatable

public abstract class PhysicsEngine
extends java.lang.Object
implements Updatable, org.jagatoo.datatypes.Enableable

This is a handy utility class, that holds instances of CollisionEngine and SimulationEngine.
The update() method directly invokes the update() methods of these two engines.


Constructor Summary
protected PhysicsEngine(CollisionEngine collEngine, SimulationEngine simEngine)
           
 
Method Summary
 void addCollisionResolver(CollisionResolver cr)
           
 void addCollisionResolverListener(CollisionResolveListener l)
           
 CollisionEngine getCollisionEngine()
           
 CollisionResolversManager getCollisionResolversManager()
           
 SurfaceParameters getDefaultSurfaceParameters()
           
 PhysicsGFXManager getGFXManager()
           
 SimulationEngine getSimulationEngine()
           
 boolean isEnabled()
           
 void removeCollisionResolver(CollisionResolver cr)
           
 void removeCollisionResolverListener(CollisionResolveListener l)
           
 void setDefaultSurfaceParameters(SurfaceParameters parameters)
           
 void setEnabled(boolean enabled)
          Sets this PhysicsEngine enabled/disabled.
 void setGFXManager(PhysicsGFXManager gfxManager)
           
 void update(long gameTime, long frameTime, UpdatingThread.TimingMode timingMode)
          Updates this Updatable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhysicsEngine

protected PhysicsEngine(CollisionEngine collEngine,
                        SimulationEngine simEngine)
Method Detail

getCollisionResolversManager

public final CollisionResolversManager getCollisionResolversManager()

setDefaultSurfaceParameters

public final void setDefaultSurfaceParameters(SurfaceParameters parameters)

getDefaultSurfaceParameters

public final SurfaceParameters getDefaultSurfaceParameters()

addCollisionResolver

public final void addCollisionResolver(CollisionResolver cr)

removeCollisionResolver

public final void removeCollisionResolver(CollisionResolver cr)

addCollisionResolverListener

public final void addCollisionResolverListener(CollisionResolveListener l)

removeCollisionResolverListener

public final void removeCollisionResolverListener(CollisionResolveListener l)

getCollisionEngine

public final CollisionEngine getCollisionEngine()

getSimulationEngine

public final SimulationEngine getSimulationEngine()

setGFXManager

public final void setGFXManager(PhysicsGFXManager gfxManager)

getGFXManager

public final PhysicsGFXManager getGFXManager()

setEnabled

public final void setEnabled(boolean enabled)
Sets this PhysicsEngine enabled/disabled.
If not enabled, the update() method will do nothing.

Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable
Parameters:
enabled -

isEnabled

public final boolean isEnabled()
Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable
Returns:
if this PhysicsEngine is enabled.
If not enabled, the update() method will do nothing.

update

public void update(long gameTime,
                   long frameTime,
                   UpdatingThread.TimingMode timingMode)
Description copied from interface: Updatable
Updates this Updatable object.

Specified by:
update in interface Updatable
Parameters:
gameTime - the gameTime in Milliseconds
frameTime - the frameTime in Milliseconds (needed time for the last frame)
timingMode - the TimingMode to use for frameTime.