diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-21 11:50:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-21 11:50:26 +0200 |
commit | 2273f13fbe7ba0482288e497031616ebd533308f (patch) | |
tree | 3f5aa6c3dab7c3a0329e4746f2b3ef709e32d143 /servers/physics_3d | |
parent | b5f5fac840914ec84ef373a38381432470e2da36 (diff) | |
parent | 4bd5e4fd9b80384d511e4c8f2f642b43159aba4c (diff) |
Merge pull request #50686 from Calinou/use-standard-inf-nan-constants
Use the standard C `INFINITY` and `NAN` constants directly
Diffstat (limited to 'servers/physics_3d')
-rw-r--r-- | servers/physics_3d/shape_3d_sw.h | 2 | ||||
-rw-r--r-- | servers/physics_3d/soft_body_3d_sw.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/servers/physics_3d/shape_3d_sw.h b/servers/physics_3d/shape_3d_sw.h index bc8bd3e695..0d1b7cc3d7 100644 --- a/servers/physics_3d/shape_3d_sw.h +++ b/servers/physics_3d/shape_3d_sw.h @@ -128,7 +128,7 @@ class PlaneShape3DSW : public Shape3DSW { public: Plane get_plane() const; - virtual real_t get_area() const { return Math_INF; } + virtual real_t get_area() const { return INFINITY; } virtual PhysicsServer3D::ShapeType get_type() const { return PhysicsServer3D::SHAPE_PLANE; } virtual void project_range(const Vector3 &p_normal, const Transform3D &p_transform, real_t &r_min, real_t &r_max) const; virtual Vector3 get_support(const Vector3 &p_normal) const; diff --git a/servers/physics_3d/soft_body_3d_sw.cpp b/servers/physics_3d/soft_body_3d_sw.cpp index 63a0fe11ba..724125bea8 100644 --- a/servers/physics_3d/soft_body_3d_sw.cpp +++ b/servers/physics_3d/soft_body_3d_sw.cpp @@ -1172,7 +1172,7 @@ struct _SoftBodyIntersectSegmentInfo { Vector3 dir; Vector3 hit_position; uint32_t hit_face_index = -1; - real_t hit_dist_sq = Math_INF; + real_t hit_dist_sq = INFINITY; static bool process_hit(uint32_t p_face_index, void *p_userdata) { _SoftBodyIntersectSegmentInfo &query_info = *(_SoftBodyIntersectSegmentInfo *)(p_userdata); @@ -1203,7 +1203,7 @@ bool SoftBodyShape3DSW::intersect_segment(const Vector3 &p_begin, const Vector3 soft_body->query_ray(p_begin, p_end, _SoftBodyIntersectSegmentInfo::process_hit, &query_info); - if (query_info.hit_dist_sq != Math_INF) { + if (query_info.hit_dist_sq != INFINITY) { r_result = query_info.hit_position; r_normal = soft_body->get_face_normal(query_info.hit_face_index); return true; |