public class CharacterController extends NativePhysicsObject
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
loggerN| Constructor and Description |
|---|
CharacterController(PhysicsCharacter character)
Instantiate a controller for the specified collision object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyAll(CharacterController source)
Copy all parameter values from the specified controller.
|
float |
getAngularDamping()
Determine the character's angular damping.
|
Vector3f |
getAngularVelocity(Vector3f storeResult)
Determine the character's angular velocity.
|
float |
getFallSpeed()
Determine the character's maximum fall speed (terminal velocity).
|
Vector3f |
getGravity(Vector3f storeResult)
Determine the character's gravitational acceleration.
|
float |
getJumpSpeed()
Determine the character's jump speed.
|
float |
getLinearDamping()
Determine the character's linear damping.
|
Vector3f |
getLinearVelocity(Vector3f storeResult)
Determine the linear velocity of the character's center.
|
float |
getMaxPenetrationDepth()
Determine the character's maximum penetration depth.
|
float |
getMaxSlope()
Determine the character's maximum slope angle.
|
float |
getStepHeight()
Determine the character's step height.
|
Vector3f |
getUpDirection(Vector3f storeResult)
Determine the character's "up" direction.
|
Vector3f |
getWalkDirection(Vector3f storeResult)
Determine the character's walk offset.
|
boolean |
isUsingGhostSweepTest()
Test whether the ghost's convex-sweep test is in use.
|
void |
jump(Vector3f direction)
Jump in the specified direction.
|
boolean |
onGround()
Test whether the character is on the ground.
|
void |
reset(PhysicsSpace space)
Reset this controller, including its velocity.
|
void |
setAngularDamping(float damping)
Alter the character's angular damping.
|
void |
setAngularVelocity(Vector3f angularVelocity)
Alter the character's angular velocity.
|
void |
setFallSpeed(float fallSpeed)
Alter the character's maximum fall speed (terminal velocity).
|
void |
setGravity(Vector3f gravity)
Alter the character's gravitational acceleration.
|
void |
setJumpSpeed(float jumpSpeed)
Alter the character's jump speed.
|
void |
setLinearDamping(float damping)
Alter the character's linear damping.
|
void |
setLinearVelocity(Vector3f velocity)
Alter the linear velocity of the character's center.
|
void |
setMaxPenetrationDepth(float depth)
Alter the character's maximum penetration depth.
|
void |
setMaxSlope(float slopeRadians)
Alter the character's maximum slope angle.
|
void |
setStepHeight(float height)
Alter the character's step height.
|
void |
setSweepTest(boolean useGhostSweepTest)
Alter which convex-sweep test is used.
|
void |
setUp(Vector3f direction)
Alter the character's "up" direction.
|
void |
setWalkDirection(Vector3f offset)
Alter the character's walk offset.
|
void |
warp(Vector3f location)
Directly alter the location of the character's center.
|
void |
warpDp(Vec3d location)
Directly alter the location of the character's center.
|
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObjectpublic static final java.util.logging.Logger logger
public CharacterController(PhysicsCharacter character)
character - the collision object to control (not null)public void copyAll(CharacterController source)
source - the controller to copy from (not null, unaffected)public float getAngularDamping()
public Vector3f getAngularVelocity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public float getFallSpeed()
public Vector3f getGravity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public float getJumpSpeed()
public float getLinearDamping()
public Vector3f getLinearVelocity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public float getMaxPenetrationDepth()
public float getMaxSlope()
public float getStepHeight()
public Vector3f getUpDirection(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public Vector3f getWalkDirection(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public boolean isUsingGhostSweepTest()
public void jump(Vector3f direction)
direction - desired jump direction (not null, unaffected) or (0,0,0)
to jump in the "up" directionpublic boolean onGround()
public void reset(PhysicsSpace space)
space - (not null)public void setAngularDamping(float damping)
damping - the desired viscous damping ratio (0→no damping,
1→critically damped, default=0)public void setAngularVelocity(Vector3f angularVelocity)
angularVelocity - the desired angular velocity vector (not null,
unaffected)public void setFallSpeed(float fallSpeed)
fallSpeed - the desired speed (in physics-space units per second,
default=55)public void setGravity(Vector3f gravity)
gravity - the desired acceleration vector (in physics-space units
per second squared, not null, finite, unaffected, default=(0,-29.4,0))public void setJumpSpeed(float jumpSpeed)
jumpSpeed - the desired speed (in physics-space units per second,
default=10)public void setLinearDamping(float damping)
damping - the desired viscous damping ratio (0→no damping,
1→critically damped, default=0)public void setLinearVelocity(Vector3f velocity)
velocity - the desired velocity vector (not null, finite)public void setMaxPenetrationDepth(float depth)
depth - the desired depth (in physics-space units, default=0.2)public void setMaxSlope(float slopeRadians)
slopeRadians - the desired angle relative to the horizontal (in
radians, default=Pi/4)public void setStepHeight(float height)
height - the desired maximum amount of vertical movement without
jumping or falling (in physics-space units, default=1)public void setSweepTest(boolean useGhostSweepTest)
useGhostSweepTest - true to use the ghost's test, false to use the
world's test (default=true)public void setUp(Vector3f direction)
direction - the desired direction (not null, not zero, unaffected,
default=(0,1,0))public void setWalkDirection(Vector3f offset)
offset - the desired location increment for each simulation step (in
physics-space coordinates, not null, finite, unaffected, default=(0,0,0))public void warp(Vector3f location)
location - the desired physics location (not null, finite,
unaffected)public void warpDp(Vec3d location)
location - the desired physics location (not null, finite,
unaffected)