summaryrefslogtreecommitdiff
path: root/src/KingSystem/System
diff options
context:
space:
mode:
authorThePixelGamer <thepixelmaster2354@gmail.com>2021-10-06 18:02:53 -0500
committerThePixelGamer <thepixelmaster2354@gmail.com>2021-10-10 05:21:18 -0500
commit20df9e7c7d9715173b2bdfd5697526b2f49b8dbe (patch)
treee0c5d2f9b2419aceb870721f1a22e52ec9614f5c /src/KingSystem/System
parenta82333ef9060f622e52a25ee0d815d33b0e91d91 (diff)
Update misc files to match sead math changes
Diffstat (limited to 'src/KingSystem/System')
-rw-r--r--src/KingSystem/System/VFR.h6
-rw-r--r--src/KingSystem/System/VFRValue.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/KingSystem/System/VFR.h b/src/KingSystem/System/VFR.h
index 10a8bcaa..552d9949 100644
--- a/src/KingSystem/System/VFR.h
+++ b/src/KingSystem/System/VFR.h
@@ -95,7 +95,7 @@ public:
const auto f = getLerpFactor(t);
const auto max_d = instance()->getDeltaTime() * max_delta;
const auto diff = b - *value;
- const auto d = f * sead::absf(diff);
+ const auto d = f * sead::Mathf::abs(diff);
if (d > max_d)
*value += diff < 0.0 ? -max_d : max_d;
else
@@ -109,9 +109,9 @@ public:
const auto min_d = instance()->getDeltaTime() * min_delta;
const auto diff = b - *value;
- const auto d = f * sead::absf(diff);
+ const auto d = f * sead::Mathf::abs(diff);
- if (sead::absf(diff) <= min_d) {
+ if (sead::Mathf::abs(diff) <= min_d) {
*value = b;
return true;
}
diff --git a/src/KingSystem/System/VFRValue.cpp b/src/KingSystem/System/VFRValue.cpp
index 68601898..6915fbdd 100644
--- a/src/KingSystem/System/VFRValue.cpp
+++ b/src/KingSystem/System/VFRValue.cpp
@@ -75,7 +75,7 @@ void VFRVec3f::lerp(const sead::Vector3f& b, f32 t) {
bool VFRVec3f::chase(const sead::Vector3f& target, f32 t) {
const auto delta = VFR::instance()->getDeltaTime() * t;
const auto diff = target - value;
- const auto norm = sead::norm2(diff);
+ const auto norm = diff.length();
if (norm <= delta) {
sead::MemUtil::copy(&value, &target, sizeof(value));
@@ -101,12 +101,12 @@ void VFRValue::setToMin(const f32& min) {
void VFRValue::clamp(const f32& min, const f32& max) {
const auto a = min;
const auto b = max;
- value = sead::clamp(value, a, b);
+ value = sead::Mathf::clamp(value, a, b);
}
void VFRVec3f::normalize(f32 new_norm) {
- if (sead::norm2(value) > new_norm) {
- const auto norm = sead::norm2(value);
+ if (value.length() > new_norm) {
+ const auto norm = value.length();
if (norm > 0.0)
value *= new_norm / norm;
}