You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
sleeping property now should work properly, fixes #1892
This commit is contained in:
@@ -257,6 +257,8 @@ void BodySW::set_state(PhysicsServer::BodyState p_state, const Variant& p_varian
|
|||||||
Transform t = p_variant;
|
Transform t = p_variant;
|
||||||
t.orthonormalize();
|
t.orthonormalize();
|
||||||
new_transform=get_transform(); //used as old to compute motion
|
new_transform=get_transform(); //used as old to compute motion
|
||||||
|
if (new_transform==t)
|
||||||
|
break;
|
||||||
_set_transform(t);
|
_set_transform(t);
|
||||||
_set_inv_transform(get_transform().inverse());
|
_set_inv_transform(get_transform().inverse());
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public:
|
|||||||
_FORCE_INLINE_ bool is_active() const { return active; }
|
_FORCE_INLINE_ bool is_active() const { return active; }
|
||||||
|
|
||||||
_FORCE_INLINE_ void wakeup() {
|
_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;
|
return;
|
||||||
set_active(true);
|
set_active(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,6 +275,8 @@ void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant& p_va
|
|||||||
Matrix32 t = p_variant;
|
Matrix32 t = p_variant;
|
||||||
t.orthonormalize();
|
t.orthonormalize();
|
||||||
new_transform=get_transform(); //used as old to compute motion
|
new_transform=get_transform(); //used as old to compute motion
|
||||||
|
if (t==new_transform)
|
||||||
|
break;
|
||||||
_set_transform(t);
|
_set_transform(t);
|
||||||
_set_inv_transform(get_transform().inverse());
|
_set_inv_transform(get_transform().inverse());
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public:
|
|||||||
_FORCE_INLINE_ bool is_active() const { return active; }
|
_FORCE_INLINE_ bool is_active() const { return active; }
|
||||||
|
|
||||||
_FORCE_INLINE_ void wakeup() {
|
_FORCE_INLINE_ void wakeup() {
|
||||||
if ((get_space() && active) || mode==Physics2DServer::BODY_MODE_STATIC || mode==Physics2DServer::BODY_MODE_KINEMATIC)
|
if ((!get_space()) || mode==Physics2DServer::BODY_MODE_STATIC || mode==Physics2DServer::BODY_MODE_KINEMATIC)
|
||||||
return;
|
return;
|
||||||
set_active(true);
|
set_active(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user