diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-16 17:54:36 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-16 17:54:36 -0300 |
commit | bbe9a37f1d0bae1b26b9f53b216c29d16e76b039 (patch) | |
tree | d625c1a816767dc63f754dd681e5ba5e9b69ff16 /servers/physics | |
parent | 8482611f8163506aba02a4556715cebbd922cf77 (diff) |
sleeping property now should work properly, fixes #1892
Diffstat (limited to 'servers/physics')
-rw-r--r-- | servers/physics/body_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics/body_sw.h | 2 |
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); } |