|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.bullet.PhysicsSpace
public class PhysicsSpace
PhysicsSpace - The central jbullet-jme physics space
Nested Class Summary | |
---|---|
static class |
PhysicsSpace.BroadphaseType
interface with Broadphase types |
Field Summary | |
---|---|
static int |
AXIS_X
|
static int |
AXIS_Y
|
static int |
AXIS_Z
|
Constructor Summary | |
---|---|
PhysicsSpace()
|
|
PhysicsSpace(PhysicsSpace.BroadphaseType broadphaseType)
|
|
PhysicsSpace(Vector3f worldMin,
Vector3f worldMax)
|
|
PhysicsSpace(Vector3f worldMin,
Vector3f worldMax,
PhysicsSpace.BroadphaseType broadphaseType)
|
Method Summary | ||
---|---|---|
void |
add(java.lang.Object obj)
adds an object to the physics space |
|
void |
addAll(Spatial spatial)
adds all physics controls and joints in the given spatial node to the physics space (e.g. |
|
void |
addCollisionGroupListener(PhysicsCollisionGroupListener listener,
int collisionGroup)
Adds a listener for a specific collision group, such a listener can disable collisions when they happen. There can be only one listener per collision group. |
|
void |
addCollisionListener(PhysicsCollisionListener listener)
Adds a CollisionListener that will be informed about collision events |
|
void |
addCollisionObject(PhysicsCollisionObject obj)
|
|
void |
addTickListener(PhysicsTickListener listener)
Adds the specified listener to the physics tick listeners. |
|
void |
create()
Has to be called from the (designated) physics thread |
|
void |
destroy()
destroys the current PhysicsSpace so that a new one can be created |
|
void |
disableDebug()
Disable debug display |
|
void |
distributeEvents()
|
|
void |
enableDebug(AssetManager manager)
Enable debug display for physics |
|
|
enqueue(java.util.concurrent.Callable<V> callable)
calls the callable on the next physics tick (ensuring e.g. |
|
static
|
enqueueOnThisThread(java.util.concurrent.Callable<V> callable)
|
|
protected void |
finalize()
|
|
float |
getAccuracy()
get the current accuracy of the physics computation |
|
PhysicsSpace.BroadphaseType |
getBroadphaseType()
|
|
AssetManager |
getDebugManager()
|
|
static PhysicsSpace |
getPhysicsSpace()
Get the current PhysicsSpace running on this thread For parallel physics, this can also be called from the OpenGL thread to receive the PhysicsSpace |
|
long |
getSpaceId()
// * used internally // * @return the dynamicsWorld // |
|
Vector3f |
getWorldMax()
|
|
Vector3f |
getWorldMin()
|
|
static void |
initNativePhysics()
|
|
void |
rayTest_native(Vector3f from,
Vector3f to,
long physicsSpaceId,
java.util.List<PhysicsRayTestResult> results)
|
|
java.util.List |
rayTest(Vector3f from,
Vector3f to)
Performs a ray collision test and returns the results as a list of PhysicsRayTestResults |
|
java.util.List<PhysicsRayTestResult> |
rayTest(Vector3f from,
Vector3f to,
java.util.List<PhysicsRayTestResult> results)
Performs a ray collision test and returns the results as a list of PhysicsRayTestResults |
|
void |
remove(java.lang.Object obj)
removes an object from the physics space |
|
void |
removeAll(Spatial spatial)
Removes all physics controls and joints in the given spatial from the physics space (e.g. |
|
void |
removeCollisionGroupListener(int collisionGroup)
|
|
void |
removeCollisionListener(PhysicsCollisionListener listener)
Removes a CollisionListener from the list |
|
void |
removeCollisionObject(PhysicsCollisionObject obj)
|
|
void |
removeTickListener(PhysicsTickListener listener)
|
|
void |
setAccuracy(float accuracy)
sets the accuracy of the physics computation, default=1/60s |
|
void |
setBroadphaseType(PhysicsSpace.BroadphaseType broadphaseType)
|
|
void |
setGravity(Vector3f gravity)
Sets the gravity of the PhysicsSpace, set before adding physics objects! |
|
static void |
setLocalThreadPhysicsSpace(PhysicsSpace space)
Used internally |
|
void |
setMaxSubSteps(int steps)
Sets the maximum amount of extra steps that will be used to step the physics when the fps is below the physics fps. |
|
void |
setWorldMax(Vector3f worldMax)
only applies for AXIS_SWEEP broadphase |
|
void |
setWorldMin(Vector3f worldMin)
only applies for AXIS_SWEEP broadphase |
|
java.util.List<PhysicsSweepTestResult> |
sweepTest(CollisionShape shape,
Transform start,
Transform end)
Performs a sweep collision test and returns the results as a list of PhysicsSweepTestResults You have to use different Transforms for start and end (at least distance > 0.4f). |
|
java.util.List<PhysicsSweepTestResult> |
sweepTest(CollisionShape shape,
Transform start,
Transform end,
java.util.List<PhysicsSweepTestResult> results)
Performs a sweep collision test and returns the results as a list of PhysicsSweepTestResults You have to use different Transforms for start and end (at least distance > 0.4f). |
|
void |
update(float time)
updates the physics space |
|
void |
update(float time,
int maxSteps)
updates the physics space, uses maxSteps |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AXIS_X
public static final int AXIS_Y
public static final int AXIS_Z
Constructor Detail |
---|
public PhysicsSpace()
public PhysicsSpace(PhysicsSpace.BroadphaseType broadphaseType)
public PhysicsSpace(Vector3f worldMin, Vector3f worldMax)
public PhysicsSpace(Vector3f worldMin, Vector3f worldMax, PhysicsSpace.BroadphaseType broadphaseType)
Method Detail |
---|
public static PhysicsSpace getPhysicsSpace()
public static void setLocalThreadPhysicsSpace(PhysicsSpace space)
space
- public void create()
public void update(float time)
time
- the current time valuepublic void update(float time, int maxSteps)
time
- the current time valuemaxSteps
- public void distributeEvents()
public static <V> java.util.concurrent.Future<V> enqueueOnThisThread(java.util.concurrent.Callable<V> callable)
public <V> java.util.concurrent.Future<V> enqueue(java.util.concurrent.Callable<V> callable)
V
- callable
-
public void add(java.lang.Object obj)
obj
- the PhysicsControl or Spatial with PhysicsControl to addpublic void addCollisionObject(PhysicsCollisionObject obj)
public void remove(java.lang.Object obj)
obj
- the PhysicsControl or Spatial with PhysicsControl to removepublic void removeCollisionObject(PhysicsCollisionObject obj)
public void addAll(Spatial spatial)
spatial
- the rootnode containing the physics objectspublic void removeAll(Spatial spatial)
spatial
- the rootnode containing the physics objectspublic void setGravity(Vector3f gravity)
gravity
- public void addTickListener(PhysicsTickListener listener)
listener
- public void removeTickListener(PhysicsTickListener listener)
public void addCollisionListener(PhysicsCollisionListener listener)
listener
- the CollisionListener to addpublic void removeCollisionListener(PhysicsCollisionListener listener)
listener
- the CollisionListener to removepublic void addCollisionGroupListener(PhysicsCollisionGroupListener listener, int collisionGroup)
listener
- collisionGroup
- public void removeCollisionGroupListener(int collisionGroup)
public java.util.List rayTest(Vector3f from, Vector3f to)
public java.util.List<PhysicsRayTestResult> rayTest(Vector3f from, Vector3f to, java.util.List<PhysicsRayTestResult> results)
public void rayTest_native(Vector3f from, Vector3f to, long physicsSpaceId, java.util.List<PhysicsRayTestResult> results)
public java.util.List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end)
public java.util.List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, java.util.List<PhysicsSweepTestResult> results)
public void destroy()
public long getSpaceId()
public PhysicsSpace.BroadphaseType getBroadphaseType()
public void setBroadphaseType(PhysicsSpace.BroadphaseType broadphaseType)
public void setMaxSubSteps(int steps)
steps
- The maximum number of extra steps, default is 4.public float getAccuracy()
public void setAccuracy(float accuracy)
accuracy
- public Vector3f getWorldMin()
public void setWorldMin(Vector3f worldMin)
worldMin
- public Vector3f getWorldMax()
public void setWorldMax(Vector3f worldMax)
worldMax
- public void enableDebug(AssetManager manager)
manager
- AssetManager to use to create debug materialspublic void disableDebug()
public AssetManager getDebugManager()
public static void initNativePhysics()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |