Skip to content

Commit

Permalink
match and Link CrsData(thanks Cuyler for matching checkPosition!)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwareJonge committed Dec 31, 2024
1 parent ac075ff commit 6558721
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 24 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ def MatchingFor(*versions):
[
Object(Matching, "Kaneshige/DrawBuffer.cpp"),
Object(Equivalent, "Kaneshige/Course/Course.cpp"),
Object(NonMatching, "Kaneshige/Course/CrsData.cpp"),
Object(Matching, "Kaneshige/Course/CrsData.cpp"),
Object(NonMatching, "Kaneshige/Course/CrsGround.cpp"),
Object(NonMatching, "Kaneshige/ExModel.cpp"),
Object(Matching, "Kaneshige/HioMgr.cpp"),
Expand Down
11 changes: 7 additions & 4 deletions include/Kaneshige/Course/CrsData.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CrsData
u8 zMinIndex : 2;
u8 xMinIndex : 2;
u8 camCode;
s16 nearTrigs[3];
u16 nearTrigs[3];
u8 thickness : 4;
u8 _21;
u8 _22;
Expand Down Expand Up @@ -269,8 +269,8 @@ class CrsData
bool checkFront(const CrsData *, const JGeometry::TVec3f &) const; // 0x801a0770
bool checkFaceSide(const CrsData *, const JGeometry::TVec3f &) const; // 0x801a083c
f32 getPlaneY(const JGeometry::TVec3f &, Course *) const; // 0x801a097c
int checkPolygonTouchBySphere(const JGeometry::TVec3f *, const JGeometry::TVec3f &, float, Course *) const; // 0x801a0ae4
int getTouchState(const SColInfoSphere &, const JGeometry::TVec3f &, const JGeometry::TVec3f &, JGeometry::TVec3f *, float *, float) const; // 0x801a0c5c
u32 checkPolygonTouchBySphere(const JGeometry::TVec3f *, const JGeometry::TVec3f &, float, Course *) const; // 0x801a0ae4
u32 getTouchState(const SColInfoSphere &, const JGeometry::TVec3f &, const JGeometry::TVec3f &, JGeometry::TVec3f *, float *, float) const; // 0x801a0c5c
void getCenter(JGeometry::TVec3f *, const JGeometry::TVec3f *, Course *) const; // 0x801a0f64
// Inline
int getZmaxIndex() const { return zMaxIndex; } // 0x801a0034
Expand Down Expand Up @@ -399,9 +399,12 @@ class CrsData
SCheckPoint *getCheckPointTable() const;
Camera *getCameraData(int camIdx) const;

// Unused
const char *getMatTableLabel(int matNo) const;

Grid *getGridTable() const { return (Grid*)((u8 *)mCollionData + sizeof(SColHeader)); }
SMaterial *getMatTable() const { return (SMaterial*)((u8 *)mCollionData + mCollionData->matTableOffset); }
SGround *getGroundTable() const { return (SGround*)((u8 *)mCollionData + mCollionData->groundTableOffset); }
Ground *getGroundTable() const { return (Ground*)((u8 *)mCollionData + mCollionData->groundTableOffset); }
JGeometry::TVec3f *getVertexTable() const { return (JGeometry::TVec3f *)((u8 *)mCollionData + mCollionData->vertexTableOffset); }
u16 *getIndexTable() const { return (u16*)((u8 *)mCollionData + mCollionData->indexTableOffset); }

Expand Down
6 changes: 4 additions & 2 deletions include/Kaneshige/Course/CrsGround.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CrsGround
void search(const JGeometry::TVec3f &, const JGeometry::TVec3f &, f32, bool); // 0x801a21e4
void roundDepth(const JGeometry::TVec3f &); // 0x801a262c
void checkGridBySphere(f32 *, const CrsData::SColInfoSphere &, u32, f32, f32, f32); // 0x801a2698
void checkPolygonCover(const JGeometry::TVec3f &, const JGeometry::TVec3f &, const JGeometry::TVec3f &, f32, const CrsData::Ground *, f32 *); // 0x801a290c
bool checkPolygonCover(const JGeometry::TVec3f &, const JGeometry::TVec3f &, const JGeometry::TVec3f &, f32, const CrsData::Ground *, f32 *); // 0x801a290c
void checkPolygonCoverMain(const JGeometry::TVec3f &, const CrsData::SColInfoSphere &, u32, f32, f32, f32, const CrsData::Ground *); // 0x801a2d20
void isInsideGrid(const JGeometry::TVec3f &, f32, f32, f32, f32); // 0x801a2ec0
void searchGridIndex(int *, int *, Course *, const JGeometry::TVec3f &, f32, f32, f32, f32, int, int); // 0x801a3004
Expand Down Expand Up @@ -60,6 +60,8 @@ class CrsGround
// TODO
};

static f32 getOverLevel() { return 50.0f; }

private:
Course *mCourse;
JGeometry::TVec3f mWorldPos;
Expand All @@ -78,4 +80,4 @@ class CrsGround
f32 _0x5C;
};

#endif
#endif
Loading

0 comments on commit 6558721

Please sign in to comment.