- fix deprecation message and javadoc cleanups in PhysicsSpace

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10345 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 9f7b273517
commit 2f100c79fb
  1. 96
      engine/src/bullet/com/jme3/bullet/PhysicsSpace.java
  2. 6
      engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java

@ -60,6 +60,7 @@ import java.util.logging.Logger;
/**
* <p>PhysicsSpace - The central jbullet-jme physics space</p>
*
* @author normenhansen
*/
public class PhysicsSpace {
@ -71,7 +72,6 @@ public class PhysicsSpace {
private long physicsSpaceId = 0;
private static ThreadLocal<ConcurrentLinkedQueue<AppTask<?>>> pQueueTL =
new ThreadLocal<ConcurrentLinkedQueue<AppTask<?>>>() {
@Override
protected ConcurrentLinkedQueue<AppTask<?>> initialValue() {
return new ConcurrentLinkedQueue<AppTask<?>>();
@ -86,13 +86,11 @@ public class PhysicsSpace {
// private ConstraintSolver solver;
// private DefaultCollisionConfiguration collisionConfiguration;
// private Map<GhostObject, PhysicsGhostObject> physicsGhostNodes = new ConcurrentHashMap<GhostObject, PhysicsGhostObject>();
private Map<Long, PhysicsGhostObject> physicsGhostObjects = new ConcurrentHashMap<Long, PhysicsGhostObject>();
private Map<Long, PhysicsCharacter> physicsCharacters = new ConcurrentHashMap<Long, PhysicsCharacter>();
private Map<Long, PhysicsRigidBody> physicsBodies = new ConcurrentHashMap<Long, PhysicsRigidBody>();
private Map<Long, PhysicsJoint> physicsJoints = new ConcurrentHashMap<Long, PhysicsJoint>();
private Map<Long, PhysicsVehicle> physicsVehicles = new ConcurrentHashMap<Long, PhysicsVehicle>();
private List<PhysicsCollisionListener> collisionListeners = new LinkedList<PhysicsCollisionListener>();
private List<PhysicsCollisionEvent> collisionEvents = new LinkedList<PhysicsCollisionEvent>();
private Map<Integer, PhysicsCollisionGroupListener> collisionGroupListeners = new ConcurrentHashMap<Integer, PhysicsCollisionGroupListener>();
@ -110,8 +108,10 @@ public class PhysicsSpace {
}
/**
* Get the current PhysicsSpace <b>running on this thread</b><br/>
* For parallel physics, this can also be called from the OpenGL thread to receive the PhysicsSpace
* Get the current PhysicsSpace <b>running on this thread</b><br/> For
* parallel physics, this can also be called from the OpenGL thread to
* receive the PhysicsSpace
*
* @return the PhysicsSpace running on this thread
*/
public static PhysicsSpace getPhysicsSpace() {
@ -120,6 +120,7 @@ public class PhysicsSpace {
/**
* Used internally
*
* @param space
*/
public static void setLocalThreadPhysicsSpace(PhysicsSpace space) {
@ -336,6 +337,7 @@ public class PhysicsSpace {
/**
* updates the physics space
*
* @param time the current time value
*/
public void update(float time) {
@ -344,6 +346,7 @@ public class PhysicsSpace {
/**
* updates the physics space, uses maxSteps<br>
*
* @param time the current time value
* @param maxSteps
*/
@ -380,7 +383,9 @@ public class PhysicsSpace {
}
/**
* calls the callable on the next physics tick (ensuring e.g. force applying)
* calls the callable on the next physics tick (ensuring e.g. force
* applying)
*
* @param <V>
* @param callable
* @return Future object
@ -393,6 +398,7 @@ public class PhysicsSpace {
/**
* adds an object to the physics space
*
* @param obj the PhysicsControl or Spatial with PhysicsControl to add
*/
public void add(Object obj) {
@ -425,6 +431,7 @@ public class PhysicsSpace {
/**
* removes an object from the physics space
*
* @param obj the PhysicsControl or Spatial with PhysicsControl to remove
*/
public void remove(Object obj) {
@ -454,8 +461,9 @@ public class PhysicsSpace {
}
/**
* adds all physics controls and joints in the given spatial node to the physics space
* (e.g. after loading from disk) - recursive if node
* adds all physics controls and joints in the given spatial node to the
* physics space (e.g. after loading from disk) - recursive if node
*
* @param spatial the rootnode containing the physics objects
*/
public void addAll(Spatial spatial) {
@ -493,8 +501,9 @@ public class PhysicsSpace {
}
/**
* Removes all physics controls and joints in the given spatial from the physics space
* (e.g. before saving to disk) - recursive if node
* Removes all physics controls and joints in the given spatial from the
* physics space (e.g. before saving to disk) - recursive if node
*
* @param spatial the rootnode containing the physics objects
*/
public void removeAll(Spatial spatial) {
@ -690,6 +699,7 @@ public class PhysicsSpace {
/**
* Sets the gravity of the PhysicsSpace, set before adding physics objects!
*
* @param gravity
*/
public void setGravity(Vector3f gravity) {
@ -714,9 +724,10 @@ public class PhysicsSpace {
// }
//
/**
* Adds the specified listener to the physics tick listeners.
* The listeners are called on each physics step, which is not necessarily
* each frame but is determined by the accuracy of the physics space.
* Adds the specified listener to the physics tick listeners. The listeners
* are called on each physics step, which is not necessarily each frame but
* is determined by the accuracy of the physics space.
*
* @param listener
*/
public void addTickListener(PhysicsTickListener listener) {
@ -729,6 +740,7 @@ public class PhysicsSpace {
/**
* Adds a CollisionListener that will be informed about collision events
*
* @param listener the CollisionListener to add
*/
public void addCollisionListener(PhysicsCollisionListener listener) {
@ -737,6 +749,7 @@ public class PhysicsSpace {
/**
* Removes a CollisionListener from the list
*
* @param listener the CollisionListener to remove
*/
public void removeCollisionListener(PhysicsCollisionListener listener) {
@ -744,8 +757,10 @@ public class PhysicsSpace {
}
/**
* Adds a listener for a specific collision group, such a listener can disable collisions when they happen.<br>
* There can be only one listener per collision group.
* Adds a listener for a specific collision group, such a listener can
* disable collisions when they happen.<br> There can be only one listener
* per collision group.
*
* @param listener
* @param collisionGroup
*/
@ -758,7 +773,8 @@ public class PhysicsSpace {
}
/**
* Performs a ray collision test and returns the results as a list of PhysicsRayTestResults
* Performs a ray collision test and returns the results as a list of
* PhysicsRayTestResults
*/
public List rayTest(Vector3f from, Vector3f to) {
List results = new LinkedList();
@ -767,7 +783,8 @@ public class PhysicsSpace {
}
/**
* Performs a ray collision test and returns the results as a list of PhysicsRayTestResults
* Performs a ray collision test and returns the results as a list of
* PhysicsRayTestResults
*/
public List<PhysicsRayTestResult> rayTest(Vector3f from, Vector3f to, List<PhysicsRayTestResult> results) {
results.clear();
@ -793,9 +810,11 @@ public class PhysicsSpace {
// }
// }
/**
* Performs a sweep collision test and returns the results as a list of PhysicsSweepTestResults<br/>
* You have to use different Transforms for start and end (at least distance > 0.4f).
* SweepTest will not see a collision if it starts INSIDE an object and is moving AWAY from its center.
* Performs a sweep collision test and returns the results as a list of
* PhysicsSweepTestResults<br/> You have to use different Transforms for
* start and end (at least distance > 0.4f). SweepTest will not see a
* collision if it starts INSIDE an object and is moving AWAY from its
* center.
*/
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end) {
List<PhysicsSweepTestResult> results = new LinkedList<PhysicsSweepTestResult>();
@ -809,9 +828,11 @@ public class PhysicsSpace {
}
/**
* Performs a sweep collision test and returns the results as a list of PhysicsSweepTestResults<br/>
* You have to use different Transforms for start and end (at least distance > 0.4f).
* SweepTest will not see a collision if it starts INSIDE an object and is moving AWAY from its center.
* Performs a sweep collision test and returns the results as a list of
* PhysicsSweepTestResults<br/> You have to use different Transforms for
* start and end (at least distance > 0.4f). SweepTest will not see a
* collision if it starts INSIDE an object and is moving AWAY from its
* center.
*/
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results) {
results.clear();
@ -850,9 +871,10 @@ public class PhysicsSpace {
}
/**
// * used internally
// * @return the dynamicsWorld
// */
* // * used internally //
*
* @return the dynamicsWorld //
*/
public long getSpaceId() {
return physicsSpaceId;
}
@ -866,11 +888,13 @@ public class PhysicsSpace {
}
/**
* Sets the maximum amount of extra steps that will be used to step the physics
* when the fps is below the physics fps. Doing this maintains determinism in physics.
* For example a maximum number of 2 can compensate for framerates as low as 30fps
* when the physics has the default accuracy of 60 fps. Note that setting this
* value too high can make the physics drive down its own fps in case its overloaded.
* Sets the maximum amount of extra steps that will be used to step the
* physics when the fps is below the physics fps. Doing this maintains
* determinism in physics. For example a maximum number of 2 can compensate
* for framerates as low as 30fps when the physics has the default accuracy
* of 60 fps. Note that setting this value too high can make the physics
* drive down its own fps in case its overloaded.
*
* @param steps The maximum number of extra steps, default is 4.
*/
public void setMaxSubSteps(int steps) {
@ -879,6 +903,7 @@ public class PhysicsSpace {
/**
* get the current accuracy of the physics computation
*
* @return the current accuracy
*/
public float getAccuracy() {
@ -887,6 +912,7 @@ public class PhysicsSpace {
/**
* sets the accuracy of the physics computation, default=1/60s<br>
*
* @param accuracy
*/
public void setAccuracy(float accuracy) {
@ -899,6 +925,7 @@ public class PhysicsSpace {
/**
* only applies for AXIS_SWEEP broadphase
*
* @param worldMin
*/
public void setWorldMin(Vector3f worldMin) {
@ -911,6 +938,7 @@ public class PhysicsSpace {
/**
* only applies for AXIS_SWEEP broadphase
*
* @param worldMax
*/
public void setWorldMax(Vector3f worldMax) {
@ -918,9 +946,11 @@ public class PhysicsSpace {
}
/**
* Enable debug display for physics
* Enable debug display for physics.
*
* @deprecated in favor of BulletDebugAppState, use
* <code>BulletAppState.setDebugEnabled(boolean)</code> to add automatically
* @param manager AssetManager to use to create debug materials
* @Deprecated in favor of BulletDebugAppState, use BulletAppState.setDebugEnabled(boolean) to add automatically
*/
@Deprecated
public void enableDebug(AssetManager manager) {

@ -857,9 +857,11 @@ public class PhysicsSpace {
}
/**
* Enable debug display for physics
* Enable debug display for physics.
*
* @deprecated in favor of BulletDebugAppState, use
* <code>BulletAppState.setDebugEnabled(boolean)</code> to add automatically
* @param manager AssetManager to use to create debug materials
* @Deprecated in favor of BulletDebugAppState, use BulletAppState.setDebugEnabled(boolean) to add automatically
*/
@Deprecated
public void enableDebug(AssetManager manager) {

Loading…
Cancel
Save