summaryrefslogtreecommitdiff
path: root/include/m
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2024-09-28 00:19:00 +0200
committerGitHub <noreply@github.com>2024-09-27 18:19:00 -0400
commit3829ee6d4854a18bb6c19ffd1e250632946c0206 (patch)
tree219ed1485d604a50bbb232bcd3e44d54dcaebdf6 /include/m
parent0f9ef3d33c5772d5240bfa1ff209d81abc934376 (diff)
Rough dynamic collision setup (#24)
* Rough collider shape setup * d_a_obj_toD3_stone_figure OK * Cleanup * Cleanup 2
Diffstat (limited to 'include/m')
-rw-r--r--include/m/m_angle.h9
-rw-r--r--include/m/m_vec.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/include/m/m_angle.h b/include/m/m_angle.h
index 514fa6d0..2b0c98c9 100644
--- a/include/m/m_angle.h
+++ b/include/m/m_angle.h
@@ -2,6 +2,7 @@
#define M_ANGLE_H
#include <common.h>
+#include <nw4r/math/math_triangular.h>
struct mAng {
mAng() {}
@@ -12,6 +13,14 @@ struct mAng {
}
s32 step(s16 target, s32 steps, s16 max, s16 min);
+ inline f32 sin() const {
+ return nw4r::math::SinIdx(*this);
+ }
+
+ inline f32 cos() const {
+ return nw4r::math::CosIdx(*this);
+ }
+
s16 mVal;
};
diff --git a/include/m/m_vec.h b/include/m/m_vec.h
index f27b498c..44be26c3 100644
--- a/include/m/m_vec.h
+++ b/include/m/m_vec.h
@@ -61,6 +61,11 @@ public:
return (Vec *)&x;
}
+ /// @brief Vec cast operator.
+ operator Vec() const {
+ return *(Vec *)&x;
+ }
+
operator EGG::Vector3f *() {
return (EGG::Vector3f *)&x;
}