public class PhysicsCharacter extends PhysicsCollisionObject
btKinematicCharacterController.| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
COLLISION_GROUP_01, COLLISION_GROUP_02, COLLISION_GROUP_03, COLLISION_GROUP_04, COLLISION_GROUP_05, COLLISION_GROUP_06, COLLISION_GROUP_07, COLLISION_GROUP_08, COLLISION_GROUP_09, COLLISION_GROUP_10, COLLISION_GROUP_11, COLLISION_GROUP_12, COLLISION_GROUP_13, COLLISION_GROUP_14, COLLISION_GROUP_15, COLLISION_GROUP_16, COLLISION_GROUP_NONE, loggerloggerN| Constructor and Description |
|---|
PhysicsCharacter(ConvexShape shape,
float stepHeight)
Instantiate a responsive character with the specified CollisionShape and
step height.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getAngularDamping()
Determine this character's angular damping.
|
Vector3f |
getAngularVelocity(Vector3f storeResult)
Determine this character's angular velocity.
|
long |
getControllerId()
Determine the ID of the btKinematicCharacterController.
|
float |
getFallSpeed()
Determine this character's maximum fall speed (terminal velocity).
|
Vector3f |
getGravity(Vector3f storeResult)
Determine this character's gravitational acceleration.
|
float |
getJumpSpeed()
Determine this character's jump speed.
|
float |
getLinearDamping()
Determine this character's linear damping.
|
Vector3f |
getLinearVelocity(Vector3f storeResult)
Determine the linear velocity of this character's center.
|
float |
getMaxPenetrationDepth()
Determine this character's maximum penetration depth.
|
float |
getMaxSlope()
Determine this character's maximum slope angle.
|
float |
getStepHeight()
Determine this character's step height.
|
Vector3f |
getUpDirection(Vector3f storeResult)
Determine this 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()
Jump in the "up" direction.
|
void |
jump(Vector3f direction)
Jump in the specified direction.
|
boolean |
onGround()
Test whether this character is on the ground.
|
void |
reset(PhysicsSpace space)
Reset this character, including its velocity.
|
void |
setAngularDamping(float damping)
Alter this character's angular damping.
|
void |
setAngularVelocity(Vector3f angularVelocity)
Alter this character's angular velocity.
|
void |
setCollisionShape(CollisionShape collisionShape)
Apply the specified CollisionShape to this character.
|
void |
setContactResponse(boolean newState)
Enable/disable this character's contact response.
|
void |
setFallSpeed(float fallSpeed)
Alter this character's maximum fall speed (terminal velocity).
|
void |
setGravity(float downwardAcceleration)
Alter the character's gravitational acceleration without altering its
"up" vector.
|
void |
setGravity(Vector3f gravity)
Alter this character's gravitational acceleration.
|
void |
setJumpSpeed(float jumpSpeed)
Alter this character's jump speed.
|
void |
setLinearDamping(float damping)
Alter this character's linear damping.
|
void |
setLinearVelocity(Vector3f velocity)
Alter the linear velocity of this character's center.
|
void |
setMaxPenetrationDepth(float depth)
Alter this character's maximum penetration depth.
|
void |
setMaxSlope(float slopeRadians)
Alter this character's maximum slope angle.
|
void |
setPhysicsLocation(Vector3f location)
Directly alter this character's location.
|
void |
setPhysicsLocationDp(Vec3d location)
Directly alter this character's location.
|
void |
setStepHeight(float height)
Alter this character's step height.
|
void |
setSweepTest(boolean useGhostSweepTest)
Alter which convex-sweep test is used.
|
void |
setUp(Vector3f direction)
Alter this character's "up" direction.
|
void |
setWalkDirection(Vector3f offset)
Alter this character's walk offset.
|
void |
warp(Vector3f location)
Directly alter the location of this character's center.
|
activate, addCollideWithGroup, addToIgnoreList, attachCollisionShape, boundingBox, clearIgnoreList, collisionFlags, copyPcoProperties, countIgnored, finalizeNative, findInstance, getActivationState, getAnisotropicFriction, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getCollideWithGroups, getCollisionGroup, getCollisionShape, getCollisionSpace, getContactDamping, getContactProcessingThreshold, getContactStiffness, getDeactivationTime, getFriction, getInternalType, getPhysicsLocation, getPhysicsLocationDp, getPhysicsRotation, getPhysicsRotationDp, getPhysicsRotationMatrix, getPhysicsRotationMatrixDp, getRestitution, getRollingFriction, getScale, getSpinningFriction, getTransform, getTransformDp, getUserObject, hasAnisotropicFriction, ignores, initUserPointer, isActive, isContactResponse, isInWorld, isStatic, listIgnoredPcos, proxyGroup, proxyMask, removeCollideWithGroup, removeFromIgnoreList, setActivationState, setAnisotropicFriction, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollideWithGroups, setCollisionFlags, setCollisionGroup, setContactDamping, setContactProcessingThreshold, setContactStiffness, setDeactivationTime, setFriction, setIgnoreList, setLocationAndBasis, setRestitution, setRollingFriction, setSpinningFriction, setUserIndex, setUserIndex2, setUserIndex3, setUserObject, spaceId, toString, userIndex, userIndex2, userIndex3compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final java.util.logging.Logger logger2
public PhysicsCharacter(ConvexShape shape, float stepHeight)
shape - the desired shape (not null, convex, alias created)stepHeight - the maximum amount of vertical movement without jumping
or falling (in physics-space units)public float getAngularDamping()
public Vector3f getAngularVelocity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public long getControllerId()
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()
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 setCollisionShape(CollisionShape collisionShape)
setCollisionShape in class PhysicsCollisionObjectcollisionShape - the shape to apply (not null, convex, alias
created)public void setContactResponse(boolean newState)
newState - true to respond to contact forces, false to ignore them
(default=true)public void setFallSpeed(float fallSpeed)
fallSpeed - the desired speed (in physics-space units per second,
default=55)public void setGravity(float downwardAcceleration)
downwardAcceleration - the desired downward acceleration (in
physics-space units per second squared, default=29.4)public void setGravity(Vector3f gravity)
gravity - the desired acceleration vector (in physics-space units
per second squared, not null, 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)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 above to the horizontal plane (in
radians, ≥0, ≤Pi/2, default=Pi/4)public void setPhysicsLocation(Vector3f location)
warp(com.jme3.math.Vector3f).)location - the desired location (not null, finite, unaffected)public void setPhysicsLocationDp(Vec3d location)
location - the desired location (not null, finite, unaffected)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, unaffected, default=(0,0,0))public void warp(Vector3f location)
location - the desired physics location (not null, finite,
unaffected)