summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorelijah-thomas774 <elijahthomas774@gmail.com>2025-06-08 00:35:02 -0400
committerelijah-thomas774 <elijahthomas774@gmail.com>2025-06-08 00:35:02 -0400
commit657f2455ff276a72f52708890fba83e9065b89cd (patch)
treea7253035d278bc6b20d32f56ac5f8bea045ab3c6 /src
parent86b6ef11c8bb0943fea9bd8cfefd65f323898963 (diff)
use cmath for sinf/cosf
Diffstat (limited to 'src')
-rw-r--r--src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath6
-rw-r--r--src/d/d_light_env.cpp18
2 files changed, 10 insertions, 14 deletions
diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath
index d6685a2a..492c6fda 100644
--- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath
+++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/cmath
@@ -33,7 +33,7 @@ using ::modff;
using ::pow;
using ::scalbn;
using ::sin;
-using ::sinf;
+// using ::sinf;
using ::sqrt;
// using ::sqrtf;
using ::tan;
@@ -51,6 +51,10 @@ inline float cosf(float x) {
return cos(x);
}
+inline float sinf(float x) {
+ return sin(x);
+}
+
inline float sqrtf(float x) {
return ::sqrtf(x);
}
diff --git a/src/d/d_light_env.cpp b/src/d/d_light_env.cpp
index 8ddcbe90..00671095 100644
--- a/src/d/d_light_env.cpp
+++ b/src/d/d_light_env.cpp
@@ -11,6 +11,8 @@
#include "m/m_vec.h"
#include "nw4r/math/math_arithmetic.h"
+#include <cmath>
+
dLightEnv_c dLightEnv_c::sInstance;
dLightEnv_c *dLightEnv_c::sPInstance;
@@ -39,24 +41,14 @@ void dLightEnv_c::get_vectle_calc(const mVec3_c *pInA, const mVec3_c *pInB, mVec
vectle_calc(&pos, pOut);
}
-// TODO(??)
-inline f32 sinf(f32 x) {
- return sin(x);
-}
-
-// TODO(??)
-inline f32 cosf(f32 x) {
- return cos(x);
-}
-
void dLightEnv_c::sphere_to_cartesian(f32 angY, f32 angXZ, mVec3_c *pOut) {
f32 radY = angY / (180.f / M_PI);
f32 radXZ = angXZ / (180.f / M_PI);
mVec3_c pos;
- pos.x = cosf(radY) * sinf(radXZ);
- pos.y = sinf(radY);
- pos.z = cosf(radY) * cosf(radXZ);
+ pos.x = std::cosf(radY) * std::sinf(radXZ);
+ pos.y = std::sinf(radY);
+ pos.z = std::cosf(radY) * std::cosf(radXZ);
pOut->x = pos.x;
pOut->y = pos.y;