mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Core: Replace C math headers with C++ equivalents
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
This commit is contained in:
parent
c5c1cd4440
commit
ad40939b6f
101 changed files with 414 additions and 498 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue