Merge pull request #104386 from Repiteo/core/cpp-math

Core: Replace C math headers with C++ equivalents
This commit is contained in:
Thaddeus Crews 2025-04-27 19:21:22 -05:00
commit 3947cbe3b2
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
101 changed files with 414 additions and 498 deletions

View file

@ -743,7 +743,7 @@ bool GodotCylinderShape3D::intersect_point(const Vector3 &p_point) const {
}
Vector3 GodotCylinderShape3D::get_closest_point_to(const Vector3 &p_point) const {
if (Math::absf(p_point.y) > height * 0.5) {
if (Math::abs(p_point.y) > height * 0.5) {
// Project point to top disk.
real_t dir = p_point.y > 0.0 ? 1.0 : -1.0;
Vector3 circle_pos(0.0, dir * height * 0.5, 0.0);

View file

@ -963,7 +963,7 @@ Vector3 GodotSoftBody3D::_compute_area_windforce(const GodotArea3D *p_area, cons
const Vector3 &ws = p_area->get_wind_source();
real_t projection_on_tri_normal = vec3_dot(p_face->normal, wd);
real_t projection_toward_centroid = vec3_dot(p_face->centroid - ws, wd);
real_t attenuation_over_distance = pow(projection_toward_centroid, -waf);
real_t attenuation_over_distance = std::pow(projection_toward_centroid, -waf);
real_t nodal_force_magnitude = wfm * 0.33333333333 * p_face->ra * projection_on_tri_normal * attenuation_over_distance;
return nodal_force_magnitude * p_face->normal;
}