Remove some hacks from CBallCamera

This commit is contained in:
Luke Street 2022-09-21 01:40:03 -04:00
parent 21f597aeb7
commit 2afec50c52
3 changed files with 17 additions and 56 deletions

View File

@ -13564,7 +13564,7 @@ __dt__11CBallCameraFv:
lbl_8008CD34: lbl_8008CD34:
/* 8008CD34 00089C94 38 7E 04 7C */ addi r3, r30, 0x47c /* 8008CD34 00089C94 38 7E 04 7C */ addi r3, r30, 0x47c
/* 8008CD38 00089C98 38 80 FF FF */ li r4, -1 /* 8008CD38 00089C98 38 80 FF FF */ li r4, -1
/* 8008CD3C 00089C9C 48 00 01 71 */ bl __dt__Q211CBallCamera23SFailsafeStateContainerFv /* 8008CD3C 00089C9C 48 00 01 71 */ bl "__dt__Q24rstl43single_ptr<Q211CBallCamera14SFailsafeState>Fv"
/* 8008CD40 00089CA0 38 7E 03 7C */ addi r3, r30, 0x37c /* 8008CD40 00089CA0 38 7E 03 7C */ addi r3, r30, 0x37c
/* 8008CD44 00089CA4 38 80 FF FF */ li r4, -1 /* 8008CD44 00089CA4 38 80 FF FF */ li r4, -1
/* 8008CD48 00089CA8 4B FD 08 A1 */ bl __dt__13CCameraSplineFv /* 8008CD48 00089CA8 4B FD 08 A1 */ bl __dt__13CCameraSplineFv
@ -13667,8 +13667,8 @@ lbl_8008CE88:
/* 8008CEA4 00089E04 38 21 00 50 */ addi r1, r1, 0x50 /* 8008CEA4 00089E04 38 21 00 50 */ addi r1, r1, 0x50
/* 8008CEA8 00089E08 4E 80 00 20 */ blr /* 8008CEA8 00089E08 4E 80 00 20 */ blr
.global __dt__Q211CBallCamera23SFailsafeStateContainerFv .global "__dt__Q24rstl43single_ptr<Q211CBallCamera14SFailsafeState>Fv"
__dt__Q211CBallCamera23SFailsafeStateContainerFv: "__dt__Q24rstl43single_ptr<Q211CBallCamera14SFailsafeState>Fv":
/* 8008CEAC 00089E0C 94 21 FF D0 */ stwu r1, -0x30(r1) /* 8008CEAC 00089E0C 94 21 FF D0 */ stwu r1, -0x30(r1)
/* 8008CEB0 00089E10 7C 08 02 A6 */ mflr r0 /* 8008CEB0 00089E10 7C 08 02 A6 */ mflr r0
/* 8008CEB4 00089E14 90 01 00 34 */ stw r0, 0x34(r1) /* 8008CEB4 00089E14 90 01 00 34 */ stw r0, 0x34(r1)

View File

@ -26,17 +26,16 @@ private:
class CCameraCollider { class CCameraCollider {
public: public:
CCameraCollider(f32 radius, CVector3f vec, const CCameraSpring& spring, f32 scale); CCameraCollider(f32 radius, CVector3f vec, const CCameraSpring& spring, f32 scale)
// : x4_radius(radius) : x4_radius(radius)
// , x8_lastLocalPos(vec) , x8_lastLocalPos(vec)
// , x14_localPos(vec) , x14_localPos(vec)
// , x20_scaledWorldPos(vec) , x20_scaledWorldPos(vec)
// , x2c_lastWorldPos(vec) , x2c_lastWorldPos(vec)
// , x38_spring(spring) , x38_spring(spring)
// , x4c_occlusionCount(0) , x4c_occlusionCount(0)
// , x50_scale(scale) {} , x50_scale(scale) {}
CCameraCollider(const CCameraCollider&); virtual ~CCameraCollider() {}
virtual ~CCameraCollider();
f32 GetRadius() const { return x4_radius; } f32 GetRadius() const { return x4_radius; }
// TODO // TODO
@ -145,23 +144,10 @@ private:
rstl::vector< CVector3f > x90_splinePoints; rstl::vector< CVector3f > x90_splinePoints;
SFailsafeState(); SFailsafeState();
// ~SFailsafeState();
};
struct SFailsafeStateContainer {
SFailsafeState* x0_failsafeState;
SFailsafeStateContainer() : x0_failsafeState(new SFailsafeState) {}
~SFailsafeStateContainer(); // { }
}; };
struct SUnknown { struct SUnknown {
SUnknown(); SUnknown();
}; };
struct SUnknownContainer {
SUnknown* x0_;
SUnknownContainer() : x0_(new SUnknown) {}
~SUnknownContainer() { delete x0_; }
};
EBallCameraBehaviour x188_behaviour; EBallCameraBehaviour x188_behaviour;
bool x18c_24_ : 1; bool x18c_24_ : 1;
@ -269,8 +255,8 @@ private:
f32 x470_clampVelTimer; f32 x470_clampVelTimer;
f32 x474_clampVelRange; f32 x474_clampVelRange;
uint x478_shortMoveCount; uint x478_shortMoveCount;
SFailsafeStateContainer x47c_failsafeStateContainer; rstl::single_ptr< SFailsafeState > x47c_failsafeState;
SUnknownContainer x480_; rstl::single_ptr< SUnknown > x480_;
}; };
CHECK_SIZEOF(CBallCamera, 0x488) CHECK_SIZEOF(CBallCamera, 0x488)

