public abstract class PhysicsBody extends PhysicsCollisionObject
| Modifier and Type | Field and Description |
|---|---|
static float |
massForStatic
magic mass value used to specify a static rigid body or soft-body node
|
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, loggerloggerN| Modifier | Constructor and Description |
|---|---|
protected |
PhysicsBody()
Instantiate a PhysicsBody.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJoint(PhysicsJoint joint)
Do not invoke directly! Joints are added automatically when created.
|
int |
countJoints()
Count how many joints connect to this body.
|
static float |
getDeactivationDeadline()
Return the global deactivation deadline.
|
abstract Vector3f |
getGravity(Vector3f storeResult)
Copy this body's gravitational acceleration.
|
abstract float |
getMass()
Determine the total mass of this body.
|
static boolean |
isDeactivationEnabled()
Test the global deactivation enabled flag.
|
PhysicsJoint[] |
listJoints()
Enumerate the joints connected to this body.
|
void |
removeJoint(PhysicsJoint joint)
Do not invoke directly! Joints are removed automatically when destroyed.
|
static void |
setDeactivationDeadline(float newDeadline)
Alter the global deactivation deadline.
|
static void |
setDeactivationEnabled(boolean newSetting)
Alter the global deactivation enabled flag.
|
abstract void |
setGravity(Vector3f acceleration)
Alter this body's gravitational acceleration.
|
abstract void |
setMass(float mass)
Alter this body's total mass.
|
abstract void |
setPhysicsLocation(Vector3f location)
Directly relocate this body's center.
|
activate, addCollideWithGroup, addToIgnoreList, attachCollisionShape, boundingBox, clearIgnoreList, collisionFlags, copyPcoProperties, countIgnored, finalizeNative, findInstance, getActivationState, getAnisotropicFriction, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getCollideWithGroups, getCollisionGroup, getCollisionShape, getCollisionSpace, getContactDamping, getContactProcessingThreshold, getContactStiffness, getDeactivationTime, getFriction, getInternalType, getPhysicsLocation, getPhysicsLocationDp, getPhysicsRotation, getPhysicsRotationDp, getPhysicsRotationMatrix, getPhysicsRotationMatrixDp, getRestitution, getRollingFriction, getScale, getSpinningFriction, getTransform, getTransformDp, getUserObject, hasAnisotropicFriction, ignores, initUserPointer, isActive, isContactResponse, isInWorld, isStatic, listIgnoredPcos, proxyGroup, proxyMask, removeCollideWithGroup, removeFromIgnoreList, setActivationState, setAnisotropicFriction, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollideWithGroups, setCollisionFlags, setCollisionGroup, setCollisionShape, setContactDamping, setContactProcessingThreshold, setContactStiffness, setDeactivationTime, setFriction, setIgnoreList, setLocationAndBasis, setRestitution, setRollingFriction, setSpinningFriction, setUserIndex, setUserIndex2, setUserIndex3, setUserObject, spaceId, toString, userIndex, userIndex2, userIndex3compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final float massForStatic
protected PhysicsBody()
This no-arg constructor was made explicit to avoid javadoc warnings from JDK 18+.
public void addJoint(PhysicsJoint joint)
joint - the joint to add (not null, alias created)public int countJoints()
public static float getDeactivationDeadline()
public abstract Vector3f getGravity(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public abstract float getMass()
public static boolean isDeactivationEnabled()
public PhysicsJoint[] listJoints()
public void removeJoint(PhysicsJoint joint)
joint - the joint to remove (not null, unaffected)PhysicsJoint.destroy()public static void setDeactivationDeadline(float newDeadline)
newDeadline - the desired deadline (in simulated seconds, >0,
default=2)public static void setDeactivationEnabled(boolean newSetting)
newSetting - true to enable deactivation, false to disable it
(default=true)public abstract void setGravity(Vector3f acceleration)
Invoke this method after adding the body to a PhysicsSpace. Adding a body to a PhysicsSpace overrides its gravity.
acceleration - the desired acceleration vector (in physics-space
coordinates, not null, unaffected)public abstract void setMass(float mass)
mass - the desired total mass (≥0)public abstract void setPhysicsLocation(Vector3f location)
location - the desired location (in physics-space coordinates, not
null, unaffected)