org.xith3d.input.modules.fpih
Class FPIHPhysics

java.lang.Object
  extended by org.xith3d.input.modules.fpih.FPIHPhysics

public class FPIHPhysics
extends java.lang.Object

This is the physics code for the FirstPersonInputHandler.


Constructor Summary
FPIHPhysics(org.openmali.spatial.AxisIndicator upAxis, float width, float height, org.openmali.vecmath2.Vector3f offset, CollisionEngine collEngine, SimulationEngine simEngine, SimulationWorld simWorld, boolean integrateWithSimulation, boolean addDebugShape)
           
FPIHPhysics(float width, float height, org.openmali.vecmath2.Vector3f offset, CollisionEngine collEngine)
           
FPIHPhysics(float width, float height, org.openmali.vecmath2.Vector3f offset, CollisionEngine collEngine, boolean addDebugShape)
           
FPIHPhysics(float width, float height, org.openmali.vecmath2.Vector3f offset, CollisionEngine collEngine, SimulationEngine simEngine, boolean integrateWithSimulation, boolean addDebugShape)
           
FPIHPhysics(float width, float height, org.openmali.vecmath2.Vector3f offset, CollisionEngine collEngine, SimulationEngine simEngine, SimulationWorld simWorld, boolean integrateWithSimulation, boolean addDebugShape)
           
FPIHPhysics(float width, float height, org.openmali.vecmath2.Vector3f offset, PhysicsEngine physEngine, boolean integrateWithSimulation, boolean addDebugShape)
           
FPIHPhysics(float width, float height, org.openmali.vecmath2.Vector3f offset, PhysicsEngine physEngine, SimulationWorld simWorld, boolean integrateWithSimulation, boolean addDebugShape)
           
 
Method Summary
 boolean areCollisionsEnabled()
           
protected  Collideable createCollideable(CollisionEngine collEngine, float width, float height)
          Creates the Collideable, that is used to check for FPIH collisions with the environment.
protected  Node createCollideableDebugger(org.openmali.spatial.AxisIndicator upAxis, float width, float height)
          Creates the Node (probably a Shape3D), that visualizes the Collideable.
 Body getBody()
           
 Collideable getCollider()
           
 org.openmali.vecmath2.Vector3f getColliderOffset()
           
 Node getDebugNode()
           
 long getLastGameTime()
           
 void init(Transformable view, org.openmali.vecmath2.Vector3f tpOffset)
           
 boolean isSimulationEnabled()
           
 void setColliderCheckCallback(ColliderCheckCallback ccc)
          Use this to check for avatar-collisions from.
 void setColliderOffset(float offsetX, float offsetY, float offsetZ)
          Sets the collision-avatar-offset in world coordinates.
 void setColliderOffset(org.openmali.vecmath2.Tuple3f offset)
          Sets the collision-avatar-offset in world coordinates.
 void setCollisionsEnabled(boolean enabled)
           
 void setSimulationEnabled(boolean enabled)
           
 SlidingColliderCheckCallback setSlidingColliderCheckCallback(CollisionEngine collEngine, CollideableGroup collGroup)
           
 boolean startJump(org.openmali.spatial.AxisIndicator upAxis)
          Called, when the player jumped.
 void update(long gameMicros, long frameMicros, Transformable view, org.openmali.vecmath2.Vector3f deltaMovement, float rotX, float rotY, org.openmali.vecmath2.Vector3f thirdPersonOffset)
           
 void updateFromView(org.openmali.vecmath2.Tuple3f viewPosition)
           
 void updateGameTime(long gameMicros)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FPIHPhysics

public FPIHPhysics(org.openmali.spatial.AxisIndicator upAxis,
                   float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   CollisionEngine collEngine,
                   SimulationEngine simEngine,
                   SimulationWorld simWorld,
                   boolean integrateWithSimulation,
                   boolean addDebugShape)
Parameters:
upAxis -
width -
height -
offset -
collEngine -
simEngine -
simWorld -
integrateWithSimulation -
addDebugShape -

