diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-03-27 15:21:27 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-03-27 15:21:27 -0300 |
commit | a6f3bc7c696af03e3875f78e098d2476e409d15e (patch) | |
tree | fc1bb58e900436c48c03c52106eb57250442ae35 /servers/physics_2d/body_2d_sw.h | |
parent | 307b1b3a5835ecdb477859785c673a07e248f904 (diff) |
Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D
Also renamed corresponding files.
Diffstat (limited to 'servers/physics_2d/body_2d_sw.h')
-rw-r--r-- | servers/physics_2d/body_2d_sw.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h index ea07b8260c..4a83cf9500 100644 --- a/servers/physics_2d/body_2d_sw.h +++ b/servers/physics_2d/body_2d_sw.h @@ -39,7 +39,7 @@ class Constraint2DSW; class Body2DSW : public CollisionObject2DSW { - Physics2DServer::BodyMode mode; + PhysicsServer2D::BodyMode mode; Vector2 biased_linear_velocity; real_t biased_angular_velocity; @@ -74,7 +74,7 @@ class Body2DSW : public CollisionObject2DSW { SelfList<Body2DSW> direct_state_query_list; VSet<RID> exceptions; - Physics2DServer::CCDMode continuous_cd_mode; + PhysicsServer2D::CCDMode continuous_cd_mode; bool omit_force_integration; bool active; bool can_sleep; @@ -158,7 +158,7 @@ public: _FORCE_INLINE_ void set_max_contacts_reported(int p_size) { contacts.resize(p_size); contact_count = 0; - if (mode == Physics2DServer::BODY_MODE_KINEMATIC && p_size) set_active(true); + if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC && p_size) set_active(true); } _FORCE_INLINE_ int get_max_contacts_reported() const { return contacts.size(); } @@ -224,19 +224,19 @@ public: _FORCE_INLINE_ bool is_active() const { return active; } _FORCE_INLINE_ void wakeup() { - if ((!get_space()) || mode == Physics2DServer::BODY_MODE_STATIC || mode == Physics2DServer::BODY_MODE_KINEMATIC) + if ((!get_space()) || mode == PhysicsServer2D::BODY_MODE_STATIC || mode == PhysicsServer2D::BODY_MODE_KINEMATIC) return; set_active(true); } - void set_param(Physics2DServer::BodyParameter p_param, real_t); - real_t get_param(Physics2DServer::BodyParameter p_param) const; + void set_param(PhysicsServer2D::BodyParameter p_param, real_t); + real_t get_param(PhysicsServer2D::BodyParameter p_param) const; - void set_mode(Physics2DServer::BodyMode p_mode); - Physics2DServer::BodyMode get_mode() const; + void set_mode(PhysicsServer2D::BodyMode p_mode); + PhysicsServer2D::BodyMode get_mode() const; - void set_state(Physics2DServer::BodyState p_state, const Variant &p_variant); - Variant get_state(Physics2DServer::BodyState p_state) const; + void set_state(PhysicsServer2D::BodyState p_state, const Variant &p_variant); + Variant get_state(PhysicsServer2D::BodyState p_state) const; void set_applied_force(const Vector2 &p_force) { applied_force = p_force; } Vector2 get_applied_force() const { return applied_force; } @@ -258,8 +258,8 @@ public: applied_torque += p_torque; } - _FORCE_INLINE_ void set_continuous_collision_detection_mode(Physics2DServer::CCDMode p_mode) { continuous_cd_mode = p_mode; } - _FORCE_INLINE_ Physics2DServer::CCDMode get_continuous_collision_detection_mode() const { return continuous_cd_mode; } + _FORCE_INLINE_ void set_continuous_collision_detection_mode(PhysicsServer2D::CCDMode p_mode) { continuous_cd_mode = p_mode; } + _FORCE_INLINE_ PhysicsServer2D::CCDMode get_continuous_collision_detection_mode() const { return continuous_cd_mode; } void set_space(Space2DSW *p_space); @@ -278,9 +278,9 @@ public: _FORCE_INLINE_ Vector2 get_motion() const { - if (mode > Physics2DServer::BODY_MODE_KINEMATIC) { + if (mode > PhysicsServer2D::BODY_MODE_KINEMATIC) { return new_transform.get_origin() - get_transform().get_origin(); - } else if (mode == Physics2DServer::BODY_MODE_KINEMATIC) { + } else if (mode == PhysicsServer2D::BODY_MODE_KINEMATIC) { return get_transform().get_origin() - new_transform.get_origin(); //kinematic simulates forward } return Vector2(); @@ -341,9 +341,9 @@ void Body2DSW::add_contact(const Vector2 &p_local_pos, const Vector2 &p_local_no c[idx].collider_velocity_at_pos = p_collider_velocity_at_pos; } -class Physics2DDirectBodyStateSW : public Physics2DDirectBodyState { +class Physics2DDirectBodyStateSW : public PhysicsDirectBodyState2D { - GDCLASS(Physics2DDirectBodyStateSW, Physics2DDirectBodyState); + GDCLASS(Physics2DDirectBodyStateSW, PhysicsDirectBodyState2D); public: static Physics2DDirectBodyStateSW *singleton; @@ -363,7 +363,7 @@ public: virtual void set_angular_velocity(real_t p_velocity) { body->set_angular_velocity(p_velocity); } virtual real_t get_angular_velocity() const { return body->get_angular_velocity(); } - virtual void set_transform(const Transform2D &p_transform) { body->set_state(Physics2DServer::BODY_STATE_TRANSFORM, p_transform); } + virtual void set_transform(const Transform2D &p_transform) { body->set_state(PhysicsServer2D::BODY_STATE_TRANSFORM, p_transform); } virtual Transform2D get_transform() const { return body->get_transform(); } virtual void add_central_force(const Vector2 &p_force) { body->add_central_force(p_force); } @@ -414,7 +414,7 @@ public: return body->contacts[p_contact_idx].collider_velocity_at_pos; } - virtual Physics2DDirectSpaceState *get_space_state(); + virtual PhysicsDirectSpaceState2D *get_space_state(); virtual real_t get_step() const { return step; } Physics2DDirectBodyStateSW() { |