Package com.jme3.bullet
Class MultiBodySpace
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.CollisionSpace
com.jme3.bullet.PhysicsSpace
com.jme3.bullet.MultiBodySpace
- All Implemented Interfaces:
ContactListener,Comparable<NativePhysicsObject>
- Direct Known Subclasses:
DeformableSpace
A PhysicsSpace that supports multibodies, with its own
btMultiBodyDynamicsWorld.-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.bullet.PhysicsSpace
PhysicsSpace.BroadphaseType -
Field Summary
FieldsFields inherited from class com.jme3.bullet.PhysicsSpace
AXIS_X, AXIS_Y, AXIS_Z, loggerFields inherited from class com.jme3.bullet.CollisionSpace
loggerCFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Constructor Summary
ConstructorsConstructorDescriptionMultiBodySpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType) Instantiate a MultiBodySpace with a sequential-impulse solver.MultiBodySpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType, SolverType solverType) Instantiate a MultiBodySpace with the specified contact-and-constraint solver. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateAll(boolean forceFlag) Activate all colliders and rigid bodies in this space.voidAdd the specified object to this space.voidaddMultiBody(MultiBody multiBody) Add the specified MultiBody and all its colliders.booleanTest whether the specified collision object is added to this space.intCount the multibodies in this space.protected voidcreate()Must be invoked on the designated physics thread.voiddestroy()Remove all multibodies, collision objects, and physics joints.Enumerate multibodies that have been added to this space and not yet removed.static MultiBodySpaceAccess the MultiBodySpace running on this thread.Enumerate collision objects that have been added to this space and not yet removed.booleanisEmpty()Test whether this space is empty.voidRemove the specified object from this space.voidremoveMultiBody(MultiBody multiBody) Remove the specified MultiBody and all its colliders.protected voidReplace the existing contact-and-constraint solver with a new one of the correct type.Methods inherited from class com.jme3.bullet.PhysicsSpace
addCollisionObject, addJoint, addTickListener, contains, countJoints, countManifolds, countRigidBodies, countTickListeners, getAccuracy, getCharacterList, getGravity, getJointList, getJointMap, getPhysicsSpace, getRigidBodyList, getSolverInfo, getSolverType, getVehicleList, getWorldType, initSolverInfo, isCcdWithStaticOnly, isUsingScr, listManifoldIds, maxSubSteps, maxTimeStep, onContactEnded, onContactProcessed, onContactStarted, removeCollisionObject, removeJoint, removeTickListener, setAccuracy, setCcdWithStaticOnly, setGravity, setMaxSubSteps, setMaxTimeStep, update, update, update, useScrMethods inherited from class com.jme3.bullet.CollisionSpace
contactTest, countCollisionObjects, countSolvers, getBroadphaseType, getCollisionSpace, getConfiguration, getGhostObjectList, getRayTestFlags, getWorldMax, getWorldMin, hasClosest, hasContact, initThread, isForceUpdateAllAabbs, isUsingDeterministicDispatch, jniEnvId, needsCollision, pairTest, rayTest, rayTest, rayTestDp, rayTestRaw, rayTestRaw, setForceUpdateAllAabbs, setLocalThreadPhysicsSpace, setRayTestFlags, sweepTest, useDeterministicDispatchMethods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObject
-
Field Details
-
logger2
message logger for this class
-
-
Constructor Details
-
MultiBodySpace
public MultiBodySpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType) Instantiate a MultiBodySpace with a sequential-impulse solver. Must be invoked on the designated physics thread.- Parameters:
worldMin- the desired minimum coordinate values (not null, unaffected, default=(-10k,-10k,-10k))worldMax- the desired maximum coordinate values (not null, unaffected, default=(10k,10k,10k))broadphaseType- which broadphase accelerator to use (not null)
-
MultiBodySpace
public MultiBodySpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType, SolverType solverType) Instantiate a MultiBodySpace with the specified contact-and-constraint solver. Must be invoked on the designated physics thread.- Parameters:
worldMin- the desired minimum coordinate value for each axis (not null, unaffected, default=(-10k,-10k,-10k))worldMax- the desired maximum coordinate value for each axis (not null, unaffected, default=(10k,10k,10k))broadphaseType- which broadphase accelerator to use (not null)solverType- the desired constraint solver (not null)
-
-
Method Details
-
addMultiBody
Add the specified MultiBody and all its colliders.- Parameters:
multiBody- (not null)
-
countMultiBodies
public int countMultiBodies()Count the multibodies in this space.- Returns:
- the count (≥0)
-
getMultiBodyList
Enumerate multibodies that have been added to this space and not yet removed.- Returns:
- a new unmodifiable collection of pre-existing instances (not null)
-
getMultiBodySpace
Access the MultiBodySpace running on this thread. For parallel physics, this may be invoked from the OpenGL thread.- Returns:
- the pre-existing MultiBodySpace running on this thread
-
removeMultiBody
Remove the specified MultiBody and all its colliders.- Parameters:
multiBody- (not null)
-
activateAll
public void activateAll(boolean forceFlag) Activate all colliders and rigid bodies in this space.- Overrides:
activateAllin classPhysicsSpace- Parameters:
forceFlag- true to force activation
-
add
Add the specified object to this space.- Overrides:
addin classPhysicsSpace- Parameters:
object- the object to add (not null)
-
contains
Test whether the specified collision object is added to this space.- Overrides:
containsin classPhysicsSpace- Parameters:
pco- the object to test (not null, unaffected)- Returns:
- true if currently added, otherwise false
-
create
protected void create()Must be invoked on the designated physics thread.- Overrides:
createin classPhysicsSpace
-
destroy
public void destroy()Remove all multibodies, collision objects, and physics joints.- Overrides:
destroyin classPhysicsSpace
-
getPcoList
Enumerate collision objects that have been added to this space and not yet removed.- Overrides:
getPcoListin classPhysicsSpace- Returns:
- a new modifiable collection of pre-existing instances (not null)
-
isEmpty
public boolean isEmpty()Test whether this space is empty.- Overrides:
isEmptyin classPhysicsSpace- Returns:
- true if empty, otherwise false
-
remove
Remove the specified object from this space.- Overrides:
removein classPhysicsSpace- Parameters:
object- the object to remove, or null
-
updateSolver
protected void updateSolver()Replace the existing contact-and-constraint solver with a new one of the correct type.- Overrides:
updateSolverin classPhysicsSpace
-