progress on d_a_obj_ivy_rope (#109)

* init

* couple more funcs

* progress

* smol progress

* smol progress 2

* Dont get your hopes up, I just had some lingering things :P

* fix merge
This commit is contained in:
Elijah Thomas
2025-05-10 17:23:35 -04:00
committed by GitHub
parent 91e2efd1b2
commit e1aad98a2d
15 changed files with 1509 additions and 104 deletions
+11 -10
View File
@@ -1,9 +1,11 @@
#ifndef M3D_BLINE_H
#define M3D_BLINE_H
#include "common.h"
#include "egg/gfx/eggTexture.h"
#include "m/m3d/m_proc.h"
#include "m/m_math.h"
#include "m/m_vec.h"
#include "nw4r/ut/ut_Color.h"
namespace m3d {
@@ -11,26 +13,20 @@ namespace m3d {
// The Actual line
class bline_c {
public:
bline_c() : mpPathArr(0), mpVtxPosArr(0), mpVtxNrmArr(0), mpVtxTexArr(0), mFlags(0) {}
bline_c() : mpPathArr(nullptr), mpVtxPosArr(nullptr), mpVtxNrmArr(nullptr), mpVtxTexArr(nullptr), mFlags(0) {}
// This is mainly a Guess, When the array is created, it has both a ctor/dtor
struct VtxPos {
mVec3_c pos1;
mVec3_c pos2;
};
struct Vec3u8 {
Vec3u8() {}
u8 x, y, z;
};
// This is mainly a Guess, When the array is created, it has only a ctor
struct VtxNrm {
#pragma warning off(10402)
union {
struct {
Vec3u8 nrm1;
Vec3u8 nrm2;
};
EGG::Vector3s nrm_u16; // There is a short by short copy later
};
#pragma warning on(10402)
Vec3u8 nrm1;
Vec3u8 nrm2;
};
// This is mainly a Guess, When the array is created, it doesnt use the array alloc
struct VtxTex {
@@ -44,6 +40,10 @@ public:
void remove();
void draw();
mVec3_c &getPathPoint(u16 idx) {
return mpPathArr[idx];
}
// vt at 0x08
virtual ~bline_c();
@@ -63,6 +63,7 @@ public:
class blineMat_c : public proc_c {
public:
blineMat_c() : mpLineArr(nullptr) {}
virtual ~blineMat_c();
virtual void remove() override;
virtual void drawOpa() override;
+12 -2
View File
@@ -17,7 +17,7 @@ class mMtx_c : public EGG::Matrix34f {
typedef const f32 (*MtxRefConst)[4];
public:
mMtx_c(){};
mMtx_c() {};
mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, f32 yx, f32 yy, f32 yz, f32 yw, f32 zx, f32 zy, f32 zz, f32 zw);
operator MtxRef() {
@@ -78,17 +78,27 @@ public:
return ret;
}
void multVec(const mVec3_c &in, mVec3_c &out) const {
PSMTXMultVec(*this, in, out);
}
mMtx_c &operator+=(const mMtx_c &rhs) {
PSMTXConcat(*this, rhs, *this);
return *this;
}
mVec3_c operator*(const mVec3_c &rhs) {
mVec3_c out;
PSMTXMultVec(*this, rhs, out);
return out;
}
void applyQuat(mQuat_c &quat) {
PSMTXMultVec(m, quat.v, quat.v);
}
void fn_802F1C40(s32, s32);
void makeRotationFromVecs(const mVec3_c&, const mVec3_c&, f32);
void makeRotationFromVecs(const mVec3_c &, const mVec3_c &, f32);
public:
static mMtx_c Identity;