Package com.jme3.bullet
Class DeformableSpace
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.CollisionSpace
com.jme3.bullet.PhysicsSpace
com.jme3.bullet.MultiBodySpace
com.jme3.bullet.DeformableSpace
- All Implemented Interfaces:
ContactListener,Comparable<NativePhysicsObject>
A MultiBodySpace that supports deformables, with its own
btDeformableMultiBodyDynamicsWorld.-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.bullet.PhysicsSpace
PhysicsSpace.BroadphaseType -
Field Summary
FieldsFields inherited from class com.jme3.bullet.MultiBodySpace
logger2Fields 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
ConstructorsConstructorDescriptionDeformableSpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType, SolverType solverType) Instantiate a DeformableSpace with the specified contact-and-constraint solver. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the specified collision object to this space.booleanTest whether the specified collision object is added to this space.intCount the joints in this space, including anchors and soft-body joints.intCount the soft bodies in this space.protected voidcreate()Must be invoked on the designated physics thread.voiddestroy()Remove all collision objects and physics joints.static DeformableSpaceAccess the DeformableSpace running on this thread.Enumerate collision objects that have been added to this space and not yet removed.Enumerate soft bodies that have been added to this space and not yet removed.Access the parameters applied when soft bodies are added to this space.booleanisEmpty()Test whether this space is empty.voidRemove the specified collision object from this space.voidsetGravity(Vector3f gravity) Alter the gravitational acceleration acting on newly-added bodies.Methods inherited from class com.jme3.bullet.MultiBodySpace
activateAll, add, addMultiBody, countMultiBodies, getMultiBodyList, getMultiBodySpace, remove, removeMultiBody, updateSolverMethods inherited from class com.jme3.bullet.PhysicsSpace
addJoint, addTickListener, contains, countManifolds, countRigidBodies, countTickListeners, getAccuracy, getCharacterList, getGravity, getJointList, getJointMap, getPhysicsSpace, getRigidBodyList, getSolverInfo, getSolverType, getVehicleList, getWorldType, initSolverInfo, isCcdWithStaticOnly, isUsingScr, listManifoldIds, maxSubSteps, maxTimeStep, onContactEnded, onContactProcessed, onContactStarted, removeJoint, removeTickListener, setAccuracy, setCcdWithStaticOnly, 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
-
logger3
message logger for this class
-
-
Constructor Details
-
DeformableSpace
public DeformableSpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType, SolverType solverType) Instantiate a DeformableSpace 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
-
countSoftBodies
public int countSoftBodies()Count the soft bodies in this space.- Returns:
- the count (≥0)
-
getDeformableSpace
Access the DeformableSpace running on this thread. For parallel physics, this may be invoked from the OpenGL thread.- Returns:
- the pre-existing DeformableSpace running on this thread
-
getSoftBodyList
Enumerate soft bodies that have been added to this space and not yet removed.- Returns:
- a new unmodifiable collection of pre-existing instances (not null)
-
getWorldInfo
Access the parameters applied when soft bodies are added to this space.- Returns:
- the pre-existing instance (not null)
-
addCollisionObject
Add the specified collision object to this space.- Overrides:
addCollisionObjectin classPhysicsSpace- Parameters:
pco- the collision object to add (not null)
-
contains
Test whether the specified collision object is added to this space.- Overrides:
containsin classMultiBodySpace- Parameters:
pco- the object to test (not null, unaffected)- Returns:
- true if currently added, otherwise false
-
countJoints
public int countJoints()Count the joints in this space, including anchors and soft-body joints.- Overrides:
countJointsin classPhysicsSpace- Returns:
- the count (≥0)
-
create
protected void create()Must be invoked on the designated physics thread.- Overrides:
createin classMultiBodySpace
-
destroy
public void destroy()Remove all collision objects and physics joints.- Overrides:
destroyin classMultiBodySpace
-
getPcoList
Enumerate collision objects that have been added to this space and not yet removed.- Overrides:
getPcoListin classMultiBodySpace- Returns:
- a new modifiable collection of pre-existing instances (not null)
-
isEmpty
public boolean isEmpty()Test whether this space is empty.- Overrides:
isEmptyin classMultiBodySpace- Returns:
- true if empty, otherwise false
-
removeCollisionObject
Remove the specified collision object from this space.- Overrides:
removeCollisionObjectin classPhysicsSpace- Parameters:
pco- the collision object to remove (not null)
-
setGravity
Alter the gravitational acceleration acting on newly-added bodies.Typically, when a body is added to a space, the body's gravity gets set to that of the space. Thus, it is preferable to set the space's gravity before adding any bodies to the space.
- Overrides:
setGravityin classPhysicsSpace- Parameters:
gravity- the desired acceleration vector (not null, unaffected, default=(0,-9.81,0))
-