public abstract class AbstractPhysicsControl extends java.lang.Object implements PhysicsControl, com.jme3.util.clone.JmeCloneable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
added |
protected boolean |
applyLocal |
protected boolean |
enabled |
protected PhysicsSpace |
space |
protected com.jme3.scene.Spatial |
spatial |
| Constructor and Description |
|---|
AbstractPhysicsControl() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addPhysics(PhysicsSpace space)
Called when the physics object is supposed to add all objects it needs to
manage to the physics space.
|
protected void |
applyPhysicsTransform(com.jme3.math.Vector3f worldLocation,
com.jme3.math.Quaternion worldRotation)
Applies a physics transform to the spatial
|
void |
cloneFields(com.jme3.util.clone.Cloner cloner,
java.lang.Object original) |
protected abstract void |
createSpatialData(com.jme3.scene.Spatial spat)
Called when the control is added to a new spatial, create any
spatial-dependent data here.
|
PhysicsSpace |
getPhysicsSpace() |
protected com.jme3.math.Quaternion |
getSpatialRotation() |
protected com.jme3.math.Vector3f |
getSpatialTranslation() |
boolean |
isApplyPhysicsLocal() |
boolean |
isEnabled()
Returns the current enabled state of the physics control
|
void |
read(com.jme3.export.JmeImporter im) |
protected abstract void |
removePhysics(PhysicsSpace space)
Called when the physics object is supposed to remove all objects added to
the physics space.
|
protected abstract void |
removeSpatialData(com.jme3.scene.Spatial spat)
Called when the control is removed from a spatial, remove any
spatial-dependent data here.
|
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)
The physics object is removed from the physics space when the control
is disabled.
|
protected abstract void |
setPhysicsLocation(com.jme3.math.Vector3f vec)
Called when the physics object is supposed to move to the spatial
position.
|
protected abstract void |
setPhysicsRotation(com.jme3.math.Quaternion quat)
Called when the physics object is supposed to move to the spatial
rotation.
|
void |
setPhysicsSpace(PhysicsSpace space)
Only used internally, do not call.
|
void |
setSpatial(com.jme3.scene.Spatial spatial) |
void |
update(float tpf) |
void |
write(com.jme3.export.JmeExporter ex) |
protected com.jme3.scene.Spatial spatial
protected boolean enabled
protected boolean added
protected PhysicsSpace space
protected boolean applyLocal
protected abstract void createSpatialData(com.jme3.scene.Spatial spat)
spat - The new spatial, guaranteed not to be nullprotected abstract void removeSpatialData(com.jme3.scene.Spatial spat)
spat - The old spatial, guaranteed not to be nullprotected abstract void setPhysicsLocation(com.jme3.math.Vector3f vec)
vec - protected abstract void setPhysicsRotation(com.jme3.math.Quaternion quat)
quat - protected abstract void addPhysics(PhysicsSpace space)
space - protected abstract void removePhysics(PhysicsSpace space)
space - public boolean isApplyPhysicsLocal()
public void setApplyPhysicsLocal(boolean applyPhysicsLocal)
applyPhysicsLocal - protected com.jme3.math.Vector3f getSpatialTranslation()
protected com.jme3.math.Quaternion getSpatialRotation()
protected void applyPhysicsTransform(com.jme3.math.Vector3f worldLocation,
com.jme3.math.Quaternion worldRotation)
worldLocation - worldRotation - public 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 void setEnabled(boolean enabled)
PhysicsControlsetEnabled in interface PhysicsControlpublic boolean isEnabled()
PhysicsControlisEnabled in interface PhysicsControlpublic 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 space)
PhysicsControlsetPhysicsSpace in interface PhysicsControlpublic PhysicsSpace getPhysicsSpace()
getPhysicsSpace in interface PhysicsControlpublic void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablejava.io.IOExceptionpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savablejava.io.IOException