public class BombControl extends RigidBodyControl implements PhysicsCollisionListener, PhysicsTickListener
added, enabled, kinematicSpatial, space, spatial
constructionInfo, joints, kinematic, localInertia, mass, motionState, rBody, tempMatrix, tempTrans, tempVec, tempVec2
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
Constructor and Description |
---|
BombControl(AssetManager manager,
CollisionShape shape,
float mass) |
BombControl(CollisionShape shape,
float mass) |
Modifier and Type | Method and Description |
---|---|
void |
collision(PhysicsCollisionEvent event)
Invoked when a collision happened in the PhysicsSpace.
|
protected void |
createGhostObject() |
float |
getExplosionRadius() |
float |
getForceFactor() |
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 control, for example when loading from a J3O file.
|
void |
setExplosionRadius(float explosionRadius) |
void |
setForceFactor(float forceFactor) |
void |
setPhysicsSpace(PhysicsSpace space)
If enabled, add this control's body to the specified physics space.
|
void |
update(float tpf)
Update this control.
|
void |
write(JmeExporter ex)
Serialize this control, for example when saving to a J3O file.
|
cloneFields, cloneForSpatial, createCollisionShape, getPhysicsSpace, getSpatial, isApplyPhysicsLocal, isEnabled, isKinematicSpatial, jmeClone, render, setApplyPhysicsLocal, setEnabled, setKinematicSpatial, setSpatial
activate, addJoint, applyCentralForce, applyForce, applyImpulse, applyTorque, applyTorqueImpulse, clearForces, destroy, 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, postRebuild, preRebuild, rebuildRigidBody, removeJoint, setAngularDamping, setAngularFactor, setAngularSleepingThreshold, setAngularVelocity, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollisionShape, setContactResponse, setDamping, setFriction, setGravity, setKinematic, setLinearDamping, setLinearSleepingThreshold, setLinearVelocity, setMass, setPhysicsLocation, setPhysicsRotation, setPhysicsRotation, setRestitution, setSleepingThresholds
addCollideWithGroup, getCollideWithGroups, getCollisionGroup, getCollisionShape, getUserObject, removeCollideWithGroup, setCollideWithGroups, setCollisionGroup, setUserObject
public BombControl(CollisionShape shape, float mass)
public BombControl(AssetManager manager, CollisionShape shape, float mass)
public void setPhysicsSpace(PhysicsSpace space)
RigidBodyControl
setPhysicsSpace
in interface PhysicsControl
setPhysicsSpace
in class RigidBodyControl
space
- where to add, or null to simply removeprotected void createGhostObject()
public void collision(PhysicsCollisionEvent event)
PhysicsCollisionListener
Do not retain the event object, as it will be reused after the collision() method returns. Copy any data you need during the collide() method.
collision
in interface PhysicsCollisionListener
event
- the event that occurred (not null, reusable)public void prePhysicsTick(PhysicsSpace space, float f)
PhysicsTickListener
prePhysicsTick
in interface PhysicsTickListener
space
- 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)
PhysicsTickListener
physicsTick
in interface PhysicsTickListener
space
- the space that was just stepped (not null)f
- the time per physics step (in seconds, ≥0)public void update(float tpf)
RigidBodyControl
update
in interface Control
update
in class RigidBodyControl
tpf
- the time interval between frames (in seconds, ≥0)public float getExplosionRadius()
public void setExplosionRadius(float explosionRadius)
explosionRadius
- the explosionRadius to setpublic float getForceFactor()
public void setForceFactor(float forceFactor)
public void read(JmeImporter im) throws java.io.IOException
RigidBodyControl
read
in interface Savable
read
in class RigidBodyControl
im
- importer (not null)java.io.IOException
- from importerpublic void write(JmeExporter ex) throws java.io.IOException
RigidBodyControl
write
in interface Savable
write
in class RigidBodyControl
ex
- exporter (not null)java.io.IOException
- from exporter