SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
SegmentGravity.cpp
1#include "Game/Gravity.hpp"
2#include "Game/Util.hpp"
3
4SegmentGravity::SegmentGravity() :
6 mSideVector(1, 0, 0),
7 _64(1, 0, 0),
8 _70(1, 0, 0),
9 _7C(0, 0, 0)
10{
11 _88 = 0.0f;
12 mSideDegree = 360.0f;
13 _90 = -1.0f;
14
15 for (u32 i = 0 ; i < 2 ; i++) {
16 mGravityPoints[i].zero();
17 _40[i].zero();
18 _94[i] = 0.0f;
19 mEdges[i] = true;
20 }
21}
22
23void SegmentGravity::setGravityPoint(u32 index, const TVec3f &rGravityPoint) {
24 mGravityPoints[index != 0] = rGravityPoint;
25 updateLocalParam();
26}
27
28void SegmentGravity::setSideVector(const TVec3f &rSideVec) {
29 mSideVector = rSideVec;
30 MR::normalizeOrZero(&mSideVector);
31 updateLocalParam();
32}
33
34void SegmentGravity::setValidSideDegree(f32 val) {
35 mSideDegree = val;;
36 updateLocalParam();
37}
38
39void SegmentGravity::setEdgeValid(u32 index, bool val) {
40 mEdges[index != 0] = val;
41}