public class PhysicsHoverControl extends PhysicsVehicle implements PhysicsControl, PhysicsTickListener, JmeCloneable
| Modifier and Type | Field and Description |
|---|---|
protected float |
accelerationValue |
protected boolean |
enabled |
protected Vector3f |
HOVER_HEIGHT_LF |
protected Vector3f |
HOVER_HEIGHT_LF_START |
protected Vector3f |
HOVER_HEIGHT_LR |
protected Vector3f |
HOVER_HEIGHT_LR_START |
protected Vector3f |
HOVER_HEIGHT_RF |
protected Vector3f |
HOVER_HEIGHT_RF_START |
protected Vector3f |
HOVER_HEIGHT_RR |
protected Vector3f |
HOVER_HEIGHT_RR_START |
protected PhysicsSpace |
space |
protected Spatial |
spatial |
protected float |
steeringValue |
protected Vector3f |
tempVect1 |
protected Vector3f |
tempVect2 |
protected Vector3f |
tempVect3 |
protected int |
xw |
protected int |
yw |
protected int |
zw |
physicsSpace, rayCaster, tuning, vehicle, wheelsconstructionInfo, joints, kinematic, localInertia, mass, motionState, rBody, tempMatrix, tempTrans, tempVec, tempVec2COLLISION_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| Constructor and Description |
|---|
PhysicsHoverControl() |
PhysicsHoverControl(CollisionShape shape)
Creates a new PhysicsNode with the supplied collision shape
|
PhysicsHoverControl(CollisionShape shape,
float mass) |
| Modifier and Type | Method and Description |
|---|---|
void |
accelerate(float accelerationValue)
Apply the given engine force to all wheels, works continuously
|
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Implemented to perform deep cloning for this object, resolving
local cloned references using the specified cloner.
|
Control |
cloneForSpatial(Spatial spatial)
Deprecated.
|
PhysicsSpace |
getPhysicsSpace()
Access the physics space to which the object is (or would be) added.
|
boolean |
isEnabled()
Test whether this control is enabled.
|
java.lang.Object |
jmeClone()
Performs a regular shallow clone of the object.
|
void |
physicsTick(PhysicsSpace space,
float f)
Callback from Bullet, invoked just after the physics has been stepped,
use to check for forces etc.
|
void |
prePhysicsTick(PhysicsSpace space,
float f)
Callback from Bullet, invoked just before the physics is stepped.
|
void |
read(JmeImporter im)
De-serialize this body, for example when loading from a J3O file.
|
void |
render(RenderManager rm,
ViewPort vp)
Should be called prior to queuing the spatial by the RenderManager.
|
void |
setEnabled(boolean enabled)
Enable or disable this control.
|
void |
setPhysicsSpace(PhysicsSpace space)
If enabled, add this control's physics object to the specified physics
space.
|
void |
setSpatial(Spatial spatial) |
void |
steer(float steeringValue)
Set the given steering value to all front wheels (0 = forward)
|
void |
update(float tpf)
Updates the control.
|
void |
write(JmeExporter ex)
Serialize this body, for example when saving to a J3O file.
|
accelerate, addWheel, addWheel, applyWheelTransforms, brake, brake, createVehicle, destroy, getCurrentVehicleSpeedKmHour, getForwardVector, getFrictionSlip, getMaxSuspensionForce, getMaxSuspensionTravelCm, getNumWheels, getSuspensionCompression, getSuspensionDamping, getSuspensionStiffness, getVehicleId, getWheel, postRebuild, removeWheel, resetSuspension, setFrictionSlip, setFrictionSlip, setMaxSuspensionForce, setMaxSuspensionForce, setMaxSuspensionTravelCm, setMaxSuspensionTravelCm, setRollInfluence, setSuspensionCompression, setSuspensionCompression, setSuspensionDamping, setSuspensionDamping, setSuspensionStiffness, setSuspensionStiffness, steer, updateWheelsactivate, addJoint, applyCentralForce, applyForce, applyImpulse, applyTorque, applyTorqueImpulse, clearForces, getAngularDamping, getAngularFactor, getAngularSleepingThreshold, getAngularVelocity, getAngularVelocity, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getFriction, getGravity, getGravity, getInterpolatedPhysicsLocation, getInterpolatedPhysicsRotation, getJoints, getLinearDamping, getLinearSleepingThreshold, getLinearVelocity, getLinearVelocity, getMass, getMotionState, getObjectId, getPhysicsLocation, getPhysicsLocation, getPhysicsRotation, getPhysicsRotation, getPhysicsRotationMatrix, getPhysicsRotationMatrix, getRestitution, isActive, isContactResponse, isKinematic, preRebuild, rebuildRigidBody, removeJoint, setAngularDamping, setAngularFactor, setAngularSleepingThreshold, setAngularVelocity, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollisionShape, setContactResponse, setDamping, setFriction, setGravity, setKinematic, setLinearDamping, setLinearSleepingThreshold, setLinearVelocity, setMass, setPhysicsLocation, setPhysicsRotation, setPhysicsRotation, setRestitution, setSleepingThresholdsaddCollideWithGroup, getCollideWithGroups, getCollisionGroup, getCollisionShape, getUserObject, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObjectprotected Spatial spatial
protected boolean enabled
protected PhysicsSpace space
protected float steeringValue
protected float accelerationValue
protected int xw
protected int zw
protected int yw
protected Vector3f HOVER_HEIGHT_LF_START
protected Vector3f HOVER_HEIGHT_RF_START
protected Vector3f HOVER_HEIGHT_LR_START
protected Vector3f HOVER_HEIGHT_RR_START
protected Vector3f HOVER_HEIGHT_LF
protected Vector3f HOVER_HEIGHT_RF
protected Vector3f HOVER_HEIGHT_LR
protected Vector3f HOVER_HEIGHT_RR
protected Vector3f tempVect1
protected Vector3f tempVect2
protected Vector3f tempVect3
public PhysicsHoverControl()
public PhysicsHoverControl(CollisionShape shape)
shape - the desired collision shapepublic PhysicsHoverControl(CollisionShape shape, float mass)
@Deprecated public Control cloneForSpatial(Spatial spatial)
ControlcloneForSpatial in interface Controlspatial - the Spatial to be controlled by the clonepublic java.lang.Object jmeClone()
JmeCloneableThis method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.
jmeClone in interface JmeCloneablepublic void cloneFields(Cloner cloner, java.lang.Object original)
JmeCloneableNote: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
cloneFields in interface JmeCloneablecloner - The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original - The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone and this object need merely clone what it wants.public void setSpatial(Spatial spatial)
setSpatial in interface Controlspatial - the spatial to be controlled. This should not be called
from user code.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 prePhysicsTick(PhysicsSpace space, float f)
PhysicsTickListenerprePhysicsTick in interface PhysicsTickListenerspace - the space that is about to be stepped (not null)f - the time per physics step (in seconds, ≥0)public void physicsTick(PhysicsSpace space, float f)
PhysicsTickListenerphysicsTick in interface PhysicsTickListenerspace - the space that was just stepped (not null)f - the time per physics step (in seconds, ≥0)public void update(float tpf)
Controlpublic void render(RenderManager rm, ViewPort vp)
Controlpublic void setPhysicsSpace(PhysicsSpace space)
PhysicsControlsetPhysicsSpace in interface PhysicsControlspace - where to add, or null to simply removepublic PhysicsSpace getPhysicsSpace()
PhysicsControlgetPhysicsSpace in interface PhysicsControlpublic void write(JmeExporter ex) throws java.io.IOException
PhysicsRigidBodywrite in interface Savablewrite in class PhysicsVehicleex - exporter (not null)java.io.IOException - from exporterpublic void read(JmeImporter im) throws java.io.IOException
PhysicsRigidBodyread in interface Savableread in class PhysicsVehicleim - importer (not null)java.io.IOException - from importerpublic void steer(float steeringValue)
PhysicsVehiclesteer in class PhysicsVehiclesteeringValue - the steeringValue to setpublic void accelerate(float accelerationValue)
PhysicsVehicleaccelerate in class PhysicsVehicleaccelerationValue - the accelerationValue to set