com.bulletphysics.dynamics.character
Class KinematicCharacterController

java.lang.Object
  extended by com.bulletphysics.dynamics.ActionInterface
      extended by com.bulletphysics.dynamics.character.KinematicCharacterController

public class KinematicCharacterController
extends ActionInterface

KinematicCharacterController is an object that supports a sliding motion in a world. It uses a GhostObject and convex sweep test to test for upcoming collisions. This is combined with discrete collision detection to recover from penetrations.

Interaction between KinematicCharacterController and dynamic rigid bodies needs to be explicity implemented by the user.


Constructor Summary
KinematicCharacterController(PairCachingGhostObject ghostObject, ConvexShape convexShape, float stepHeight)
           
KinematicCharacterController(PairCachingGhostObject ghostObject, ConvexShape convexShape, float stepHeight, int upAxis)
           
 
Method Summary
 boolean canJump()
           
 void debugDraw(IDebugDraw debugDrawer)
           
 float getGravity()
           
 float getMaxSlope()
           
 void jump()
           
 boolean onGround()
           
 void playerStep(CollisionWorld collisionWorld, float dt)
           
 void preStep(CollisionWorld collisionWorld)
           
 void reset()
           
 void setFallSpeed(float fallSpeed)
           
 void setGravity(float gravity)
           
 void setJumpSpeed(float jumpSpeed)
           
 void setMaxJumpHeight(float maxJumpHeight)
           
 void setMaxSlope(float slopeRadians)
           
 void setUpAxis(int axis)
           
 void setVelocityForTimeInterval(Vector3f velocity, float timeInterval)
          Caller provides a velocity with which the character should move for the given time period.
 void setWalkDirection(Vector3f walkDirection)
          This should probably be called setPositionIncrementPerSimulatorStep.
 void updateAction(CollisionWorld collisionWorld, float deltaTime)
           
 void warp(Vector3f origin)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KinematicCharacterController

public KinematicCharacterController(PairCachingGhostObject ghostObject,
                                    ConvexShape convexShape,
                                    float stepHeight)

KinematicCharacterController

public KinematicCharacterController(PairCachingGhostObject ghostObject,
                                    ConvexShape convexShape,
                                    float stepHeight,
                                    int upAxis)
Method Detail

updateAction

public void updateAction(CollisionWorld collisionWorld,
                         float deltaTime)
Specified by:
updateAction in class ActionInterface

debugDraw

public void debugDraw(IDebugDraw debugDrawer)
Specified by:
debugDraw in class ActionInterface

setUpAxis

public void setUpAxis(int axis)

setWalkDirection

public void setWalkDirection(Vector3f walkDirection)
This should probably be called setPositionIncrementPerSimulatorStep. This is neither a direction nor a velocity, but the amount to increment the position each simulation iteration, regardless of dt.

This call will reset any velocity set by setVelocityForTimeInterval(javax.vecmath.Vector3f, float).


setVelocityForTimeInterval

public void setVelocityForTimeInterval(Vector3f velocity,
                                       float timeInterval)
Caller provides a velocity with which the character should move for the given time period. After the time period, velocity is reset to zero. This call will reset any walk direction set by setWalkDirection(javax.vecmath.Vector3f). Negative time intervals will result in no motion.


reset

public void reset()

warp

public void warp(Vector3f origin)

preStep

public void preStep(CollisionWorld collisionWorld)

playerStep

public void playerStep(CollisionWorld collisionWorld,
                       float dt)

setFallSpeed

public void setFallSpeed(float fallSpeed)

setJumpSpeed

public void setJumpSpeed(float jumpSpeed)

setMaxJumpHeight

public void setMaxJumpHeight(float maxJumpHeight)

canJump

public boolean canJump()

jump

public void jump()

setGravity

public void setGravity(float gravity)

getGravity

public float getGravity()

setMaxSlope

public void setMaxSlope(float slopeRadians)

getMaxSlope

public float getMaxSlope()

onGround

public boolean onGround()