Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
962e9c4
Start adding templated object creation functions for Geography Object…
MB60893 May 22, 2026
ed9bbf8
Merge branch 'doldecomp:main' into GeoObjMgr-Templates
MB60893 May 22, 2026
d39cd19
Merge branch 'doldecomp:main' into GeoObjMgr-Templates
MB60893 May 24, 2026
d9b2601
Merge branch 'doldecomp:main' into GeoObjMgr-Templates
MB60893 May 26, 2026
d69a5c1
Merge branch 'doldecomp:main' into GeoObjMgr-Templates
MB60893 Jun 16, 2026
7bf7e18
GeoObjMgr - Add GeoStartLine
MB60893 Jul 22, 2026
8f86808
GeoObjMgr - Add GeoMarioFlower1
MB60893 Jul 22, 2026
ab5cced
Rename CrsData's `pathID` property to `mPathID` - discovered that `TM…
MB60893 Jul 22, 2026
de20132
GeoObjMgr - Implement majority of TMapObjDonkyRock.
MB60893 Jul 22, 2026
e8645af
GeoObjMgr - Implement TMapObjDonkyRockGen.
MB60893 Jul 22, 2026
0663448
GeoObjMgr - Implement TMapObjDonkyTree.
MB60893 Jul 22, 2026
ad23fef
Fix Coord3D function return types based on additional context from Ma…
MB60893 Jul 22, 2026
b7e6822
GeoObjMgr - Implement majority of TMapObjDossun.
MB60893 Jul 22, 2026
64afde7
GeoObjMgr - Add TMapObjWanwan, TMapObjWanwanChain and TMapObjWanwanPile.
MB60893 Jul 22, 2026
d896522
Add class accessors to Course.h for `mDirX`, `mDirY` and `mDirZ`. Not…
MB60893 Jul 22, 2026
6dcff51
Implement Coord3DUtil.
MB60893 Jul 22, 2026
fe401d2
GeoObjMgr - Implement majority of MapObjSkyShip.
MB60893 Jul 22, 2026
d472968
Update TKartThrower's class definition with `sObject` parameter - req…
MB60893 Jul 22, 2026
8a7576f
GeoObjMgr - Implement MapObjGeyser.
MB60893 Jul 22, 2026
ae4afc3
Implement SmallAnimalGen - used as a base for a few other functions r…
MB60893 Jul 22, 2026
ca10acd
GeoObjMgr - Implement majority of TMapObjSnowRock.
MB60893 Jul 22, 2026
0b1b57c
GeoObjMgr - Implement TestRollObj.
MB60893 Jul 22, 2026
5eb6b59
GeoObjMgr - Implement majority of TestString.
MB60893 Jul 23, 2026
09a9266
GeoObjMgr - Implement TMapObjFountain.
MB60893 Jul 23, 2026
5147860
GeoObjMgr - Implement majority of TMapObjHeyho.
MB60893 Jul 23, 2026
0ac2fe7
GeoObjMgr - Implement MapObjWluArrow.
MB60893 Jul 23, 2026
80cc766
GeoObjMgr - Implement TMapObjSnowMan.
MB60893 Jul 23, 2026
a9c6698
GeoObjMgr - Add TMapObjIceBlock.
MB60893 Jul 23, 2026
6492904
GeoObjMgr - Implement TMapObjNoMove.
MB60893 Jul 23, 2026
89d23fd
GeoObjMgr - Implement TMapObjSun.
MB60893 Jul 23, 2026
9988897
GeoObjMgr - Implement TMapObjBubble.
MB60893 Jul 23, 2026
46027b5
Set proper Update JPEffectMgr::createEmtCameraClip() function signatu…
MB60893 Jul 23, 2026
4a3e5b1
GeoObjMgr - Implement TMapObjPeachTree.
MB60893 Jul 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/Kaneshige/Course/Course.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ class Course

f32 getGroundThickness() const { return sGndThickness; }

JGeometry::TVec3f *getDirZ() { return &mDirZ; };
JGeometry::TVec3f *getDirY() { return &mDirY; };
JGeometry::TVec3f *getDirX() { return &mDirX; };

