From bbe9a37f1d0bae1b26b9f53b216c29d16e76b039 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 16 May 2015 17:54:36 -0300 Subject: sleeping property now should work properly, fixes #1892 --- servers/physics/body_sw.cpp | 2 ++ servers/physics/body_sw.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'servers/physics') 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); } -- cgit v1.2.3