SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
PlanetGravity.hpp
1#pragma once
2
3#include "JSystem/JGeometry.hpp"
4
5class NameObj;
6
7// Gravity vector calculation flags
8#define GRAVITY_TYPE_NORMAL 1
9#define GRAVITY_TYPE_SHADOW 2
10#define GRAVITY_TYPE_MAGNET 4
11#define GRAVITY_TYPE_MARIO_LAUNCHER 8
12
13// Gravity power types
14#define GRAVITY_POWER_LIGHT 0
15#define GRAVITY_POWER_NORMAL 1
16#define GRAVITY_POWER_HEAVY 2
17
19public:
21
22 virtual void updateMtx(const TPos3f &rMtx) {}
23
24 virtual bool calcOwnGravityVector(TVec3f *pDest, f32 *pScalar, const TVec3f &rPosition) const {
25 return false;
26 }
27
28 bool calcGravity(TVec3f *pDest, const TVec3f &rPosition) const;
29 bool calcGravityFromMassPosition(TVec3f *pDirection, f32 *pScalar, const TVec3f &rPosition, const TVec3f &rMassPosition) const;
30
31 bool isInRangeSquare(f32 radius) const;
32 bool isInRangeDistance(f32 radius) const;
33
34 void setPriority(s32 priority);
35 void updateIdentityMtx();
36
37 f32 mRange; // _4
38 f32 mDistant; // _8
39 s32 mPriority; // _C
40 s32 mGravityId; // _10, read from the stage files but never used
41 const void* mHost; // _14, host object pointer, can be any pointer
42 u32 mGravityType; // _18, gravity type bits
43 s32 mGravityPower; // _1C, gravity power type
44 bool mActivated; // _20, corresponding GlobalGravityObj has switch activated?
45 bool mIsInverse; // _21, invert gravity vector?
46 bool mValidFollower; // _22
47 bool mIsRegistered; // _23, is registered by PlanetGravityManager?
48 bool mAppeared; // _24, corresponding GlobalGravityObj has appeared?
49};
The most basic form of an object.
Definition NameObj.hpp:11