SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
KCollision.hpp
1#pragma once
2
3#include "Game/Util/JMapInfo.hpp"
4#include "JSystem/JGeometry/TVec.hpp"
5#include <revolution.h>
6
7class JMapInfo;
8
10 f32 mHeight; // _0
11 u16 mPositionIndex; // _4
12 u16 mNormalIndex; // _6
13 u16 mEdgeIndices[3]; // _8
14 u16 mAttribute; // _E
15};
16
17class Fxyz {
18public:
19 inline Fxyz() {
20
21 }
22
23 Fxyz &operator=(const Fxyz &);
24
25 f32 x, y, z;
26};
27
28struct KCLFile {
29 union {
30 TVec3f *mPos; // _0
31 u32 mPosOffset; // _0
32 };
33 union {
34 TVec3f *mNorms; // _4
35 u32 mNormOffset; // _4
36 };
37 union {
38 KC_PrismData *mPrisms; // _8
39 u32 mPrismOffset; // _8
40 };
41 union {
42 void *mOctree; // _C
43 u32 mOctreeOffset; // _C
44 };
45 f32 mThickness; // _10
46 TVec3f mMin; // _14
47 s32 mXMask; // _20
48 s32 mYMask; // _24
49 s32 mZMask; // _28
50 s32 mBlockWidthShift; // _2C
51 s32 mBlockXShift; // _30
52 s32 mBlockXYShift; // _34
53};
54
56public:
57 class V3u {
58 public:
59 inline V3u() {
60
61 }
62
63 void setUsingCast(const TVec3f &);
64
65 s32 x;
66 s32 y;
67 s32 z;
68 };
69
71
72 void init(void *, const void *);
73 void setData(void *);
74 void calcFarthestVertexDistance();
75 static bool isBinaryInitialized(const void *);
76 void checkPoint(Fxyz *, float, float *);
77 void checkArea3D(Fxyz *, Fxyz *, KC_PrismData **, unsigned long);
78 void checkSphere(Fxyz *, float, float, unsigned long, KC_PrismData **, float *, unsigned char *);
79 void checkSphereWithThickness(Fxyz *, float, float, unsigned long, KC_PrismData **, float *, unsigned char *, float);
80 void checkArrow(const TVec3f, const TVec3f, float *, unsigned char *, unsigned long *, KC_PrismData **, unsigned long) const;
81 void KCHitSphere(KC_PrismData *, Fxyz *, float, float, float *, unsigned char *);
82 void KCHitSphereWithThickness(KC_PrismData *, Fxyz *, float, float, float *, unsigned char *, float);
83 bool isNearParallelNormal(const KC_PrismData *) const;
84 void KCHitArrow(KC_PrismData *, const TVec3f, const TVec3f, float *, unsigned char *) const;
85 s32 toIndex(const KC_PrismData *) const;
86 TVec3f *getFaceNormal(const KC_PrismData *) const;
87 TVec3f *getEdgeNormal1(const KC_PrismData *) const;
88 TVec3f *getEdgeNormal2(const KC_PrismData *) const;
89 TVec3f *getEdgeNormal3(const KC_PrismData *) const;
90 TVec3f *getNormal(unsigned long) const;
91 void calXvec(const Fxyz *, const Fxyz *, Fxyz *) const;
92 TVec3f getPos(const KC_PrismData *, int) const;
93 KC_PrismData *getPrismData(unsigned long) const;
94 s32 getTriangleNum() const;
95 JMapInfoIter getAttributes(unsigned long) const;
96 s32 *searchBlock(long *, const unsigned long &, const unsigned long &, const unsigned long &) const;
97 bool isInsideMinMaxInLocalSpace(const V3u &) const;
98 bool outCheck(const TVec3f *, const TVec3f *, V3u *, V3u *) const;
99 void objectSpaceToLocalSpace(V3u *, const TVec3f &) const;
100
101 KCLFile* mFile; // _0
102 JMapInfo *mapInfo; // _4
103 f32 mMaxVertexDistance; // _8
104};