public class CharacterControl extends PhysicsCharacter implements PhysicsControl, com.jme3.util.clone.JmeCloneable
BetterCharacterControl as well.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
added |
protected boolean |
applyLocal |
protected boolean |
enabled |
protected PhysicsSpace |
space |
protected com.jme3.scene.Spatial |
spatial |
protected boolean |
useViewDirection |
protected com.jme3.math.Vector3f |
viewDirection |
characterId, fallSpeed, jumpSpeed, locationDirty, stepHeight, tmp_inverseWorldRotation, upAxis, walkDirectionCOLLISION_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 |
|---|
CharacterControl() |
CharacterControl(CollisionShape shape,
float stepHeight) |
| Modifier and Type | Method and Description |
|---|---|
void |
cloneFields(com.jme3.util.clone.Cloner cloner,
java.lang.Object original) |
com.jme3.scene.control.Control |
cloneForSpatial(com.jme3.scene.Spatial spatial)
Deprecated.
|
PhysicsSpace |
getPhysicsSpace()
Access the physics space to which the object is (or would be) added.
|
com.jme3.scene.Spatial |
getSpatial() |
com.jme3.math.Vector3f |
getViewDirection() |
boolean |
isApplyPhysicsLocal() |
boolean |
isEnabled()
Test whether this control is enabled.
|
boolean |
isUseViewDirection() |
java.lang.Object |
jmeClone() |
void |
read(com.jme3.export.JmeImporter im)
De-serialize this character from the specified importer, for example when
loading from a J3O file.
|
void |
render(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp) |
void |
setApplyPhysicsLocal(boolean applyPhysicsLocal)
When set to true, the physics coordinates will be applied to the local
translation of the Spatial
|
void |
setEnabled(boolean enabled)
Enable or disable this control.
|
void |
setPhysicsSpace(PhysicsSpace newSpace)
If enabled, add this control's physics object to the specified physics
space.
|
void |
setSpatial(com.jme3.scene.Spatial spatial) |
void |
setUseViewDirection(boolean viewDirectionEnabled) |
void |
setViewDirection(com.jme3.math.Vector3f vec) |
void |
update(float tpf) |
void |
write(com.jme3.export.JmeExporter ex)
Serialize this character, for example when saving to a J3O file.
|
buildObject, destroy, finalize, getAngularDamping, getAngularVelocity, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getControllerId, getFallSpeed, getGravity, getGravity, getJumpSpeed, getLinearDamping, getLinearVelocity, getMaxPenetrationDepth, getMaxSlope, getPhysicsLocation, getPhysicsLocation, getStepHeight, getUpAxis, getWalkDirection, jump, jump, onGround, setAngularDamping, setAngularVelocity, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollisionShape, setContactResponse, setFallSpeed, setGravity, setGravity, setJumpSpeed, setLinearDamping, setLinearVelocity, setMaxPenetrationDepth, setMaxSlope, setPhysicsLocation, setStepHeight, setUp, setUpAxis, setWalkDirection, warpaddCollideWithGroup, attachCollisionShape, finalizeNative, getCollideWithGroups, getCollisionFlags, getCollisionGroup, getCollisionShape, getDeactivationTime, getObjectId, getUserObject, initUserPointer, isContactResponse, removeCollideWithGroup, setCollideWithGroups, setCollisionFlags, setCollisionGroup, setUserObjectprotected com.jme3.scene.Spatial spatial
protected boolean enabled
protected boolean added
protected PhysicsSpace space
protected com.jme3.math.Vector3f viewDirection
protected boolean useViewDirection
protected boolean applyLocal
public CharacterControl()
public CharacterControl(CollisionShape shape, float stepHeight)
public boolean isApplyPhysicsLocal()
public void setApplyPhysicsLocal(boolean applyPhysicsLocal)
applyPhysicsLocal - @Deprecated public com.jme3.scene.control.Control cloneForSpatial(com.jme3.scene.Spatial spatial)
cloneForSpatial in interface com.jme3.scene.control.Controlpublic java.lang.Object jmeClone()
jmeClone in interface com.jme3.util.clone.JmeCloneablepublic void cloneFields(com.jme3.util.clone.Cloner cloner,
java.lang.Object original)
cloneFields in interface com.jme3.util.clone.JmeCloneablepublic void setSpatial(com.jme3.scene.Spatial spatial)
setSpatial in interface com.jme3.scene.control.Controlpublic com.jme3.scene.Spatial getSpatial()
public void setEnabled(boolean enabled)
PhysicsControlThe physics object is removed from its physics space when the control is disabled. When the control is enabled again, the physics object is moved to the current location of the spatial and then added to the physics space.
setEnabled in interface PhysicsControlenabled - true→enable the control, false→disable itpublic boolean isEnabled()
PhysicsControlisEnabled in interface PhysicsControlpublic void setViewDirection(com.jme3.math.Vector3f vec)
public com.jme3.math.Vector3f getViewDirection()
public boolean isUseViewDirection()
public void setUseViewDirection(boolean viewDirectionEnabled)
public void update(float tpf)
update in interface com.jme3.scene.control.Controlpublic void render(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp)
render in interface com.jme3.scene.control.Controlpublic void setPhysicsSpace(PhysicsSpace newSpace)
setPhysicsSpace in interface PhysicsControlnewSpace - where to add, or null to simply removepublic PhysicsSpace getPhysicsSpace()
PhysicsControlgetPhysicsSpace in interface PhysicsControlpublic void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
PhysicsCharacterwrite in interface com.jme3.export.Savablewrite in class PhysicsCharacterex - exporter (not null)java.io.IOException - from exporterpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
PhysicsCharacterread in interface com.jme3.export.Savableread in class PhysicsCharacterim - importer (not null)java.io.IOException - from importer