FPIHPhysics

public FPIHPhysics(float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   CollisionEngine collEngine,
                   SimulationEngine simEngine,
                   SimulationWorld simWorld,
                   boolean integrateWithSimulation,
                   boolean addDebugShape)

FPIHPhysics

public FPIHPhysics(float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   CollisionEngine collEngine,
                   SimulationEngine simEngine,
                   boolean integrateWithSimulation,
                   boolean addDebugShape)

FPIHPhysics

public FPIHPhysics(float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   PhysicsEngine physEngine,
                   SimulationWorld simWorld,
                   boolean integrateWithSimulation,
                   boolean addDebugShape)

FPIHPhysics

public FPIHPhysics(float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   PhysicsEngine physEngine,
                   boolean integrateWithSimulation,
                   boolean addDebugShape)

FPIHPhysics

public FPIHPhysics(float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   CollisionEngine collEngine,
                   boolean addDebugShape)

FPIHPhysics

public FPIHPhysics(float width,
                   float height,
                   org.openmali.vecmath2.Vector3f offset,
                   CollisionEngine collEngine)
Method Detail

setCollisionsEnabled

public void setCollisionsEnabled(boolean enabled)

areCollisionsEnabled

public final boolean areCollisionsEnabled()

setSimulationEnabled

public void setSimulationEnabled(boolean enabled)

isSimulationEnabled

public final boolean isSimulationEnabled()

updateGameTime

public final void updateGameTime(long gameMicros)

getLastGameTime

public final long getLastGameTime()

getCollider

public final Collideable getCollider()

getBody

public final Body getBody()

getDebugNode

public final Node getDebugNode()

setColliderOffset

public void setColliderOffset(float offsetX,
                              float offsetY,
                              float offsetZ)
Sets the collision-avatar-offset in world coordinates.

Parameters:
offsetX -
offsetY -
offsetZ -

setColliderOffset

public void setColliderOffset(org.openmali.vecmath2.Tuple3f offset)
Sets the collision-avatar-offset in world coordinates.

Parameters:
offset -

getColliderOffset

public org.openmali.vecmath2.Vector3f getColliderOffset()
Returns:
the collision-avatar-offset in world coordinates.

startJump

public boolean startJump(org.openmali.spatial.AxisIndicator upAxis)
Called, when the player jumped. This method will never contain any code and can easily been overridden.

Returns:
if the jump was accepted

updateFromView

public void updateFromView(org.openmali.vecmath2.Tuple3f viewPosition)

update

public void update(long gameMicros,
                   long frameMicros,
                   Transformable view,
                   org.openmali.vecmath2.Vector3f deltaMovement,
                   float rotX,
                   float rotY,
                   org.openmali.vecmath2.Vector3f thirdPersonOffset)
Parameters:
gameMicros -
frameMicros -
view -
deltaMovement -
rotX -
rotY -
thirdPersonOffset -

setColliderCheckCallback

public void setColliderCheckCallback(ColliderCheckCallback ccc)
Use this to check for avatar-collisions from.

Parameters:
ccc -

setSlidingColliderCheckCallback

public SlidingColliderCheckCallback setSlidingColliderCheckCallback(CollisionEngine collEngine,
                                                                    CollideableGroup collGroup)

init

public void init(Transformable view,
                 org.openmali.vecmath2.Vector3f tpOffset)

createCollideable

protected Collideable createCollideable(CollisionEngine collEngine,
                                        float width,
                                        float height)
Creates the Collideable, that is used to check for FPIH collisions with the environment.

Parameters:
collEngine -
width -
height -
Returns:
the Collideable

createCollideableDebugger

protected Node createCollideableDebugger(org.openmali.spatial.AxisIndicator upAxis,
                                         float width,
                                         float height)
Creates the Node (probably a Shape3D), that visualizes the Collideable.

Parameters:
width -
height -
Returns:
the Collideable-debugger Node