From 613d519544e88ed60fd7cdfe420162b8ba84f985 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Wed, 13 Jun 2012 20:55:07 +0000 Subject: [PATCH] SDK: - remove useless synchonized statements from physics git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9488 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/bullet/com/jme3/bullet/PhysicsSpace.java | 4 ++-- engine/src/bullet/com/jme3/bullet/objects/VehicleWheel.java | 4 ++-- .../com/jme3/bullet/objects/infos/RigidBodyMotionState.java | 4 ++-- engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java | 4 ++-- .../src/jbullet/com/jme3/bullet/objects/VehicleWheel.java | 4 ++-- .../com/jme3/bullet/objects/infos/RigidBodyMotionState.java | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java b/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java index d98135c90..6d7edf28f 100644 --- a/engine/src/bullet/com/jme3/bullet/PhysicsSpace.java +++ b/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 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 Future enqueueOnThisThread(Callable callable) { diff --git a/engine/src/bullet/com/jme3/bullet/objects/VehicleWheel.java b/engine/src/bullet/com/jme3/bullet/objects/VehicleWheel.java index 11eab6054..2c8542e4b 100644 --- a/engine/src/bullet/com/jme3/bullet/objects/VehicleWheel.java +++ b/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; } diff --git a/engine/src/bullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java b/engine/src/bullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java index c60d6c51e..51152fdbb 100644 --- a/engine/src/bullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java +++ b/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 diff --git a/engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java b/engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java index c1c7e6703..3d10edb87 100644 --- a/engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java +++ b/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 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 Future enqueueOnThisThread(Callable callable) { diff --git a/engine/src/jbullet/com/jme3/bullet/objects/VehicleWheel.java b/engine/src/jbullet/com/jme3/bullet/objects/VehicleWheel.java index 7ac6bb022..0ddbbb852 100644 --- a/engine/src/jbullet/com/jme3/bullet/objects/VehicleWheel.java +++ b/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; } diff --git a/engine/src/jbullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java b/engine/src/jbullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java index 8dd46bb16..2edd05fa6 100644 --- a/engine/src/jbullet/com/jme3/bullet/objects/infos/RigidBodyMotionState.java +++ b/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; }