Просмотр исходного кода

SDK:
- remove useless synchonized statements from physics

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9488 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

nor..67 13 лет назад
Родитель
Сommit
613d519544

+ 2 - 2
engine/src/bullet/com/jme3/bullet/PhysicsSpace.java

@@ -352,7 +352,7 @@ public class PhysicsSpace {
 
     public void distributeEvents() {
         //add collision callbacks
-        synchronized (collisionEvents) {
+//        synchronized (collisionEvents) {
             for (Iterator<PhysicsCollisionEvent> it = collisionEvents.iterator(); it.hasNext();) {
                 PhysicsCollisionEvent physicsCollisionEvent = it.next();
                 for (PhysicsCollisionListener listener : collisionListeners) {
@@ -362,7 +362,7 @@ public class PhysicsSpace {
                 eventFactory.recycle(physicsCollisionEvent);
                 it.remove();
             }
-        }
+//        }
     }
 
     public static <V> Future<V> enqueueOnThisThread(Callable<V> callable) {

+ 2 - 2
engine/src/bullet/com/jme3/bullet/objects/VehicleWheel.java

@@ -86,7 +86,7 @@ public class VehicleWheel implements Savable {
         this.radius = radius;
     }
 
-    public synchronized void updatePhysicsState() {
+    public void updatePhysicsState() {
         getWheelLocation(wheelId, wheelIndex, wheelWorldLocation);
         getWheelRotation(wheelId, wheelIndex, tmp_Matrix);
         wheelWorldRotation.fromRotationMatrix(tmp_Matrix);
@@ -96,7 +96,7 @@ public class VehicleWheel implements Savable {
 
     private native void getWheelRotation(long vehicleId, int wheelId, Matrix3f location);
 
-    public synchronized void applyWheelTransform() {
+    public void applyWheelTransform() {
         if (wheelSpatial == null) {
             return;
         }

+ 2 - 2
engine/src/bullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java

@@ -65,7 +65,7 @@ public class RigidBodyMotionState {
      * applies the current transform to the given jme Node if the location has been updated on the physics side
      * @param spatial
      */
-    public synchronized boolean applyTransform(Spatial spatial) {
+    public boolean applyTransform(Spatial spatial) {
         Vector3f localLocation = spatial.getLocalTranslation();
         Quaternion localRotationQuat = spatial.getLocalRotation();
         boolean physicsLocationDirty = applyTransform(motionStateId, localLocation, localRotationQuat);
@@ -94,7 +94,7 @@ public class RigidBodyMotionState {
         return true;
     }
 
-    private synchronized native boolean applyTransform(long stateId, Vector3f location, Quaternion rotation);
+    private native boolean applyTransform(long stateId, Vector3f location, Quaternion rotation);
 
     /**
      * @return the worldLocation

+ 2 - 2
engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java

@@ -326,7 +326,7 @@ public class PhysicsSpace {
 
     public void distributeEvents() {
         //add collision callbacks
-        synchronized (collisionEvents) {
+//        synchronized (collisionEvents) {
             for (Iterator<PhysicsCollisionEvent> it = collisionEvents.iterator(); it.hasNext();) {
                 PhysicsCollisionEvent physicsCollisionEvent = it.next();
                 for (PhysicsCollisionListener listener : collisionListeners) {
@@ -336,7 +336,7 @@ public class PhysicsSpace {
                 eventFactory.recycle(physicsCollisionEvent);
                 it.remove();
             }
-        }
+//        }
     }
 
     public static <V> Future<V> enqueueOnThisThread(Callable<V> callable) {

+ 2 - 2
engine/src/jbullet/com/jme3/bullet/objects/VehicleWheel.java

@@ -86,13 +86,13 @@ public class VehicleWheel implements Savable {
         this.radius = radius;
     }
 
-    public synchronized void updatePhysicsState() {
+    public void updatePhysicsState() {
         Converter.convert(wheelInfo.worldTransform.origin, wheelWorldLocation);
         Converter.convert(wheelInfo.worldTransform.basis, tmp_Matrix);
         wheelWorldRotation.fromRotationMatrix(tmp_Matrix);
     }
 
-    public synchronized void applyWheelTransform() {
+    public void applyWheelTransform() {
         if (wheelSpatial == null) {
             return;
         }

+ 3 - 3
engine/src/jbullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java

@@ -71,7 +71,7 @@ public class RigidBodyMotionState extends MotionState {
      * @param t
      * @return
      */
-    public synchronized Transform getWorldTransform(Transform t) {
+    public Transform getWorldTransform(Transform t) {
         t.set(motionStateTrans);
         return t;
     }
@@ -80,7 +80,7 @@ public class RigidBodyMotionState extends MotionState {
      * called from bullet when the transform of the rigidbody changes
      * @param worldTrans
      */
-    public synchronized void setWorldTransform(Transform worldTrans) {
+    public void setWorldTransform(Transform worldTrans) {
         if (jmeLocationDirty) {
             return;
         }
@@ -102,7 +102,7 @@ public class RigidBodyMotionState extends MotionState {
      * applies the current transform to the given jme Node if the location has been updated on the physics side
      * @param spatial
      */
-    public synchronized boolean applyTransform(Spatial spatial) {
+    public boolean applyTransform(Spatial spatial) {
         if (!physicsLocationDirty) {
             return false;
         }