View File

@ -13,16 +13,6 @@ static CMaterialList kLineOfSightExcludeList =
static CMaterialFilter kLineOfSightFilter = static CMaterialFilter kLineOfSightFilter =
CMaterialFilter::MakeIncludeExclude(kLineOfSightIncludeList, kLineOfSightExcludeList); CMaterialFilter::MakeIncludeExclude(kLineOfSightIncludeList, kLineOfSightExcludeList);
CCameraCollider::CCameraCollider(f32 radius, CVector3f vec, const CCameraSpring& spring, f32 scale)
: x4_radius(radius)
, x8_lastLocalPos(vec)
, x14_localPos(vec)
, x20_scaledWorldPos(vec)
, x2c_lastWorldPos(vec)
, x38_spring(spring)
, x4c_occlusionCount(0)
, x50_scale(scale) {}
// TODO non-matching // TODO non-matching
CBallCamera::CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f& xf, f32 fovY, CBallCamera::CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f& xf, f32 fovY,
f32 nearZ, f32 farZ, f32 aspect) f32 nearZ, f32 farZ, f32 aspect)
@ -144,16 +134,13 @@ CBallCamera::CBallCamera(TUniqueId uid, TUniqueId watchedId, const CTransform4f&
, x470_clampVelTimer(0.f) , x470_clampVelTimer(0.f)
, x474_clampVelRange(0.f) , x474_clampVelRange(0.f)
, x478_shortMoveCount(0) , x478_shortMoveCount(0)
// , x47c_failsafeState(new SFailsafeState) , x47c_failsafeState(new SFailsafeState)
, x47c_failsafeStateContainer() , x480_(new SUnknown) {
, x480_() {
SetupColliders(x264_smallColliders, 2.31f, 2.31f, 0.1f, 3, 2.f, 0.5f, -M_PIF / 2.f); SetupColliders(x264_smallColliders, 2.31f, 2.31f, 0.1f, 3, 2.f, 0.5f, -M_PIF / 2.f);
SetupColliders(x274_mediumColliders, 4.62f, 4.62f, 0.1f, 6, 2.f, 0.5f, -M_PIF / 2.f); SetupColliders(x274_mediumColliders, 4.62f, 4.62f, 0.1f, 6, 2.f, 0.5f, -M_PIF / 2.f);
SetupColliders(x284_largeColliders, 7.f, 7.f, 0.1f, 12, 2.f, 0.5f, -M_PIF / 2.f); SetupColliders(x284_largeColliders, 7.f, 7.f, 0.1f, 12, 2.f, 0.5f, -M_PIF / 2.f);
} }
CBallCamera::SFailsafeStateContainer::~SFailsafeStateContainer() { delete x0_failsafeState; }
CBallCamera::~CBallCamera() {} CBallCamera::~CBallCamera() {}
void CBallCamera::TeleportColliders(rstl::vector< CCameraCollider >& colliderList, CVector3f pos) { void CBallCamera::TeleportColliders(rstl::vector< CCameraCollider >& colliderList, CVector3f pos) {
@ -220,18 +207,6 @@ void CBallCamera::ResetToTweaks(CStateManager& mgr) {
x18e_26_ = false; x18e_26_ = false;
} }
CCameraCollider::~CCameraCollider() {}
CCameraCollider::CCameraCollider(const CCameraCollider& other)
: x4_radius(other.x4_radius)
, x8_lastLocalPos(other.x8_lastLocalPos)
, x14_localPos(other.x14_localPos)
, x20_scaledWorldPos(other.x20_scaledWorldPos)
, x2c_lastWorldPos(other.x2c_lastWorldPos)
, x38_spring(other.x38_spring)
, x4c_occlusionCount(other.x4c_occlusionCount)
, x50_scale(other.x50_scale) {}
void CBallCamera::SetupColliders(rstl::vector< CCameraCollider >& out, f32 xMag, f32 zMag, void CBallCamera::SetupColliders(rstl::vector< CCameraCollider >& out, f32 xMag, f32 zMag,
f32 radius, int count, f32 k, f32 max, f32 startAngle) { f32 radius, int count, f32 k, f32 max, f32 startAngle) {
out.reserve(count); out.reserve(count);