summaryrefslogtreecommitdiff
path: root/servers/physics
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-16 17:54:36 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-16 17:54:36 -0300
commitbbe9a37f1d0bae1b26b9f53b216c29d16e76b039 (patch)
treed625c1a816767dc63f754dd681e5ba5e9b69ff16 /servers/physics
parent8482611f8163506aba02a4556715cebbd922cf77 (diff)
sleeping property now should work properly, fixes #1892
Diffstat (limited to 'servers/physics')
-rw-r--r--servers/physics/body_sw.cpp2
-rw-r--r--servers/physics/body_sw.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index 43c20d211f..1cc0b763a4 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -257,6 +257,8 @@ void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant& p_varian
Transform t = p_variant;
t.orthonormalize();
new_transform=get_transform(); //used as old to compute motion
+ if (new_transform==t)
+ break;
_set_transform(t);
_set_inv_transform(get_transform().inverse());
diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h
index f15fd9b831..6491ba8f18 100644
--- a/servers/physics/body_sw.h
+++ b/servers/physics/body_sw.h
@@ -201,7 +201,7 @@ public:
_FORCE_INLINE_ bool is_active() const { return active; }
_FORCE_INLINE_ void wakeup() {
- if ((get_space() && active) || mode==PhysicsServer::BODY_MODE_STATIC || mode==PhysicsServer::BODY_MODE_KINEMATIC)
+ if ((!get_space()) || mode==PhysicsServer::BODY_MODE_STATIC || mode==PhysicsServer::BODY_MODE_KINEMATIC)
return;
set_active(true);
}