diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-11 00:13:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 00:13:06 +0100 |
commit | 5cfafaf09ec88d4d4f4ca0a3f01de1d8fcb4efe0 (patch) | |
tree | c3e1b3c343e29403d5d4798f7b1622b4b6c4453d /scene/3d/physics_body.h | |
parent | dcc5e21b35efec977539c8e0f5615a30a5fff581 (diff) | |
parent | 5dee44bbc13605348b65bc74878a5a8be2b50cbd (diff) |
Merge pull request #14516 from AndreaCatania/patch-2
Implemented physics linear and angular lock
Diffstat (limited to 'scene/3d/physics_body.h')
-rw-r--r-- | scene/3d/physics_body.h | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 57b120ef63..9d9feda0b2 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -132,8 +132,6 @@ private: bool sleeping; bool ccd; - bool locked_axis[3] = { false, false, false }; - int max_contacts_reported; bool custom_integrator; @@ -238,12 +236,8 @@ public: void set_use_continuous_collision_detection(bool p_enable); bool is_using_continuous_collision_detection() const; - void set_axis_lock_x(bool p_lock); - void set_axis_lock_y(bool p_lock); - void set_axis_lock_z(bool p_lock); - bool get_axis_lock_x() const; - bool get_axis_lock_y() const; - bool get_axis_lock_z() const; + void set_axis_lock(PhysicsServer::BodyAxis p_axis, bool p_lock); + bool get_axis_lock(PhysicsServer::BodyAxis p_axis) const; Array get_colliding_bodies() const; @@ -277,7 +271,7 @@ public: }; private: - bool locked_axis[3] = { false, false, false }; + uint16_t locked_axis; float margin; @@ -301,12 +295,8 @@ public: bool move_and_collide(const Vector3 &p_motion, Collision &r_collision); bool test_move(const Transform &p_from, const Vector3 &p_motion); - void set_axis_lock_x(bool p_lock); - void set_axis_lock_y(bool p_lock); - void set_axis_lock_z(bool p_lock); - bool get_axis_lock_x() const; - bool get_axis_lock_y() const; - bool get_axis_lock_z() const; + void set_axis_lock(PhysicsServer::BodyAxis p_axis, bool p_lock); + bool get_axis_lock(PhysicsServer::BodyAxis p_axis) const; void set_safe_margin(float p_margin); float get_safe_margin() const; |