diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-08-19 11:02:40 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-08-24 17:34:55 -0700 |
commit | aa4791735d2fe92d747a39529aebb410f96cf38f (patch) | |
tree | 8052f9cb555e0ebd4bd1dde05c6130b58c58c768 /servers | |
parent | d9720d439545792bd742645f3c6e3f7c29327aa8 (diff) |
Rename slips_on_slope to slide_on_slope
Also added some precision to the documentation.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_2d/collision_solver_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 4 | ||||
-rw-r--r-- | servers/physics_2d/shape_2d_sw.h | 4 | ||||
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 4 | ||||
-rw-r--r-- | servers/physics_3d/collision_solver_3d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_3d/shape_3d_sw.cpp | 14 | ||||
-rw-r--r-- | servers/physics_3d/shape_3d_sw.h | 6 | ||||
-rw-r--r-- | servers/physics_3d/space_3d_sw.cpp | 4 |
8 files changed, 20 insertions, 20 deletions
diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index 34c94150e2..5337c8af56 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -117,7 +117,7 @@ bool CollisionSolver2DSW::solve_raycast(const Shape2DSW *p_shape_A, const Vector } Vector2 support_B = p_transform_B.xform(p); - if (ray->get_slips_on_slope()) { + if (ray->get_slide_on_slope()) { Vector2 global_n = invb.basis_xform_inv(n).normalized(); support_B = support_A + (support_B - support_A).length() * global_n; } diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index a82f0c2e6f..dae5669488 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -168,14 +168,14 @@ real_t RayShape2DSW::get_moment_of_inertia(real_t p_mass, const Size2 &p_scale) void RayShape2DSW::set_data(const Variant &p_data) { Dictionary d = p_data; length = d["length"]; - slips_on_slope = d["slips_on_slope"]; + slide_on_slope = d["slide_on_slope"]; configure(Rect2(0, 0, 0.001, length)); } Variant RayShape2DSW::get_data() const { Dictionary d; d["length"] = length; - d["slips_on_slope"] = slips_on_slope; + d["slide_on_slope"] = slide_on_slope; return d; } diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index 6813e25a0b..541d35dae9 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -181,11 +181,11 @@ public: class RayShape2DSW : public Shape2DSW { real_t length; - bool slips_on_slope; + bool slide_on_slope; public: _FORCE_INLINE_ real_t get_length() const { return length; } - _FORCE_INLINE_ bool get_slips_on_slope() const { return slips_on_slope; } + _FORCE_INLINE_ bool get_slide_on_slope() const { return slide_on_slope; } virtual PhysicsServer2D::ShapeType get_type() const { return PhysicsServer2D::SHAPE_RAY; } diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 169c419b3b..92b87cea23 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -730,8 +730,8 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co // Colliding separation rays allows to properly snap to the ground, // otherwise it's not needed in regular motion. if (!p_collide_separation_ray && (body_shape->get_type() == PhysicsServer2D::SHAPE_RAY)) { - // When slips on slope is on, separation ray shape acts like a regular shape. - if (!static_cast<RayShape2DSW *>(body_shape)->get_slips_on_slope()) { + // When slide on slope is on, separation ray shape acts like a regular shape. + if (!static_cast<RayShape2DSW *>(body_shape)->get_slide_on_slope()) { continue; } } diff --git a/servers/physics_3d/collision_solver_3d_sw.cpp b/servers/physics_3d/collision_solver_3d_sw.cpp index 8803b355d4..4a6a07534b 100644 --- a/servers/physics_3d/collision_solver_3d_sw.cpp +++ b/servers/physics_3d/collision_solver_3d_sw.cpp @@ -117,7 +117,7 @@ bool CollisionSolver3DSW::solve_ray(const Shape3DSW *p_shape_A, const Transform3 } Vector3 support_B = p_transform_B.xform(p); - if (ray->get_slips_on_slope()) { + if (ray->get_slide_on_slope()) { Vector3 global_n = ai.basis.xform_inv(n).normalized(); support_B = support_A + (support_B - support_A).length() * global_n; } diff --git a/servers/physics_3d/shape_3d_sw.cpp b/servers/physics_3d/shape_3d_sw.cpp index 42a0fb32b2..fcc97f56a3 100644 --- a/servers/physics_3d/shape_3d_sw.cpp +++ b/servers/physics_3d/shape_3d_sw.cpp @@ -170,8 +170,8 @@ real_t RayShape3DSW::get_length() const { return length; } -bool RayShape3DSW::get_slips_on_slope() const { - return slips_on_slope; +bool RayShape3DSW::get_slide_on_slope() const { + return slide_on_slope; } void RayShape3DSW::project_range(const Vector3 &p_normal, const Transform3D &p_transform, real_t &r_min, real_t &r_max) const { @@ -226,27 +226,27 @@ Vector3 RayShape3DSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); } -void RayShape3DSW::_setup(real_t p_length, bool p_slips_on_slope) { +void RayShape3DSW::_setup(real_t p_length, bool p_slide_on_slope) { length = p_length; - slips_on_slope = p_slips_on_slope; + slide_on_slope = p_slide_on_slope; configure(AABB(Vector3(0, 0, 0), Vector3(0.1, 0.1, length))); } void RayShape3DSW::set_data(const Variant &p_data) { Dictionary d = p_data; - _setup(d["length"], d["slips_on_slope"]); + _setup(d["length"], d["slide_on_slope"]); } Variant RayShape3DSW::get_data() const { Dictionary d; d["length"] = length; - d["slips_on_slope"] = slips_on_slope; + d["slide_on_slope"] = slide_on_slope; return d; } RayShape3DSW::RayShape3DSW() { length = 1; - slips_on_slope = false; + slide_on_slope = false; } /********** SPHERE *************/ diff --git a/servers/physics_3d/shape_3d_sw.h b/servers/physics_3d/shape_3d_sw.h index 9f18b83f07..a693288f7e 100644 --- a/servers/physics_3d/shape_3d_sw.h +++ b/servers/physics_3d/shape_3d_sw.h @@ -136,13 +136,13 @@ public: class RayShape3DSW : public Shape3DSW { real_t length; - bool slips_on_slope; + bool slide_on_slope; - void _setup(real_t p_length, bool p_slips_on_slope); + void _setup(real_t p_length, bool p_slide_on_slope); public: real_t get_length() const; - bool get_slips_on_slope() const; + bool get_slide_on_slope() const; virtual real_t get_area() const { return 0.0; } virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_RAY; } diff --git a/servers/physics_3d/space_3d_sw.cpp b/servers/physics_3d/space_3d_sw.cpp index 7ed17d6284..4ec03529cf 100644 --- a/servers/physics_3d/space_3d_sw.cpp +++ b/servers/physics_3d/space_3d_sw.cpp @@ -719,8 +719,8 @@ bool Space3DSW::test_body_motion(Body3DSW *p_body, const Transform3D &p_from, co // Colliding separation rays allows to properly snap to the ground, // otherwise it's not needed in regular motion. if (!p_collide_separation_ray && (body_shape->get_type() == PhysicsServer3D::SHAPE_RAY)) { - // When slips on slope is on, separation ray shape acts like a regular shape. - if (!static_cast<RayShape3DSW *>(body_shape)->get_slips_on_slope()) { + // When slide on slope is on, separation ray shape acts like a regular shape. + if (!static_cast<RayShape3DSW *>(body_shape)->get_slide_on_slope()) { continue; } } |