summaryrefslogtreecommitdiffstats
path: root/servers/physics_2d/body_2d_sw.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-04-26 16:20:00 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-04-26 16:20:00 -0300
commit3bcb930e8ac1c8048de990f41c29cd2dfcc3c2a2 (patch)
treeedf0979625a5dfee10b6110083f036c727a7e89d /servers/physics_2d/body_2d_sw.h
parent65c96a71bd5593a7a6b0aaaf80ae68fceca849b9 (diff)
downloadredot-engine-3bcb930e8ac1c8048de990f41c29cd2dfcc3c2a2.tar.gz
properly wake up bodies when a parameter changes, fixes #1740
Diffstat (limited to 'servers/physics_2d/body_2d_sw.h')
-rw-r--r--servers/physics_2d/body_2d_sw.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h
index 3b07401dd7..ca4d80a15b 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -201,6 +201,15 @@ public:
void set_active(bool p_active);
_FORCE_INLINE_ bool is_active() const { return active; }
+ _FORCE_INLINE_ void wakeup() {
+ if ((get_space() && active) || mode==Physics2DServer::BODY_MODE_STATIC || mode==Physics2DServer::BODY_MODE_KINEMATIC)
+ return;
+ set_active(true);
+ }
+
+
+
+
void set_param(Physics2DServer::BodyParameter p_param, float);
float get_param(Physics2DServer::BodyParameter p_param) const;