diff options
| author | Juan Linietsky | 2015-04-26 16:20:00 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-04-26 16:20:00 -0300 |
| commit | 3bcb930e8ac1c8048de990f41c29cd2dfcc3c2a2 (patch) | |
| tree | edf0979625a5dfee10b6110083f036c727a7e89d /servers/physics/body_sw.h | |
| parent | 65c96a71bd5593a7a6b0aaaf80ae68fceca849b9 (diff) | |
| download | godot-3bcb930e8ac1c8048de990f41c29cd2dfcc3c2a2.tar.gz godot-3bcb930e8ac1c8048de990f41c29cd2dfcc3c2a2.tar.zst godot-3bcb930e8ac1c8048de990f41c29cd2dfcc3c2a2.zip | |
properly wake up bodies when a parameter changes, fixes #1740
Diffstat (limited to 'servers/physics/body_sw.h')
| -rw-r--r-- | servers/physics/body_sw.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h index 63dd3e676..f15fd9b83 100644 --- a/servers/physics/body_sw.h +++ b/servers/physics/body_sw.h @@ -200,6 +200,12 @@ public: void set_active(bool p_active); _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) + return; + set_active(true); + } + void set_param(PhysicsServer::BodyParameter p_param, float); float get_param(PhysicsServer::BodyParameter p_param) const; |