private: // add all documented stuff from Ghidra
static u16 sDrawAreaModel;
static bool sForceDebugFogSetting;
Expand Down
2 changes: 1 addition & 1 deletion include/Kaneshige/Course/CrsData.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class CrsData
JGeometry::TVec3<s16> zNorm; // 18
JGeometry::TVec3<s16> yNorm; // 1e
u16 objID;
u16 pathID; // 26
u16 mPathID; // 26
u16 _28; //
u16 pointIdx; // 2a
struct {
Expand Down
5 changes: 2 additions & 3 deletions include/Kaneshige/Objects/GeoStartLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

#include "Sato/GeographyObj.h"

class GeoStartLine : public GeographyObj
{
// Global
class GeoStartLine : public GeographyObj {
public:
GeoStartLine(); // 0x801b4860
virtual ~GeoStartLine() {} // 0x801b4bd0
virtual void reset(); // 0x801b49c8
Expand Down
2 changes: 1 addition & 1 deletion include/Sato/GeographyObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class GeographyObj

void setItemColReaction(u8 p1, u8 p2) { mReaction.setFlg(p1, p2); }

bool IsPathMove() const { return mObjData->pathID != 0xffff; }
bool IsPathMove() const { return mObjData->mPathID != 0xffff; }

template<class T>
static T *New(const CrsData::SObject &object) { return new T(object); }
Expand Down
7 changes: 6 additions & 1 deletion include/Sato/GeographyObjMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class GeographyObjManager : JKRDisposer
return &mKartHitRefVec[myNum];
}

void getKartCollidePosRadius(JGeometry::TVec3f &, f32 &, int);

static GeographyObjManager *gMgr;

u8 _18[0x10]; // 18
Expand All @@ -78,7 +80,10 @@ class GeographyObjManager : JKRDisposer
bool mKartHitItemBox[8]; // 348
u8 _350[0xAC]; // 350
TJugem *mJugem[4]; // 3FC
u8 _40C[0x491 - 0x40C]; // 40C
u8 _40C[0x410 - 0x40C]; // 40C
JGeometry::TVec3f mKartCollidePos[8]; // 410
f32 mKartCollideRadius[8]; // 470
u8 _490; // 490
bool mIsBalloonBattle; // 491
bool mIsBombBattle; // 492
bool mIsRobberyBattle; // 493
Expand Down
2 changes: 1 addition & 1 deletion include/Sato/JPEffectMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class JPEffectMgr
void create_forMenu(); // 0x8023038c
JPABaseEmitter *createEmt(u16, const JGeometry::TVec3f &); // 0x8023050c
JPABaseEmitter *createEmt(const char *, const JGeometry::TVec3f &); // 0x80230544
void createEmtCameraClip(const char *, const JGeometry::TVec3f &); // 0x80230590
JPABaseEmitter *createEmtCameraClip(const char *, const JGeometry::TVec3f &); // 0x80230590
JPABaseEmitter *createEmt2D(const char *, const JGeometry::TVec3f &); // 0x80230600
JPABaseEmitter *createEmt(const char *, const JGeometry::TVec3f &, Mtx); // 0x8023064c
void createEmtThunder(const char *, const JGeometry::TVec3f &); // 0x802306c0
Expand Down
1 change: 1 addition & 0 deletions include/Sato/Objects/GeoRFlower.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class GeoRFlower : public GeographyObj { // Autogenerated


class GeoMarioFlower1 : public GeographyObj {
public:
GeoMarioFlower1(const CrsData::SObject &);
~GeoMarioFlower1() {}
void reset();
Expand Down
17 changes: 16 additions & 1 deletion include/Sato/StringObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ class StringNodeManager {
_3c = val;
}


void link_set_30(u32 num, bool val) {
#line 112
JUT_MINMAX_ASSERT(0, num, mStrNodeList.getNumLinks());
mStrNodeList.getNth(num)->getObject()->_30 = val;
}

void setNodeLength(u32 num, f32 val) {
#line 202
JUT_MINMAX_ASSERT(0, num, mStrNodeList.getNumLinks());
mStrNodeList.getNth(num)->getObject()->_34 = val;
}



// VTBL: 0x0
JSUList<StringNode> mStrNodeList; // 0x4
f32 _10;
Expand All @@ -108,7 +123,7 @@ class StringNodeManager {
f32 _1c;
f32 _20; // Scaling multiplier of some sort.
f32 _24; // Something related to distance calculations...?
Vec _28;
JGeometry::TVec3f _28;
StringNode *_34;
GameAudio::ObjectSoundMgr *mObjSoundMgr; // 0x38
u32 _3c;
Expand Down
31 changes: 18 additions & 13 deletions include/Shiraiwa/Coord3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class TFreeMove {
_18 = false;
}

void setUnknown24(f32 value) {
_24 = value;
}

private:
JGeometry::TVec3f mTagret;
JGeometry::TVec3f *mpPos;
Expand All @@ -49,13 +53,13 @@ class TPathMove {
public:
TPathMove(const CrsData::SObject *);
virtual ~TPathMove() {}
void update();
u8 update();
void init(JGeometry::TVec3f *, JGeometry::TVec3f *);
void reset();
void setTargetNode();
void setTargetNode(u16, f32, f32);
void getNodePosition(JGeometry::TVec3f *, u16);
void getNextNode();
u16 getNextNode();
void updatePos();
void checkReachTarget();

Expand All @@ -64,15 +68,16 @@ class TPathMove {
void setTargetNode(u16);
void getNodeDir(u16, JGeometry::TVec3f *);

protected:
const CrsData::SObject *mpObj; // 04
s16 _8; //
JGeometry::TVec3f *mpPos; // 0c
JGeometry::TVec3f *mpVel; // 10
f32 _14;
f32 _18;
bool _1c;
PLACEHOLDER_BYTES(0x1d, 0x24);
public:
const CrsData::SObject *mpObj; // 0x4
s16 _8; // 0x8
JGeometry::TVec3f *mpPos; // 0xc
JGeometry::TVec3f *mpVel; // 0x10
f32 _14; // 0x14
f32 _18; // 0x18
bool _1c; // 0x1c, 3 bytes padding
f32 _20; // 0x20
//PLACEHOLDER_BYTES(0x1d, 0x24);
}; // Size: 0x24

class TFreeRotate {
Expand All @@ -81,7 +86,7 @@ class TFreeRotate {
virtual ~TFreeRotate() {}
void init(JGeometry::TPos3f *);
void setTargetVec(const JGeometry::TVec3f &, const JGeometry::TVec3f &, f32, f32, f32);
void setTargetVec(const JGeometry::TVec3f &, f32, f32, f32, u8);
void setTargetVec(const JGeometry::TVec3f &, f32, f32, f32, unsigned char);
void setTargetQuat(const JGeometry::TQuat4f &, f32, f32, f32);
bool update();
void angleUpdate();
Expand Down Expand Up @@ -109,5 +114,5 @@ class TFreeRotate {
f32 mTarget;
bool _3c;
};

#endif // COORD3D_H
173 changes: 173 additions & 0 deletions include/Shiraiwa/Coord3DUtil.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#ifndef COORD3DUTIL_H
#define COORD3DUTIL_H

#include "JSystem/JGeometry/Matrix.h"
#include "JSystem/JGeometry/Vec.h"
#include "Kaneshige/Course/CrsData.h"
#include "Kaneshige/Course/CrsGround.h"
#include "Sato/stMath.h"
#include "Shiraiwa/Coord3D.h"

class TPathUtil {
public:
TPathUtil();
TPathUtil(const CrsData::SObject *);
virtual ~TPathUtil();

virtual void reset();
void getDirection(JGeometry::TVec3f& out);
float getDistance();
u16 getNextNode();

u16 getPointIndex() const { return mPointIndex; }
void setPointIndex(u16 pointIndex) { mPointIndex = pointIndex; }

public:
const CrsData::SObject *mObj; // 0x4
u16 mPointIndex; // 0x8
s8 mDirection; // 0xA
f32 mDistance; // 0xC
bool mDistanceDirty; // 0x10 - 3 bytes padding.

}; // 0x14 - confirmed via TMapObjUFO Constructor.

class TPathUtilInterrupt : public TPathUtil {
public:
TPathUtilInterrupt(const CrsData::SObject *sObject) : TPathUtil(sObject) {
_14.set(0.0f, 0.0f ,0.0f);
_20 = 0;
}
virtual void reset();
void getCurrentNodePos(JGeometry::TVec3f *);
void getNextNodePos(JGeometry::TVec3f *);
void updateNode();

JGeometry::TVec3f _14;
bool _20;
};

class TPathWalk {
public:
TPathWalk(const CrsData::SObject *);
virtual ~TPathWalk();
bool init(JGeometry::TVec3f *, JGeometry::TVec3f *, JGeometry::TPos3f *);
bool reset();
void setParameters(f32, f32, f32, f32, f32);
void setCheckLength(f32);
s16 update();
void dirUpdate();
void posUpdate();
bool checkReachTarget();
void forceTurn(const JGeometry::TVec3f &);
void forceTurn(const JGeometry::TVec3f &, const JGeometry::TVec3f &);

static s16 sNearlyReachTargetLength;

TFreeRotate *_4; // 0x4
TFreeRotate *_8; // 0x8
CrsGround *crsGround; // 0xc
JGeometry::TVec3f *_10; // 0x10
JGeometry::TVec3f *_14; // 0x14
JGeometry::TPos3f *_18; // 0x18
JGeometry::TPos3f _1c; // 0x1c
JGeometry::TPos3f _4c; // 0x4c
f32 _7c; // 0x7c - TVec3f?
f32 _80; // 0x80
f32 _84; // 0x84
TPathUtilInterrupt *_88; // 0x88
f32 mCheckLength; // 0x8c
f32 _90; // 0x90
u8 _94; // 0x94
f32 _98; // 0x98
f32 _9c; // 0x9c
f32 _a0; // 0xa0
f32 _a4; // 0xa4
};


class TFreeFly {
public:
TFreeFly();
virtual ~TFreeFly();
virtual void reset();
void init(JGeometry::TVec3f *, JGeometry::TVec3f *, JGeometry::TPos3f *);
void setParameters(f32, f32, f32);
u8 update();
void dirUpdate();
void posUpdate();
bool checkReachTarget();

void forceTurn(JGeometry::TVec3f &);

static s16 sNearlyReachTargetLength;

TFreeRotate *mFreeRotate; // 0x4
JGeometry::TVec3f *mPosition; // 0x8
JGeometry::TVec3f *mVelocity; // 0xc
JGeometry::TPos3f *_10; // 0x10
JGeometry::TPos3f _14; // 0x14
JGeometry::TVec3f _44; // 0x44
f32 mSpeed; // 0x50
u8 _54; // 0x54
f32 _58; // 0x58
f32 _5c; // 0x5c
};

class TFreeFall {
public:
TFreeFall();
TFreeFall(JGeometry::TVec3f *pos, JGeometry::TVec3f *vel, JGeometry::TPos3f *rot);
virtual ~TFreeFall();
virtual bool update(); // 0xc
virtual void reset(); // 0x10
virtual void roll(); // 0x14
virtual void reflect(const JGeometry::TVec3f &);
virtual void rotate();
virtual void getGravity(JGeometry::TVec3f *);
virtual void getReflect(const JGeometry::TVec3f &, JGeometry::TVec3f *);
virtual void addAccel(const JGeometry::TVec3f &);
void init(JGeometry::TVec3f *, JGeometry::TVec3f *, JGeometry::TPos3f *);

f32 _4;
f32 _8;
f32 _c;
f32 _10;
f32 mRotSpeed;
f32 mGravity;
bool mEnabled;
JGeometry::TVec3f *mPos; // 0x20
JGeometry::TVec3f *mVel; // 0x24
JGeometry::TPos3f *mRot; // 0x28
};

class TFreeFallShakeSky : public TFreeFall {
public:
TFreeFallShakeSky(JGeometry::TVec3f *pos, JGeometry::TVec3f *vel, JGeometry::TPos3f *rot) : TFreeFall(pos, vel, rot) {
mRnd = nullptr;
}
virtual ~TFreeFallShakeSky();
virtual void reset();
virtual void reflect(const JGeometry::TVec3f &);
virtual void rotate();
virtual void getGravity(JGeometry::TVec3f *);
virtual void getReflect(const JGeometry::TVec3f &, JGeometry::TVec3f *);

// static scPowMax;
// static scSmallJumpMin;
// static scSmallJumpMax;

stRandom *mRnd;
f32 _30;
f32 _34;
u8 _38;
};

class TFreeFallDonkyRock {
public:
~TFreeFallDonkyRock();
void reflect(const JGeometry::TVec3f &);
void reset();
void getReflect(const JGeometry::TVec3f &, JGeometry::TVec3f *);
};

#endif // COORD3DUTIL_H
Loading
Loading