public class PhysicsCharacter extends PhysicsCollisionObject
| Modifier and Type | Field and Description |
|---|---|
protected long |
characterId |
protected float |
fallSpeed |
protected float |
jumpSpeed |
protected boolean |
locationDirty |
protected float |
stepHeight |
protected com.jme3.math.Quaternion |
tmp_inverseWorldRotation |
protected int |
upAxis |
protected com.jme3.math.Vector3f |
walkDirection |
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, collisionGroup, collisionGroupsMask, collisionShape, objectId| Constructor and Description |
|---|
PhysicsCharacter() |
PhysicsCharacter(CollisionShape shape,
float stepHeight) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildObject() |
void |
destroy() |
protected void |
finalize() |
float |
getCcdMotionThreshold() |
float |
getCcdSquareMotionThreshold() |
float |
getCcdSweptSphereRadius() |
long |
getControllerId()
used internally
|
float |
getFallSpeed() |
float |
getGravity() |
float |
getJumpSpeed() |
float |
getMaxSlope() |
com.jme3.math.Vector3f |
getPhysicsLocation() |
com.jme3.math.Vector3f |
getPhysicsLocation(com.jme3.math.Vector3f trans) |
int |
getUpAxis() |
com.jme3.math.Vector3f |
getWalkDirection() |
void |
jump() |
boolean |
onGround() |
void |
read(com.jme3.export.JmeImporter e) |
void |
setCcdMotionThreshold(float threshold) |
void |
setCcdSweptSphereRadius(float radius) |
void |
setCollisionShape(CollisionShape collisionShape)
Sets a CollisionShape to this physics object, note that the object should
not be in the physics space when adding a new collision shape as it is rebuilt
on the physics side.
|
void |
setFallSpeed(float fallSpeed) |
void |
setGravity(float value) |
void |
setJumpSpeed(float jumpSpeed) |
void |
setMaxSlope(float slopeRadians) |
void |
setPhysicsLocation(com.jme3.math.Vector3f location)
Set the physics location (same as warp())
|
void |
setUpAxis(int axis) |
void |
setWalkDirection(com.jme3.math.Vector3f vec)
Set the walk direction, works continuously.
|
void |
warp(com.jme3.math.Vector3f location)
Sets the location of this physics character
|
void |
write(com.jme3.export.JmeExporter e) |
addCollideWithGroup, attachCollisionShape, finalizeNative, getCollideWithGroups, getCollisionGroup, getCollisionShape, getObjectId, getUserObject, initUserPointer, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObjectprotected long characterId
protected float stepHeight
protected com.jme3.math.Vector3f walkDirection
protected float fallSpeed
protected float jumpSpeed
protected int upAxis
protected boolean locationDirty
protected final com.jme3.math.Quaternion tmp_inverseWorldRotation
public PhysicsCharacter()
public PhysicsCharacter(CollisionShape shape, float stepHeight)
shape - The CollisionShape (no Mesh or CompoundCollisionShapes)stepHeight - The quantization size for vertical movementprotected void buildObject()
public void warp(com.jme3.math.Vector3f location)
location - public void setWalkDirection(com.jme3.math.Vector3f vec)
vec - the walk direction to setpublic com.jme3.math.Vector3f getWalkDirection()
public void setUpAxis(int axis)
public int getUpAxis()
public void setFallSpeed(float fallSpeed)
public float getFallSpeed()
public void setJumpSpeed(float jumpSpeed)
public float getJumpSpeed()
public void setGravity(float value)
public float getGravity()
public void setMaxSlope(float slopeRadians)
public float getMaxSlope()
public boolean onGround()
public void jump()
public void setCollisionShape(CollisionShape collisionShape)
PhysicsCollisionObjectsetCollisionShape in class PhysicsCollisionObjectcollisionShape - the CollisionShape to setpublic void setPhysicsLocation(com.jme3.math.Vector3f location)
location - the location of the actual physics objectpublic com.jme3.math.Vector3f getPhysicsLocation(com.jme3.math.Vector3f trans)
public com.jme3.math.Vector3f getPhysicsLocation()
public void setCcdSweptSphereRadius(float radius)
public void setCcdMotionThreshold(float threshold)
public float getCcdSweptSphereRadius()
public float getCcdMotionThreshold()
public float getCcdSquareMotionThreshold()
public long getControllerId()
public void destroy()
public void write(com.jme3.export.JmeExporter e)
throws java.io.IOException
write in interface com.jme3.export.Savablewrite in class PhysicsCollisionObjectjava.io.IOExceptionpublic void read(com.jme3.export.JmeImporter e)
throws java.io.IOException
read in interface com.jme3.export.Savableread in class PhysicsCollisionObjectjava.io.IOExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class PhysicsCollisionObjectjava.lang.Throwable