Bullet (and jBullet): Remove deprecated PhysicsSpace.enableDebug method in favor of BulletAppState.setDebugEnabled.
This commit is contained in:
parent
116adbba1f
commit
70b03ea28a
@ -166,7 +166,7 @@ public class BulletAppState implements AppState, PhysicsTickListener {
|
|||||||
pSpace.addTickListener(this);
|
pSpace.addTickListener(this);
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopPhysics() {
|
public void stopPhysics() {
|
||||||
if(!initialized){
|
if(!initialized){
|
||||||
return;
|
return;
|
||||||
@ -226,19 +226,9 @@ public class BulletAppState implements AppState, PhysicsTickListener {
|
|||||||
if (debugEnabled && debugAppState == null && pSpace != null) {
|
if (debugEnabled && debugAppState == null && pSpace != null) {
|
||||||
debugAppState = new BulletDebugAppState(pSpace);
|
debugAppState = new BulletDebugAppState(pSpace);
|
||||||
stateManager.attach(debugAppState);
|
stateManager.attach(debugAppState);
|
||||||
pSpace.enableDebug(app.getAssetManager());
|
|
||||||
} else if (!debugEnabled && debugAppState != null) {
|
} else if (!debugEnabled && debugAppState != null) {
|
||||||
stateManager.detach(debugAppState);
|
stateManager.detach(debugAppState);
|
||||||
debugAppState = null;
|
debugAppState = null;
|
||||||
if (pSpace != null) {
|
|
||||||
pSpace.enableDebug(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//TODO: remove when deprecation of PhysicsSpace.enableDebug is through
|
|
||||||
if (pSpace.getDebugManager() != null && !debugEnabled) {
|
|
||||||
debugEnabled = true;
|
|
||||||
} else if (pSpace.getDebugManager() == null && debugEnabled) {
|
|
||||||
debugEnabled = false;
|
|
||||||
}
|
}
|
||||||
if (!active) {
|
if (!active) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -102,7 +102,6 @@ public class PhysicsSpace {
|
|||||||
private Vector3f worldMax = new Vector3f(10000f, 10000f, 10000f);
|
private Vector3f worldMax = new Vector3f(10000f, 10000f, 10000f);
|
||||||
private float accuracy = 1f / 60f;
|
private float accuracy = 1f / 60f;
|
||||||
private int maxSubSteps = 4, rayTestFlags = 1 << 2;
|
private int maxSubSteps = 4, rayTestFlags = 1 << 2;
|
||||||
private AssetManager debugManager;
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// System.loadLibrary("bulletjme");
|
// System.loadLibrary("bulletjme");
|
||||||
@ -702,7 +701,7 @@ public class PhysicsSpace {
|
|||||||
public Vector3f getGravity(Vector3f gravity) {
|
public Vector3f getGravity(Vector3f gravity) {
|
||||||
return gravity.set(this.gravity);
|
return gravity.set(this.gravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * applies gravity value to all objects
|
// * applies gravity value to all objects
|
||||||
// */
|
// */
|
||||||
@ -783,7 +782,7 @@ public class PhysicsSpace {
|
|||||||
public void SetRayTestFlags(int flags) {
|
public void SetRayTestFlags(int flags) {
|
||||||
rayTestFlags = flags;
|
rayTestFlags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets m_flags for raytest, see https://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
|
* Gets m_flags for raytest, see https://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
|
||||||
* for possible options.
|
* for possible options.
|
||||||
@ -792,7 +791,7 @@ public class PhysicsSpace {
|
|||||||
public int GetRayTestFlags() {
|
public int GetRayTestFlags() {
|
||||||
return rayTestFlags;
|
return rayTestFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a ray collision test and returns the results as a list of
|
* Performs a ray collision test and returns the results as a list of
|
||||||
* PhysicsRayTestResults
|
* PhysicsRayTestResults
|
||||||
@ -837,7 +836,7 @@ public class PhysicsSpace {
|
|||||||
return (List<PhysicsSweepTestResult>) results;
|
return (List<PhysicsSweepTestResult>) results;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results) {
|
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results) {
|
||||||
return sweepTest(shape, start, end, results, 0.0f);
|
return sweepTest(shape, start, end, results, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -849,7 +848,7 @@ public class PhysicsSpace {
|
|||||||
* collision if it starts INSIDE an object and is moving AWAY from its
|
* collision if it starts INSIDE an object and is moving AWAY from its
|
||||||
* center.
|
* center.
|
||||||
*/
|
*/
|
||||||
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results, float allowedCcdPenetration ) {
|
public List<PhysicsSweepTestResult> sweepTest(CollisionShape shape, Transform start, Transform end, List<PhysicsSweepTestResult> results, float allowedCcdPenetration ) {
|
||||||
results.clear();
|
results.clear();
|
||||||
sweepTest_native(shape.getObjectId(), start, end, physicsSpaceId, results, allowedCcdPenetration);
|
sweepTest_native(shape.getObjectId(), start, end, physicsSpaceId, results, allowedCcdPenetration);
|
||||||
return results;
|
return results;
|
||||||
@ -872,7 +871,7 @@ public class PhysicsSpace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* destroys the current PhysicsSpace so that a new one can be created
|
* destroys the current PhysicsSpace so that a new one can be created
|
||||||
*/
|
*/
|
||||||
@ -959,29 +958,6 @@ public class PhysicsSpace {
|
|||||||
this.worldMax.set(worldMax);
|
this.worldMax.set(worldMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
public void enableDebug(AssetManager manager) {
|
|
||||||
debugManager = manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Disable debug display
|
|
||||||
*/
|
|
||||||
public void disableDebug() {
|
|
||||||
debugManager = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AssetManager getDebugManager() {
|
|
||||||
return debugManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static native void initNativePhysics();
|
public static native void initNativePhysics();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -142,7 +142,6 @@ public class PhysicsSpace {
|
|||||||
private javax.vecmath.Vector3f rayVec2 = new javax.vecmath.Vector3f();
|
private javax.vecmath.Vector3f rayVec2 = new javax.vecmath.Vector3f();
|
||||||
private com.bulletphysics.linearmath.Transform sweepTrans1 = new com.bulletphysics.linearmath.Transform(new javax.vecmath.Matrix3f());
|
private com.bulletphysics.linearmath.Transform sweepTrans1 = new com.bulletphysics.linearmath.Transform(new javax.vecmath.Matrix3f());
|
||||||
private com.bulletphysics.linearmath.Transform sweepTrans2 = new com.bulletphysics.linearmath.Transform(new javax.vecmath.Matrix3f());
|
private com.bulletphysics.linearmath.Transform sweepTrans2 = new com.bulletphysics.linearmath.Transform(new javax.vecmath.Matrix3f());
|
||||||
private AssetManager debugManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current PhysicsSpace <b>running on this thread</b><br/>
|
* Get the current PhysicsSpace <b>running on this thread</b><br/>
|
||||||
@ -362,7 +361,7 @@ public class PhysicsSpace {
|
|||||||
eventFactory.recycle(physicsCollisionEvent);
|
eventFactory.recycle(physicsCollisionEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <V> Future<V> enqueueOnThisThread(Callable<V> callable) {
|
public static <V> Future<V> enqueueOnThisThread(Callable<V> callable) {
|
||||||
AppTask<V> task = new AppTask<V>(callable);
|
AppTask<V> task = new AppTask<V>(callable);
|
||||||
System.out.println("created apptask");
|
System.out.println("created apptask");
|
||||||
@ -620,7 +619,7 @@ public class PhysicsSpace {
|
|||||||
physicsJoints.remove(joint.getObjectId());
|
physicsJoints.remove(joint.getObjectId());
|
||||||
dynamicsWorld.removeConstraint(joint.getObjectId());
|
dynamicsWorld.removeConstraint(joint.getObjectId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<PhysicsRigidBody> getRigidBodyList(){
|
public Collection<PhysicsRigidBody> getRigidBodyList(){
|
||||||
return new LinkedList<PhysicsRigidBody>(physicsBodies.values());
|
return new LinkedList<PhysicsRigidBody>(physicsBodies.values());
|
||||||
}
|
}
|
||||||
@ -628,19 +627,19 @@ public class PhysicsSpace {
|
|||||||
public Collection<PhysicsGhostObject> getGhostObjectList(){
|
public Collection<PhysicsGhostObject> getGhostObjectList(){
|
||||||
return new LinkedList<PhysicsGhostObject>(physicsGhostObjects.values());
|
return new LinkedList<PhysicsGhostObject>(physicsGhostObjects.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<PhysicsCharacter> getCharacterList(){
|
public Collection<PhysicsCharacter> getCharacterList(){
|
||||||
return new LinkedList<PhysicsCharacter>(physicsCharacters.values());
|
return new LinkedList<PhysicsCharacter>(physicsCharacters.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<PhysicsJoint> getJointList(){
|
public Collection<PhysicsJoint> getJointList(){
|
||||||
return new LinkedList<PhysicsJoint>(physicsJoints.values());
|
return new LinkedList<PhysicsJoint>(physicsJoints.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<PhysicsVehicle> getVehicleList(){
|
public Collection<PhysicsVehicle> getVehicleList(){
|
||||||
return new LinkedList<PhysicsVehicle>(physicsVehicles.values());
|
return new LinkedList<PhysicsVehicle>(physicsVehicles.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the gravity of the PhysicsSpace, set before adding physics objects!
|
* Sets the gravity of the PhysicsSpace, set before adding physics objects!
|
||||||
* @param gravity
|
* @param gravity
|
||||||
@ -658,7 +657,7 @@ public class PhysicsSpace {
|
|||||||
dynamicsWorld.getGravity(tempVec);
|
dynamicsWorld.getGravity(tempVec);
|
||||||
return Converter.convert(tempVec, gravity);
|
return Converter.convert(tempVec, gravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* applies gravity value to all objects
|
* applies gravity value to all objects
|
||||||
*/
|
*/
|
||||||
@ -877,29 +876,6 @@ public class PhysicsSpace {
|
|||||||
this.worldMax.set(worldMax);
|
this.worldMax.set(worldMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
public void enableDebug(AssetManager manager) {
|
|
||||||
debugManager = manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Disable debug display
|
|
||||||
*/
|
|
||||||
public void disableDebug() {
|
|
||||||
debugManager = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AssetManager getDebugManager() {
|
|
||||||
return debugManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* interface with Broadphase types
|
* interface with Broadphase types
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user