public class KinematicCharacterController extends ActionInterface
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 and Description |
|---|
KinematicCharacterController(PairCachingGhostObject ghostObject,
ConvexShape convexShape,
float stepHeight) |
KinematicCharacterController(PairCachingGhostObject ghostObject,
ConvexShape convexShape,
float stepHeight,
int upAxis) |
| Modifier and Type | Method and Description |
|---|---|
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) |
public KinematicCharacterController(PairCachingGhostObject ghostObject, ConvexShape convexShape, float stepHeight)
public KinematicCharacterController(PairCachingGhostObject ghostObject, ConvexShape convexShape, float stepHeight, int upAxis)
public void updateAction(CollisionWorld collisionWorld, float deltaTime)
updateAction in class ActionInterfacepublic void debugDraw(IDebugDraw debugDrawer)
debugDraw in class ActionInterfacepublic void setUpAxis(int axis)
public void setWalkDirection(Vector3f walkDirection)
This call will reset any velocity set by setVelocityForTimeInterval(javax.vecmath.Vector3f, float).
public void setVelocityForTimeInterval(Vector3f velocity, float timeInterval)
setWalkDirection(javax.vecmath.Vector3f).
Negative time intervals will result in no motion.public void reset()
public void warp(Vector3f origin)
public void preStep(CollisionWorld collisionWorld)
public void playerStep(CollisionWorld collisionWorld, float dt)
public void setFallSpeed(float fallSpeed)
public void setJumpSpeed(float jumpSpeed)
public void setMaxJumpHeight(float maxJumpHeight)
public boolean canJump()
public void jump()
public void setGravity(float gravity)
public float getGravity()
public void setMaxSlope(float slopeRadians)
public float getMaxSlope()
public boolean onGround()