summaryrefslogtreecommitdiff
path: root/include/d
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-07-25 23:04:33 +0200
committerrobojumper <robojumper@gmail.com>2025-07-25 23:04:33 +0200
commit36898b4883a76f595737ef768f375541947f4607 (patch)
tree20dc42207713367b70a7de866162dfcdc5d9c497 /include/d
parent27f670cf2af52034886d089fc49b2952121b1584 (diff)
Small cleanup
Diffstat (limited to 'include/d')
-rw-r--r--include/d/a/d_a_player.h3
-rw-r--r--include/d/a/obj/d_a_obj_boomerang.h10
-rw-r--r--include/d/d_pad.h17
3 files changed, 27 insertions, 3 deletions
diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h
index e3b4a1cf..9050140b 100644
--- a/include/d/a/d_a_player.h
+++ b/include/d/a/d_a_player.h
@@ -102,6 +102,9 @@ public:
static s32 getCurrentBowType();
static s32 getCurrentSlingshotType();
static s32 getCurrentBeetleType();
+ static bool hasBeetleVariantOrBetter(s32 variant) {
+ return getCurrentBeetleType() >= variant;
+ }
static s32 getCurrentBugNetType();
static bool isInBambooCuttingMinigame() {
diff --git a/include/d/a/obj/d_a_obj_boomerang.h b/include/d/a/obj/d_a_obj_boomerang.h
index 00fa98d0..d172ff42 100644
--- a/include/d/a/obj/d_a_obj_boomerang.h
+++ b/include/d/a/obj/d_a_obj_boomerang.h
@@ -208,15 +208,19 @@ private:
/* 0x08B5 */ u8 mWindNodeID;
/* 0x08B6 */ u8 mLeftWingNodeID;
/* 0x08B7 */ u8 mRightWingNodeID;
- /* 0x08B8 */ u8 _0x8B8[0x8C8 - 0x8B8];
- /* 0x08CA */ u16 field_0x8C8;
+ /* 0x08B8 */ mAng field_0x8B8;
+ /* 0x08BA */ mAng field_0x8BA;
+ /* 0x08BC */ mAng field_0x8BC;
+ /* 0x08BE */ mAng field_0x8BE;
+ /* 0x08C0 */ u8 _0x8C0[0x8C8 - 0x8C0];
+ /* 0x08CA */ mAng field_0x8C8;
/* 0x08CA */ u16 mRemainingFlightTime;
/* 0x08CC */ u32 field_0x8CC;
/* 0x08D0 */ f32 field_0x8D0;
/* 0x08D4 */ f32 field_0x8D4;
/* 0x08D8 */ mVec3_c field_0x8D8;
/* 0x08E4 */ mVec3_c field_0x8E4;
- /* 0x08F0 */ u8 _0x8E4[0x8FC - 0x8F0];
+ /* 0x08F0 */ mVec3_c field_0x8F0;
/* 0x08FC */ dCcD_Sph mSph0;
/* 0x0A4C */ dCcD_Sph mSph1;
/* 0x0B9C */ EffectsStruct mEff0;
diff --git a/include/d/d_pad.h b/include/d/d_pad.h
index 0d4f4129..fbfca801 100644
--- a/include/d/d_pad.h
+++ b/include/d/d_pad.h
@@ -53,12 +53,29 @@ class ex_c {
/* 0x10D8 */ s32 field_0x10D8;
};
+ // Orthonormal Basis vectors of the Mpls attachment in 3D space.
+ // Z+ is forward, Y+ is up, and X+ is left. So a Wiimote pointing at
+ // the Screen will have vectors (1, 0, 0), (0, 1, 0), (0, 0, 1).
+ // Of particular interest here is mZ, which tells you in which direction
+ // the Wiimote points.
struct mpls_c {
mpls_c() : mX(mVec3_c::Ex), mY(mVec3_c::Ey), mZ(mVec3_c::Ez) {}
mMtx_c getMtx() const;
/* 0x00 */ mVec3_c mX;
/* 0x0C */ mVec3_c mY;
/* 0x18 */ mVec3_c mZ;
+
+ // vertical angle. 0 is forward, positive is pointing upwards,
+ // negative is pointing downwards
+ mAng getVerticalAngle() const {
+ return cM::atan2s(mZ.y, mZ.absXZ());
+ }
+
+ // horizontal angle. 0 is forward, positive is pointing to the left,
+ // negative is pointing to the right
+ mAng getHorizontalAngle() const {
+ return cM::atan2s(mZ.x, mZ.z);
+ }
};
public: