mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #41 from lioncash/const
RuntimeCommon: Use const on member functions where applicable
This commit is contained in:
commit
2ace76e3d2
|
@ -972,7 +972,7 @@ float CAutoMapper::GetDesiredMiniMapCameraDistance(const CStateManager& mgr) con
|
||||||
std::tan(M_PIF / 2.f - 0.5f * 2.f * M_PIF * (xa8_renderStates[0].x1c_camAngle / 360.f));
|
std::tan(M_PIF / 2.f - 0.5f * 2.f * M_PIF * (xa8_renderStates[0].x1c_camAngle / 360.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
float CAutoMapper::GetClampedMapScreenCameraDistance(float v) {
|
float CAutoMapper::GetClampedMapScreenCameraDistance(float v) const {
|
||||||
if (x1bc_state == EAutoMapperState::MapScreenUniverse)
|
if (x1bc_state == EAutoMapperState::MapScreenUniverse)
|
||||||
return zeus::clamp(g_tweakAutoMapper->GetMinUniverseCamDist(), v, g_tweakAutoMapper->GetMaxUniverseCamDist());
|
return zeus::clamp(g_tweakAutoMapper->GetMinUniverseCamDist(), v, g_tweakAutoMapper->GetMaxUniverseCamDist());
|
||||||
return zeus::clamp(g_tweakAutoMapper->GetMinCamDist(), v, g_tweakAutoMapper->GetMaxCamDist());
|
return zeus::clamp(g_tweakAutoMapper->GetMinCamDist(), v, g_tweakAutoMapper->GetMaxCamDist());
|
||||||
|
|
|
@ -202,7 +202,7 @@ private:
|
||||||
static float GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager&);
|
static float GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager&);
|
||||||
float GetDesiredMiniMapCameraDistance(const CStateManager&) const;
|
float GetDesiredMiniMapCameraDistance(const CStateManager&) const;
|
||||||
static float GetBaseMapScreenCameraMoveSpeed();
|
static float GetBaseMapScreenCameraMoveSpeed();
|
||||||
float GetClampedMapScreenCameraDistance(float);
|
float GetClampedMapScreenCameraDistance(float) const;
|
||||||
float GetFinalMapScreenCameraMoveSpeed() const;
|
float GetFinalMapScreenCameraMoveSpeed() const;
|
||||||
void ProcessMapRotateInput(const CFinalInput& input, const CStateManager& mgr);
|
void ProcessMapRotateInput(const CFinalInput& input, const CStateManager& mgr);
|
||||||
void ProcessMapZoomInput(const CFinalInput& input, const CStateManager& mgr);
|
void ProcessMapZoomInput(const CFinalInput& input, const CStateManager& mgr);
|
||||||
|
|
|
@ -19,7 +19,7 @@ CMappableObject::CMappableObject(const void* buf) {
|
||||||
x10_transform.read34RowMajor(r);
|
x10_transform.read34RowMajor(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CTransform CMappableObject::AdjustTransformForType() {
|
zeus::CTransform CMappableObject::AdjustTransformForType() const {
|
||||||
const float doorCenterX = g_tweakAutoMapper->GetDoorCenter().x();
|
const float doorCenterX = g_tweakAutoMapper->GetDoorCenter().x();
|
||||||
const float doorCenterZ = g_tweakAutoMapper->GetDoorCenter().z();
|
const float doorCenterZ = g_tweakAutoMapper->GetDoorCenter().z();
|
||||||
if (x0_type == EMappableObjectType::BigDoor1) {
|
if (x0_type == EMappableObjectType::BigDoor1) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ private:
|
||||||
std::optional<DoorSurface> m_doorSurface;
|
std::optional<DoorSurface> m_doorSurface;
|
||||||
std::optional<CTexturedQuadFilter> m_texQuadFilter;
|
std::optional<CTexturedQuadFilter> m_texQuadFilter;
|
||||||
|
|
||||||
zeus::CTransform AdjustTransformForType();
|
zeus::CTransform AdjustTransformForType() const;
|
||||||
std::pair<zeus::CColor, zeus::CColor> GetDoorColors(int idx, const CMapWorldInfo& mwInfo, float alpha) const;
|
std::pair<zeus::CColor, zeus::CColor> GetDoorColors(int idx, const CMapWorldInfo& mwInfo, float alpha) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -16,7 +16,7 @@ public:
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
void Clear() { m_list.clear(); }
|
void Clear() { m_list.clear(); }
|
||||||
operator bool() { return m_list.size() != 0; }
|
operator bool() const { return m_list.size() != 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
return AsyncSeekRead(buf, len, ESeekOrigin::Cur, 0, std::move(cb));
|
return AsyncSeekRead(buf, len, ESeekOrigin::Cur, 0, std::move(cb));
|
||||||
}
|
}
|
||||||
u32 SyncRead(void* buf, u32 len) { return m_reader->readBytesToBuf(buf, len); }
|
u32 SyncRead(void* buf, u32 len) { return m_reader->readBytesToBuf(buf, len); }
|
||||||
u64 Length() { return m_reader->length(); }
|
u64 Length() const { return m_reader->length(); }
|
||||||
std::string_view GetPath() const { return x18_path; }
|
std::string_view GetPath() const { return x18_path; }
|
||||||
};
|
};
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -90,8 +90,8 @@ public:
|
||||||
CGameState();
|
CGameState();
|
||||||
CGameState(CBitStreamReader& stream, u32 saveIdx);
|
CGameState(CBitStreamReader& stream, u32 saveIdx);
|
||||||
void SetCurrentWorldId(CAssetId id);
|
void SetCurrentWorldId(CAssetId id);
|
||||||
std::shared_ptr<CPlayerState> GetPlayerState() { return x98_playerState; }
|
std::shared_ptr<CPlayerState> GetPlayerState() const { return x98_playerState; }
|
||||||
std::shared_ptr<CWorldTransManager> GetWorldTransitionManager() { return x9c_transManager; }
|
std::shared_ptr<CWorldTransManager> GetWorldTransitionManager() const { return x9c_transManager; }
|
||||||
void SetTotalPlayTime(float time);
|
void SetTotalPlayTime(float time);
|
||||||
CPersistentOptions& SystemOptions() { return xa8_systemOptions; }
|
CPersistentOptions& SystemOptions() { return xa8_systemOptions; }
|
||||||
CGameOptions& GameOptions() { return x17c_gameOptions; }
|
CGameOptions& GameOptions() { return x17c_gameOptions; }
|
||||||
|
|
|
@ -118,19 +118,19 @@ void CResLoader::GetTagListForFile(const char* pakName, std::vector<SObjectTag>&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CResLoader::GetResourceCompression(const SObjectTag& tag) {
|
bool CResLoader::GetResourceCompression(const SObjectTag& tag) const {
|
||||||
if (FindResource(tag.id))
|
if (FindResource(tag.id))
|
||||||
return x50_cachedResInfo->IsCompressed();
|
return x50_cachedResInfo->IsCompressed();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 CResLoader::ResourceSize(const SObjectTag& tag) {
|
u32 CResLoader::ResourceSize(const SObjectTag& tag) const {
|
||||||
if (FindResource(tag.id))
|
if (FindResource(tag.id))
|
||||||
return x50_cachedResInfo->GetSize();
|
return x50_cachedResInfo->GetSize();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CResLoader::ResourceExists(const SObjectTag& tag) { return FindResource(tag.id); }
|
bool CResLoader::ResourceExists(const SObjectTag& tag) const { return FindResource(tag.id); }
|
||||||
|
|
||||||
FourCC CResLoader::GetResourceTypeById(CAssetId id) const {
|
FourCC CResLoader::GetResourceTypeById(CAssetId id) const {
|
||||||
if (id.IsValid() && FindResource(id))
|
if (id.IsValid() && FindResource(id))
|
||||||
|
|
|
@ -36,9 +36,9 @@ public:
|
||||||
std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag);
|
std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag);
|
||||||
std::unique_ptr<u8[]> LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off, u32 size);
|
std::unique_ptr<u8[]> LoadNewResourcePartSync(const urde::SObjectTag& tag, u32 off, u32 size);
|
||||||
void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const;
|
void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const;
|
||||||
bool GetResourceCompression(const SObjectTag& tag);
|
bool GetResourceCompression(const SObjectTag& tag) const;
|
||||||
u32 ResourceSize(const SObjectTag& tag);
|
u32 ResourceSize(const SObjectTag& tag) const;
|
||||||
bool ResourceExists(const SObjectTag& tag);
|
bool ResourceExists(const SObjectTag& tag) const;
|
||||||
FourCC GetResourceTypeById(CAssetId id) const;
|
FourCC GetResourceTypeById(CAssetId id) const;
|
||||||
const SObjectTag* GetResourceIdByName(std::string_view name) const;
|
const SObjectTag* GetResourceIdByName(std::string_view name) const;
|
||||||
bool AreAllPaksLoaded() const;
|
bool AreAllPaksLoaded() const;
|
||||||
|
|
|
@ -374,7 +374,7 @@ TAreaId CStateManager::GetVisAreaId() const {
|
||||||
return curArea;
|
return curArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 CStateManager::GetWeaponIdCount(TUniqueId uid, EWeaponType type) {
|
s32 CStateManager::GetWeaponIdCount(TUniqueId uid, EWeaponType type) const {
|
||||||
return x878_weaponManager->GetNumActive(uid, type);
|
return x878_weaponManager->GetNumActive(uid, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ public:
|
||||||
void AddDrawableActor(const CActor& actor, const zeus::CVector3f& vec, const zeus::CAABox& aabb) const;
|
void AddDrawableActor(const CActor& actor, const zeus::CVector3f& vec, const zeus::CAABox& aabb) const;
|
||||||
bool SpecialSkipCinematic();
|
bool SpecialSkipCinematic();
|
||||||
TAreaId GetVisAreaId() const;
|
TAreaId GetVisAreaId() const;
|
||||||
s32 GetWeaponIdCount(TUniqueId, EWeaponType);
|
s32 GetWeaponIdCount(TUniqueId, EWeaponType) const;
|
||||||
void RemoveWeaponId(TUniqueId, EWeaponType);
|
void RemoveWeaponId(TUniqueId, EWeaponType);
|
||||||
void AddWeaponId(TUniqueId, EWeaponType);
|
void AddWeaponId(TUniqueId, EWeaponType);
|
||||||
void UpdateEscapeSequenceTimer(float);
|
void UpdateEscapeSequenceTimer(float);
|
||||||
|
@ -368,17 +368,23 @@ public:
|
||||||
|
|
||||||
const std::shared_ptr<CPlayerState>& GetPlayerState() const { return x8b8_playerState; }
|
const std::shared_ptr<CPlayerState>& GetPlayerState() const { return x8b8_playerState; }
|
||||||
CRandom16* GetActiveRandom() { return x900_activeRandom; }
|
CRandom16* GetActiveRandom() { return x900_activeRandom; }
|
||||||
|
const CRandom16* GetActiveRandom() const { return x900_activeRandom; }
|
||||||
zeus::CVector3f Random2f(float scaleMin, float scaleMax);
|
zeus::CVector3f Random2f(float scaleMin, float scaleMax);
|
||||||
void SetActiveRandomToDefault() { x900_activeRandom = &x8fc_random; }
|
void SetActiveRandomToDefault() { x900_activeRandom = &x8fc_random; }
|
||||||
void ClearActiveRandom() { x900_activeRandom = nullptr; }
|
void ClearActiveRandom() { x900_activeRandom = nullptr; }
|
||||||
CRumbleManager& GetRumbleManager() { return *x88c_rumbleManager; }
|
CRumbleManager& GetRumbleManager() { return *x88c_rumbleManager; }
|
||||||
|
const CRumbleManager& GetRumbleManager() const { return *x88c_rumbleManager; }
|
||||||
CCameraFilterPassPoly& GetCameraFilterPass(int idx) { return xb84_camFilterPasses[idx]; }
|
CCameraFilterPassPoly& GetCameraFilterPass(int idx) { return xb84_camFilterPasses[idx]; }
|
||||||
|
const CCameraFilterPassPoly& GetCameraFilterPass(int idx) const { return xb84_camFilterPasses[idx]; }
|
||||||
CCameraBlurPass& GetCameraBlurPass(int idx) { return xd14_camBlurPasses[idx]; }
|
CCameraBlurPass& GetCameraBlurPass(int idx) { return xd14_camBlurPasses[idx]; }
|
||||||
|
const CCameraBlurPass& GetCameraBlurPass(int idx) const { return xd14_camBlurPasses[idx]; }
|
||||||
|
|
||||||
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
|
CEnvFxManager* GetEnvFxManager() { return x880_envFxManager; }
|
||||||
|
const CEnvFxManager* GetEnvFxManager() const { return x880_envFxManager; }
|
||||||
CWorld* WorldNC() { return x850_world.get(); }
|
CWorld* WorldNC() { return x850_world.get(); }
|
||||||
const CWorld* GetWorld() const { return x850_world.get(); }
|
const CWorld* GetWorld() const { return x850_world.get(); }
|
||||||
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
|
CRelayTracker* GetRelayTracker() { return x8bc_relayTracker.get(); }
|
||||||
|
const CRelayTracker* GetRelayTracker() const { return x8bc_relayTracker.get(); }
|
||||||
CCameraManager* GetCameraManager() const { return x870_cameraManager; }
|
CCameraManager* GetCameraManager() const { return x870_cameraManager; }
|
||||||
CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
|
CFluidPlaneManager* GetFluidPlaneManager() const { return x87c_fluidPlaneManager; }
|
||||||
CActorModelParticles* GetActorModelParticles() const { return x884_actorModelParticles; }
|
CActorModelParticles* GetActorModelParticles() const { return x884_actorModelParticles; }
|
||||||
|
|
|
@ -533,7 +533,7 @@ void CCameraManager::UpdateListener(CStateManager& mgr) {
|
||||||
CSfxManager::UpdateListener(xf.origin, zeus::skZero3f, xf.frontVector(), xf.upVector(), 1.f);
|
CSfxManager::UpdateListener(xf.origin, zeus::skZero3f, xf.frontVector(), xf.upVector(), 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float CCameraManager::CalculateFogDensity(CStateManager& mgr, const CScriptWater* water) {
|
float CCameraManager::CalculateFogDensity(CStateManager& mgr, const CScriptWater* water) const {
|
||||||
float distanceFactor = 1.f - water->GetFluidPlane().GetAlpha();
|
float distanceFactor = 1.f - water->GetFluidPlane().GetAlpha();
|
||||||
float distance = 0;
|
float distance = 0;
|
||||||
if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::GravitySuit))
|
if (mgr.GetPlayerState()->HasPowerUp(CPlayerState::EItemType::GravitySuit))
|
||||||
|
|
|
@ -116,8 +116,13 @@ public:
|
||||||
void SkipCinematic(CStateManager& stateMgr);
|
void SkipCinematic(CStateManager& stateMgr);
|
||||||
|
|
||||||
CFirstPersonCamera* GetFirstPersonCamera() { return x7c_fpCamera; }
|
CFirstPersonCamera* GetFirstPersonCamera() { return x7c_fpCamera; }
|
||||||
|
const CFirstPersonCamera* GetFirstPersonCamera() const { return x7c_fpCamera; }
|
||||||
|
|
||||||
CBallCamera* GetBallCamera() { return x80_ballCamera; }
|
CBallCamera* GetBallCamera() { return x80_ballCamera; }
|
||||||
|
const CBallCamera* GetBallCamera() const { return x80_ballCamera; }
|
||||||
|
|
||||||
CGameArea::CAreaFog& Fog() { return x3c_fog; }
|
CGameArea::CAreaFog& Fog() { return x3c_fog; }
|
||||||
|
const CGameArea::CAreaFog& Fog() const { return x3c_fog; }
|
||||||
|
|
||||||
float GetCameraBobMagnitude() const;
|
float GetCameraBobMagnitude() const;
|
||||||
|
|
||||||
|
@ -127,7 +132,7 @@ public:
|
||||||
void UpdateRumble(float dt, CStateManager& mgr);
|
void UpdateRumble(float dt, CStateManager& mgr);
|
||||||
void UpdateListener(CStateManager& mgr);
|
void UpdateListener(CStateManager& mgr);
|
||||||
|
|
||||||
float CalculateFogDensity(CStateManager&, const CScriptWater*);
|
float CalculateFogDensity(CStateManager&, const CScriptWater*) const;
|
||||||
void SetFogDensity(float, float);
|
void SetFogDensity(float, float);
|
||||||
|
|
||||||
void ProcessInput(const CFinalInput& input, CStateManager& stateMgr);
|
void ProcessInput(const CFinalInput& input, CStateManager& stateMgr);
|
||||||
|
|
|
@ -67,7 +67,7 @@ void CFirstPersonCamera::SkipCinematic() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFirstPersonCamera::CalculateGunFollowOrientationAndTransform(zeus::CTransform& gunXf, zeus::CQuaternion& gunQ,
|
void CFirstPersonCamera::CalculateGunFollowOrientationAndTransform(zeus::CTransform& gunXf, zeus::CQuaternion& gunQ,
|
||||||
float dt, zeus::CVector3f& rVec) {
|
float dt, zeus::CVector3f& rVec) const {
|
||||||
zeus::CVector3f gunFrontVec = x190_gunFollowXf.frontVector();
|
zeus::CVector3f gunFrontVec = x190_gunFollowXf.frontVector();
|
||||||
gunFrontVec.z() = 0.f;
|
gunFrontVec.z() = 0.f;
|
||||||
if (gunFrontVec.canBeNormalized())
|
if (gunFrontVec.canBeNormalized())
|
||||||
|
|
|
@ -28,7 +28,7 @@ public:
|
||||||
const zeus::CTransform& GetGunFollowTransform() const { return x190_gunFollowXf; }
|
const zeus::CTransform& GetGunFollowTransform() const { return x190_gunFollowXf; }
|
||||||
void UpdateTransform(CStateManager& mgr, float dt);
|
void UpdateTransform(CStateManager& mgr, float dt);
|
||||||
void UpdateElevation(CStateManager& mgr);
|
void UpdateElevation(CStateManager& mgr);
|
||||||
void CalculateGunFollowOrientationAndTransform(zeus::CTransform&, zeus::CQuaternion&, float, zeus::CVector3f&);
|
void CalculateGunFollowOrientationAndTransform(zeus::CTransform&, zeus::CQuaternion&, float, zeus::CVector3f&) const;
|
||||||
void SetScriptPitchId(TUniqueId uid) { x1c4_pitchId = uid; }
|
void SetScriptPitchId(TUniqueId uid) { x1c4_pitchId = uid; }
|
||||||
void SetLockCamera(bool v) { x18c_lockCamera = v; }
|
void SetLockCamera(bool v) { x18c_lockCamera = v; }
|
||||||
void DeferBallTransitionProcessing() { x1c6_24_deferBallTransitionProcessing = true; }
|
void DeferBallTransitionProcessing() { x1c6_24_deferBallTransitionProcessing = true; }
|
||||||
|
|
|
@ -63,7 +63,8 @@ zeus::CVector3f CGameCamera::ConvertToScreenSpace(const zeus::CVector3f& v) cons
|
||||||
return mtx.multiplyOneOverW(rVec);
|
return mtx.multiplyOneOverW(rVec);
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& newXf, const zeus::CTransform& oldXf) {
|
zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& newXf,
|
||||||
|
const zeus::CTransform& oldXf) const {
|
||||||
zeus::CTransform xfCpy(newXf);
|
zeus::CTransform xfCpy(newXf);
|
||||||
if (!zeus::close_enough(newXf.rightVector().magnitude(), 1.f) ||
|
if (!zeus::close_enough(newXf.rightVector().magnitude(), 1.f) ||
|
||||||
!zeus::close_enough(newXf.frontVector().magnitude(), 1.f) ||
|
!zeus::close_enough(newXf.frontVector().magnitude(), 1.f) ||
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
|
|
||||||
zeus::CMatrix4f GetPerspectiveMatrix() const;
|
zeus::CMatrix4f GetPerspectiveMatrix() const;
|
||||||
zeus::CVector3f ConvertToScreenSpace(const zeus::CVector3f&) const;
|
zeus::CVector3f ConvertToScreenSpace(const zeus::CVector3f&) const;
|
||||||
zeus::CTransform ValidateCameraTransform(const zeus::CTransform&, const zeus::CTransform&);
|
zeus::CTransform ValidateCameraTransform(const zeus::CTransform&, const zeus::CTransform&) const;
|
||||||
float GetNearClipDistance() const { return x160_znear; }
|
float GetNearClipDistance() const { return x160_znear; }
|
||||||
float GetFarClipDistance() const { return x164_zfar; }
|
float GetFarClipDistance() const { return x164_zfar; }
|
||||||
float GetAspectRatio() const { return x168_aspect; }
|
float GetAspectRatio() const { return x168_aspect; }
|
||||||
|
|
|
@ -31,7 +31,7 @@ void CABSAim::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
x4_needsIdle = true;
|
x4_needsIdle = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSAim::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CABSAim::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
|
||||||
return pas::EAnimationState::AdditiveReaction;
|
return pas::EAnimationState::AdditiveReaction;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveFlinch))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveFlinch))
|
||||||
|
@ -42,7 +42,7 @@ pas::EAnimationState CABSAim::GetBodyStateTransition(float dt, CBodyController&
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSAim::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
|
pas::EAnimationState CABSAim::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
|
||||||
pas::EAnimationState st = GetBodyStateTransition(dt, bc);
|
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
|
||||||
if (st == pas::EAnimationState::Invalid) {
|
if (st == pas::EAnimationState::Invalid) {
|
||||||
const zeus::CVector3f& target = bc.GetCommandMgr().GetAdditiveTargetVector();
|
const zeus::CVector3f& target = bc.GetCommandMgr().GetAdditiveTargetVector();
|
||||||
if (target.canBeNormalized()) {
|
if (target.canBeNormalized()) {
|
||||||
|
@ -106,14 +106,14 @@ void CABSFlinch::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
animData.AddAdditiveAnimation(x8_anim, x4_weight, false, true);
|
animData.AddAdditiveAnimation(x8_anim, x4_weight, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSFlinch::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CABSFlinch::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
|
||||||
return pas::EAnimationState::AdditiveReaction;
|
return pas::EAnimationState::AdditiveReaction;
|
||||||
return pas::EAnimationState::Invalid;
|
return pas::EAnimationState::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSFlinch::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
|
pas::EAnimationState CABSFlinch::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
|
||||||
pas::EAnimationState st = GetBodyStateTransition(dt, bc);
|
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
|
||||||
if (st == pas::EAnimationState::Invalid) {
|
if (st == pas::EAnimationState::Invalid) {
|
||||||
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
|
CAnimData& animData = *bc.GetOwner().ModelData()->AnimationData();
|
||||||
CCharAnimTime rem = animData.GetAdditiveAnimationTree(x8_anim)->VGetTimeRemaining();
|
CCharAnimTime rem = animData.GetAdditiveAnimationTree(x8_anim)->VGetTimeRemaining();
|
||||||
|
@ -123,7 +123,7 @@ pas::EAnimationState CABSFlinch::UpdateBody(float dt, CBodyController& bc, CStat
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSIdle::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CABSIdle::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction))
|
||||||
return pas::EAnimationState::AdditiveReaction;
|
return pas::EAnimationState::AdditiveReaction;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveFlinch))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveFlinch))
|
||||||
|
@ -154,14 +154,14 @@ void CABSReaction::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSReaction::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CABSReaction::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction) && xc_type == pas::EAdditiveReactionType::IceBreakout)
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveReaction) && xc_type == pas::EAdditiveReactionType::IceBreakout)
|
||||||
return pas::EAnimationState::AdditiveReaction;
|
return pas::EAnimationState::AdditiveReaction;
|
||||||
return pas::EAnimationState::Invalid;
|
return pas::EAnimationState::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CABSReaction::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
|
pas::EAnimationState CABSReaction::UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) {
|
||||||
pas::EAnimationState st = GetBodyStateTransition(dt, bc);
|
const pas::EAnimationState st = GetBodyStateTransition(dt, bc);
|
||||||
if (st == pas::EAnimationState::Invalid) {
|
if (st == pas::EAnimationState::Invalid) {
|
||||||
if (x8_anim == -1)
|
if (x8_anim == -1)
|
||||||
return pas::EAnimationState::AdditiveIdle;
|
return pas::EAnimationState::AdditiveIdle;
|
||||||
|
|
|
@ -26,7 +26,7 @@ class CABSAim : public CAdditiveBodyState {
|
||||||
float x2c_hWeightVel = 0.f;
|
float x2c_hWeightVel = 0.f;
|
||||||
float x30_vWeight = 0.f;
|
float x30_vWeight = 0.f;
|
||||||
float x34_vWeightVel = 0.f;
|
float x34_vWeightVel = 0.f;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
|
@ -37,7 +37,7 @@ public:
|
||||||
class CABSFlinch : public CAdditiveBodyState {
|
class CABSFlinch : public CAdditiveBodyState {
|
||||||
float x4_weight = 1.f;
|
float x4_weight = 1.f;
|
||||||
u32 x8_anim = 0;
|
u32 x8_anim = 0;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
|
@ -46,7 +46,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class CABSIdle : public CAdditiveBodyState {
|
class CABSIdle : public CAdditiveBodyState {
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override {}
|
void Start(CBodyController& bc, CStateManager& mgr) override {}
|
||||||
|
@ -59,7 +59,7 @@ class CABSReaction : public CAdditiveBodyState {
|
||||||
s32 x8_anim = -1;
|
s32 x8_anim = -1;
|
||||||
pas::EAdditiveReactionType xc_type = pas::EAdditiveReactionType::Invalid;
|
pas::EAdditiveReactionType xc_type = pas::EAdditiveReactionType::Invalid;
|
||||||
bool x10_active = false;
|
bool x10_active = false;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
void StopAnimation(CBodyController& bc);
|
void StopAnimation(CBodyController& bc);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -242,7 +242,7 @@ void CBSGetup::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSGetup::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSGetup::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -289,7 +289,7 @@ void CBSKnockBack::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
x4_curTime = 0.f;
|
x4_curTime = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSKnockBack::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSKnockBack::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -332,7 +332,7 @@ void CBSLieOnGround::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSLieOnGround::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSLieOnGround::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Die))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Die))
|
||||||
return pas::EAnimationState::Death;
|
return pas::EAnimationState::Death;
|
||||||
if (x4_24_hasGroundHit && bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockBack))
|
if (x4_24_hasGroundHit && bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockBack))
|
||||||
|
@ -355,7 +355,7 @@ void CBSStep::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
|
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSStep::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSStep::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -425,7 +425,7 @@ bool CBSTurn::FacingDest(CBodyController& bc) const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSTurn::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSTurn::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -526,7 +526,7 @@ void CBSLoopAttack::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSLoopAttack::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSLoopAttack::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -622,7 +622,7 @@ void CBSLoopReaction::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSLoopReaction::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSLoopReaction::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -734,7 +734,7 @@ void CBSGroundHit::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
xc_fallState = pas::EFallState(groundHitState->GetAnimParmData(best.second, 3).GetEnumValue());
|
xc_fallState = pas::EFallState(groundHitState->GetAnimParmData(best.second, 3).GetEnumValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSGroundHit::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSGroundHit::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.IsAnimationOver()) {
|
if (bc.IsAnimationOver()) {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Die))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Die))
|
||||||
return pas::EAnimationState::Death;
|
return pas::EAnimationState::Death;
|
||||||
|
@ -777,7 +777,7 @@ void CBSGenerate::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSGenerate::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSGenerate::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -819,7 +819,7 @@ void CBSJump::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSJump::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSJump::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -991,7 +991,7 @@ void CBSHurled::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
x2c_24_needsRecover = false;
|
x2c_24_needsRecover = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSHurled::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSHurled::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::NextState))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::NextState))
|
||||||
return pas::EAnimationState::LieOnGround;
|
return pas::EAnimationState::LieOnGround;
|
||||||
if (x18_curTime > 0.25f) {
|
if (x18_curTime > 0.25f) {
|
||||||
|
@ -1165,7 +1165,7 @@ void CBSSlide::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSSlide::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSSlide::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -1195,7 +1195,7 @@ void CBSTaunt::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
|
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSTaunt::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSTaunt::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -1227,7 +1227,7 @@ void CBSScripted::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
bc.SetCurrentAnimation(playParms, cmd->IsLooped(), false);
|
bc.SetCurrentAnimation(playParms, cmd->IsLooped(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSScripted::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSScripted::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -1275,7 +1275,7 @@ void CBSCover::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
xc_needsExit = true;
|
xc_needsExit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSCover::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSCover::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -1342,7 +1342,7 @@ void CBSWallHang::Start(CBodyController& bc, CStateManager& mgr) {
|
||||||
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
|
bc.PlayBestAnimation(parms, *mgr.GetActiveRandom());
|
||||||
}
|
}
|
||||||
|
|
||||||
pas::EAnimationState CBSWallHang::GetBodyStateTransition(float dt, CBodyController& bc) {
|
pas::EAnimationState CBSWallHang::GetBodyStateTransition(float dt, CBodyController& bc) const {
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Hurled))
|
||||||
return pas::EAnimationState::Hurled;
|
return pas::EAnimationState::Hurled;
|
||||||
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::KnockDown))
|
||||||
|
@ -1595,7 +1595,7 @@ bool CBSWallHang::ApplyGravity() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float CBSLocomotion::GetStartVelocityMagnitude(CBodyController& bc) {
|
float CBSLocomotion::GetStartVelocityMagnitude(const CBodyController& bc) const {
|
||||||
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
|
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
|
||||||
float maxSpeed = bc.GetBodyStateInfo().GetMaxSpeed();
|
float maxSpeed = bc.GetBodyStateInfo().GetMaxSpeed();
|
||||||
float ret = 0.f;
|
float ret = 0.f;
|
||||||
|
|
|
@ -77,7 +77,7 @@ public:
|
||||||
|
|
||||||
class CBSGetup : public CBodyState {
|
class CBSGetup : public CBodyState {
|
||||||
pas::EFallState x4_fallState = pas::EFallState::Invalid;
|
pas::EFallState x4_fallState = pas::EFallState::Invalid;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
|
@ -89,7 +89,7 @@ class CBSKnockBack : public CBodyState {
|
||||||
float x4_curTime = 0.f;
|
float x4_curTime = 0.f;
|
||||||
float x8_rotateSpeed = 0.f;
|
float x8_rotateSpeed = 0.f;
|
||||||
float xc_remTime = 0.f;
|
float xc_remTime = 0.f;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool IsMoving() const override { return true; }
|
bool IsMoving() const override { return true; }
|
||||||
|
@ -100,7 +100,7 @@ public:
|
||||||
|
|
||||||
class CBSLieOnGround : public CBodyState {
|
class CBSLieOnGround : public CBodyState {
|
||||||
bool x4_24_hasGroundHit : 1;
|
bool x4_24_hasGroundHit : 1;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CBSLieOnGround(CActor& actor);
|
CBSLieOnGround(CActor& actor);
|
||||||
|
@ -110,7 +110,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBSStep : public CBodyState {
|
class CBSStep : public CBodyState {
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool IsMoving() const override { return true; }
|
bool IsMoving() const override { return true; }
|
||||||
|
@ -132,7 +132,7 @@ public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
|
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
|
||||||
void Shutdown(CBodyController&) override {}
|
void Shutdown(CBodyController&) override {}
|
||||||
virtual pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
virtual pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBSFlyerTurn : public CBSTurn {
|
class CBSFlyerTurn : public CBSTurn {
|
||||||
|
@ -146,7 +146,7 @@ class CBSLoopAttack : public CBodyState {
|
||||||
pas::ELoopAttackType x8_loopAttackType = pas::ELoopAttackType::Invalid;
|
pas::ELoopAttackType x8_loopAttackType = pas::ELoopAttackType::Invalid;
|
||||||
bool xc_24_waitForAnimOver : 1;
|
bool xc_24_waitForAnimOver : 1;
|
||||||
bool xc_25_advance : 1;
|
bool xc_25_advance : 1;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CBSLoopAttack() {
|
CBSLoopAttack() {
|
||||||
|
@ -163,7 +163,7 @@ class CBSLoopReaction : public CBodyState {
|
||||||
pas::ELoopState x4_state = pas::ELoopState::Invalid;
|
pas::ELoopState x4_state = pas::ELoopState::Invalid;
|
||||||
pas::EReactionType x8_reactionType = pas::EReactionType::Invalid;
|
pas::EReactionType x8_reactionType = pas::EReactionType::Invalid;
|
||||||
bool xc_24_loopHit : 1;
|
bool xc_24_loopHit : 1;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
bool PlayExitAnimation(CBodyController& bc, CStateManager& mgr) const;
|
bool PlayExitAnimation(CBodyController& bc, CStateManager& mgr) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -177,7 +177,7 @@ class CBSGroundHit : public CBodyState {
|
||||||
float x4_rotateSpeed = 0.f;
|
float x4_rotateSpeed = 0.f;
|
||||||
float x8_remTime = 0.f;
|
float x8_remTime = 0.f;
|
||||||
pas::EFallState xc_fallState = pas::EFallState::Invalid;
|
pas::EFallState xc_fallState = pas::EFallState::Invalid;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
|
@ -186,7 +186,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBSGenerate : public CBodyState {
|
class CBSGenerate : public CBodyState {
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
|
@ -210,7 +210,7 @@ class CBSJump : public CBodyState {
|
||||||
};
|
};
|
||||||
u32 _dummy = 0;
|
u32 _dummy = 0;
|
||||||
};
|
};
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
bool CheckForWallJump(CBodyController& bc, CStateManager& mgr);
|
bool CheckForWallJump(CBodyController& bc, CStateManager& mgr);
|
||||||
void CheckForLand(CBodyController& bc, CStateManager& mgr);
|
void CheckForLand(CBodyController& bc, CStateManager& mgr);
|
||||||
void PlayJumpLoop(CStateManager& mgr, CBodyController& bc);
|
void PlayJumpLoop(CStateManager& mgr, CBodyController& bc);
|
||||||
|
@ -236,7 +236,7 @@ class CBSHurled : public CBodyState {
|
||||||
mutable zeus::CVector3f x1c_lastTranslation;
|
mutable zeus::CVector3f x1c_lastTranslation;
|
||||||
mutable float x28_landedDur = 0.f;
|
mutable float x28_landedDur = 0.f;
|
||||||
bool x2c_24_needsRecover : 1;
|
bool x2c_24_needsRecover : 1;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
void Recover(CStateManager& mgr, CBodyController& bc, pas::EHurledState state);
|
void Recover(CStateManager& mgr, CBodyController& bc, pas::EHurledState state);
|
||||||
void PlayStrikeWallAnimation(CBodyController& bc, CStateManager& mgr);
|
void PlayStrikeWallAnimation(CBodyController& bc, CStateManager& mgr);
|
||||||
void PlayLandAnimation(CBodyController& bc, CStateManager& mgr);
|
void PlayLandAnimation(CBodyController& bc, CStateManager& mgr);
|
||||||
|
@ -255,7 +255,7 @@ public:
|
||||||
|
|
||||||
class CBSSlide : public CBodyState {
|
class CBSSlide : public CBodyState {
|
||||||
float x4_rotateSpeed = 0.f;
|
float x4_rotateSpeed = 0.f;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool ApplyHeadTracking() const override { return false; }
|
bool ApplyHeadTracking() const override { return false; }
|
||||||
|
@ -266,7 +266,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBSTaunt : public CBodyState {
|
class CBSTaunt : public CBodyState {
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Start(CBodyController& bc, CStateManager& mgr) override;
|
void Start(CBodyController& bc, CStateManager& mgr) override;
|
||||||
|
@ -283,7 +283,7 @@ class CBSScripted : public CBodyState {
|
||||||
u32 _dummy = 0;
|
u32 _dummy = 0;
|
||||||
};
|
};
|
||||||
float x8_remTime = 0.f;
|
float x8_remTime = 0.f;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool ApplyHeadTracking() const override { return false; }
|
bool ApplyHeadTracking() const override { return false; }
|
||||||
|
@ -296,7 +296,7 @@ class CBSCover : public CBodyState {
|
||||||
pas::ECoverState x4_state = pas::ECoverState::Invalid;
|
pas::ECoverState x4_state = pas::ECoverState::Invalid;
|
||||||
pas::ECoverDirection x8_coverDirection = pas::ECoverDirection::Invalid;
|
pas::ECoverDirection x8_coverDirection = pas::ECoverDirection::Invalid;
|
||||||
bool xc_needsExit = false;
|
bool xc_needsExit = false;
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool ApplyHeadTracking() const override { return false; }
|
bool ApplyHeadTracking() const override { return false; }
|
||||||
|
@ -318,7 +318,7 @@ class CBSWallHang : public CBodyState {
|
||||||
};
|
};
|
||||||
u32 _dummy = 0;
|
u32 _dummy = 0;
|
||||||
};
|
};
|
||||||
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc);
|
pas::EAnimationState GetBodyStateTransition(float dt, CBodyController& bc) const;
|
||||||
void FixInPlace(CBodyController& bc);
|
void FixInPlace(CBodyController& bc);
|
||||||
bool CheckForLand(CBodyController& bc, CStateManager& mgr);
|
bool CheckForLand(CBodyController& bc, CStateManager& mgr);
|
||||||
bool CheckForWall(CBodyController& bc, CStateManager& mgr);
|
bool CheckForWall(CBodyController& bc, CStateManager& mgr);
|
||||||
|
@ -339,7 +339,7 @@ public:
|
||||||
class CBSLocomotion : public CBodyState {
|
class CBSLocomotion : public CBodyState {
|
||||||
protected:
|
protected:
|
||||||
pas::ELocomotionType x4_locomotionType = pas::ELocomotionType::Invalid;
|
pas::ELocomotionType x4_locomotionType = pas::ELocomotionType::Invalid;
|
||||||
float GetStartVelocityMagnitude(CBodyController& bc);
|
float GetStartVelocityMagnitude(const CBodyController& bc) const;
|
||||||
void ReStartBodyState(CBodyController& bc, bool maintainVel);
|
void ReStartBodyState(CBodyController& bc, bool maintainVel);
|
||||||
float ComputeWeightPercentage(const std::pair<s32, float>& a, const std::pair<s32, float>& b, float f) const;
|
float ComputeWeightPercentage(const std::pair<s32, float>& a, const std::pair<s32, float>& b, float f) const;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ CBodyStateInfo::CBodyStateInfo(CActor& actor, EBodyType type) {
|
||||||
x1c_additiveStates.push_back({pas::EAnimationState::AdditiveReaction, std::make_unique<CABSReaction>()});
|
x1c_additiveStates.push_back({pas::EAnimationState::AdditiveReaction, std::make_unique<CABSReaction>()});
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedFlyerBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedFlyerBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
@ -92,7 +92,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedFlyerBodyStates(int s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupNewFlyerBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupNewFlyerBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
@ -137,7 +137,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupNewFlyerBodyStates(int stateId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupWallWalkerBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupWallWalkerBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
@ -182,7 +182,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupWallWalkerBodyStates(int stateI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupPitchableBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupPitchableBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
@ -227,7 +227,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupPitchableBodyStates(int stateId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupFlyerBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupFlyerBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
@ -272,7 +272,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupFlyerBodyStates(int stateId, CA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
@ -319,7 +319,7 @@ std::unique_ptr<CBodyState> CBodyStateInfo::SetupRestrictedBodyStates(int stateI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CBodyState> CBodyStateInfo::SetupBiPedalBodyStates(int stateId, CActor& actor) {
|
std::unique_ptr<CBodyState> CBodyStateInfo::SetupBiPedalBodyStates(int stateId, CActor& actor) const {
|
||||||
switch (stateId) {
|
switch (stateId) {
|
||||||
case 0:
|
case 0:
|
||||||
return std::make_unique<CBSFall>();
|
return std::make_unique<CBSFall>();
|
||||||
|
|
|
@ -17,13 +17,13 @@ class CBodyStateInfo {
|
||||||
pas::EAnimationState x2c_additiveState = pas::EAnimationState::AdditiveIdle;
|
pas::EAnimationState x2c_additiveState = pas::EAnimationState::AdditiveIdle;
|
||||||
float x30_maxPitch = 0.f;
|
float x30_maxPitch = 0.f;
|
||||||
bool x34_24_changeLocoAtEndOfAnimOnly;
|
bool x34_24_changeLocoAtEndOfAnimOnly;
|
||||||
std::unique_ptr<CBodyState> SetupRestrictedFlyerBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupRestrictedFlyerBodyStates(int stateId, CActor& actor) const;
|
||||||
std::unique_ptr<CBodyState> SetupNewFlyerBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupNewFlyerBodyStates(int stateId, CActor& actor) const;
|
||||||
std::unique_ptr<CBodyState> SetupWallWalkerBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupWallWalkerBodyStates(int stateId, CActor& actor) const;
|
||||||
std::unique_ptr<CBodyState> SetupPitchableBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupPitchableBodyStates(int stateId, CActor& actor) const;
|
||||||
std::unique_ptr<CBodyState> SetupFlyerBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupFlyerBodyStates(int stateId, CActor& actor) const;
|
||||||
std::unique_ptr<CBodyState> SetupRestrictedBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupRestrictedBodyStates(int stateId, CActor& actor) const;
|
||||||
std::unique_ptr<CBodyState> SetupBiPedalBodyStates(int stateId, CActor& actor);
|
std::unique_ptr<CBodyState> SetupBiPedalBodyStates(int stateId, CActor& actor) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CBodyStateInfo(CActor& actor, EBodyType type);
|
CBodyStateInfo(CActor& actor, EBodyType type);
|
||||||
|
|
|
@ -54,7 +54,7 @@ const u8* CFBStreamedCompression::GetBitstreamPointer() const {
|
||||||
return chans;
|
return chans;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words, CInputStream& in) {
|
std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words, CInputStream& in) const {
|
||||||
std::unique_ptr<u32[]> ret(new u32[words]);
|
std::unique_ptr<u32[]> ret(new u32[words]);
|
||||||
|
|
||||||
Header head;
|
Header head;
|
||||||
|
@ -80,7 +80,7 @@ std::unique_ptr<u32[]> CFBStreamedCompression::GetRotationsAndOffsets(u32 words,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in) {
|
u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in) const {
|
||||||
u32 boneChanCount = in.readUint32Big();
|
u32 boneChanCount = in.readUint32Big();
|
||||||
*reinterpret_cast<u32*>(out) = boneChanCount;
|
*reinterpret_cast<u32*>(out) = boneChanCount;
|
||||||
out += 4;
|
out += 4;
|
||||||
|
@ -142,7 +142,7 @@ u8* CFBStreamedCompression::ReadBoneChannelDescriptors(u8* out, CInputStream& in
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 CFBStreamedCompression::ComputeBitstreamWords(const u8* chans) {
|
u32 CFBStreamedCompression::ComputeBitstreamWords(const u8* chans) const {
|
||||||
u32 boneChanCount = *reinterpret_cast<const u32*>(chans);
|
u32 boneChanCount = *reinterpret_cast<const u32*>(chans);
|
||||||
chans += 4;
|
chans += 4;
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ u32 CFBStreamedCompression::ComputeBitstreamWords(const u8* chans) {
|
||||||
return (totalBits * keyCount + 31) / 32;
|
return (totalBits * keyCount + 31) / 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CFBStreamedCompression::CalculateAverageVelocity(const u8* chans) {
|
float CFBStreamedCompression::CalculateAverageVelocity(const u8* chans) const {
|
||||||
u32 boneChanCount = *reinterpret_cast<const u32*>(chans);
|
u32 boneChanCount = *reinterpret_cast<const u32*>(chans);
|
||||||
chans += 4;
|
chans += 4;
|
||||||
|
|
||||||
|
|
|
@ -56,10 +56,10 @@ private:
|
||||||
float x10_averageVelocity;
|
float x10_averageVelocity;
|
||||||
zeus::CVector3f x14_rootOffset;
|
zeus::CVector3f x14_rootOffset;
|
||||||
|
|
||||||
u8* ReadBoneChannelDescriptors(u8* out, CInputStream& in);
|
u8* ReadBoneChannelDescriptors(u8* out, CInputStream& in) const;
|
||||||
u32 ComputeBitstreamWords(const u8* chans);
|
u32 ComputeBitstreamWords(const u8* chans) const;
|
||||||
std::unique_ptr<u32[]> GetRotationsAndOffsets(u32 words, CInputStream& in);
|
std::unique_ptr<u32[]> GetRotationsAndOffsets(u32 words, CInputStream& in) const;
|
||||||
float CalculateAverageVelocity(const u8* chans);
|
float CalculateAverageVelocity(const u8* chans) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CFBStreamedCompression(CInputStream& in, IObjectStore& objStore, bool pc);
|
CFBStreamedCompression(CInputStream& in, IObjectStore& objStore, bool pc);
|
||||||
|
|
|
@ -154,7 +154,7 @@ void CModelData::SetInfraModel(const std::pair<CAssetId, CAssetId>& modelSkin) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CModelData::IsDefinitelyOpaque(EWhichModel which) {
|
bool CModelData::IsDefinitelyOpaque(EWhichModel which) const {
|
||||||
if (x10_animData) {
|
if (x10_animData) {
|
||||||
CSkinnedModel& model = PickAnimatedModel(which);
|
CSkinnedModel& model = PickAnimatedModel(which);
|
||||||
return model.GetModelInst()->IsOpaque();
|
return model.GetModelInst()->IsOpaque();
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
const std::unique_ptr<CBooModel>& PickStaticModel(EWhichModel which) const;
|
const std::unique_ptr<CBooModel>& PickStaticModel(EWhichModel which) const;
|
||||||
void SetXRayModel(const std::pair<CAssetId, CAssetId>& modelSkin);
|
void SetXRayModel(const std::pair<CAssetId, CAssetId>& modelSkin);
|
||||||
void SetInfraModel(const std::pair<CAssetId, CAssetId>& modelSkin);
|
void SetInfraModel(const std::pair<CAssetId, CAssetId>& modelSkin);
|
||||||
bool IsDefinitelyOpaque(EWhichModel);
|
bool IsDefinitelyOpaque(EWhichModel) const;
|
||||||
bool GetIsLoop() const;
|
bool GetIsLoop() const;
|
||||||
float GetAnimationDuration(int) const;
|
float GetAnimationDuration(int) const;
|
||||||
void EnableLooping(bool);
|
void EnableLooping(bool);
|
||||||
|
@ -144,7 +144,7 @@ public:
|
||||||
void SetScale(const zeus::CVector3f& scale) { x0_scale = scale; }
|
void SetScale(const zeus::CVector3f& scale) { x0_scale = scale; }
|
||||||
bool HasAnimData() const { return x10_animData != nullptr; }
|
bool HasAnimData() const { return x10_animData != nullptr; }
|
||||||
bool HasNormalModel() const { return x1c_normalModel; }
|
bool HasNormalModel() const { return x1c_normalModel; }
|
||||||
bool HasModel(EWhichModel which) {
|
bool HasModel(EWhichModel which) const {
|
||||||
if (x10_animData) {
|
if (x10_animData) {
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case EWhichModel::Normal:
|
case EWhichModel::Normal:
|
||||||
|
|
|
@ -15,6 +15,7 @@ public:
|
||||||
void Add(const CSegIdList& list, const CCharLayoutInfo& layout, const CSegStatementSet& other, float weight);
|
void Add(const CSegIdList& list, const CCharLayoutInfo& layout, const CSegStatementSet& other, float weight);
|
||||||
|
|
||||||
CAnimPerSegmentData& operator[](const CSegId& idx) { return x4_segData[idx]; }
|
CAnimPerSegmentData& operator[](const CSegId& idx) { return x4_segData[idx]; }
|
||||||
|
const CAnimPerSegmentData& operator[](const CSegId& idx) const { return x4_segData[idx]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -116,7 +116,7 @@ public:
|
||||||
|
|
||||||
bool HasMaterial(EMaterialTypes type) const { return (x0_list & (1ull << u64(type))) != 0; }
|
bool HasMaterial(EMaterialTypes type) const { return (x0_list & (1ull << u64(type))) != 0; }
|
||||||
|
|
||||||
bool SharesMaterials(const CMaterialList& other) {
|
bool SharesMaterials(const CMaterialList& other) const {
|
||||||
for (u32 i = 0; i < 64; i++) {
|
for (u32 i = 0; i < 64; i++) {
|
||||||
if ((x0_list & (1ull << i)) != 0 && (other.x0_list & (1ull << i)) != 0)
|
if ((x0_list & (1ull << i)) != 0 && (other.x0_list & (1ull << i)) != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -279,15 +279,15 @@ public:
|
||||||
void ReallyRenderFogVolume(const zeus::CColor& color, const zeus::CAABox& aabb, const CModel* model,
|
void ReallyRenderFogVolume(const zeus::CColor& color, const zeus::CAABox& aabb, const CModel* model,
|
||||||
const CSkinnedModel* sModel);
|
const CSkinnedModel* sModel);
|
||||||
|
|
||||||
const boo::ObjToken<boo::ITexture>& GetThermoPalette() { return x288_thermoPalette; }
|
const boo::ObjToken<boo::ITexture>& GetThermoPalette() const { return x288_thermoPalette; }
|
||||||
const boo::ObjToken<boo::ITextureS>& GetFogRampTex() { return x1b8_fogVolumeRamp; }
|
const boo::ObjToken<boo::ITextureS>& GetFogRampTex() const { return x1b8_fogVolumeRamp; }
|
||||||
const boo::ObjToken<boo::ITexture>& GetRandomStaticEntropyTex() const { return m_staticEntropy->GetBooTexture(); }
|
const boo::ObjToken<boo::ITexture>& GetRandomStaticEntropyTex() const { return m_staticEntropy->GetBooTexture(); }
|
||||||
const boo::ObjToken<boo::IGraphicsBufferS>& GetScanLinesEvenVBO() const { return m_scanLinesEvenVBO; }
|
const boo::ObjToken<boo::IGraphicsBufferS>& GetScanLinesEvenVBO() const { return m_scanLinesEvenVBO; }
|
||||||
const boo::ObjToken<boo::IGraphicsBufferS>& GetScanLinesOddVBO() const { return m_scanLinesOddVBO; }
|
const boo::ObjToken<boo::IGraphicsBufferS>& GetScanLinesOddVBO() const { return m_scanLinesOddVBO; }
|
||||||
|
|
||||||
const boo::ObjToken<boo::ITexture>& GetClearTexture() { return m_clearTexture; }
|
const boo::ObjToken<boo::ITexture>& GetClearTexture() const { return m_clearTexture; }
|
||||||
const boo::ObjToken<boo::ITexture>& GetBlackTexture() { return m_blackTexture; }
|
const boo::ObjToken<boo::ITexture>& GetBlackTexture() const { return m_blackTexture; }
|
||||||
const boo::ObjToken<boo::ITexture>& GetWhiteTexture() { return m_whiteTexture; }
|
const boo::ObjToken<boo::ITexture>& GetWhiteTexture() const { return m_whiteTexture; }
|
||||||
|
|
||||||
boo::ObjToken<boo::ITexture> GetColorTexture(const zeus::CColor& color);
|
boo::ObjToken<boo::ITexture> GetColorTexture(const zeus::CColor& color);
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ private:
|
||||||
EFontType m_ftype = EFontType::None;
|
EFontType m_ftype = EFontType::None;
|
||||||
std::string m_dolphinName;
|
std::string m_dolphinName;
|
||||||
|
|
||||||
size_t ComputeMippedTexelCount();
|
size_t ComputeMippedTexelCount() const;
|
||||||
size_t ComputeMippedBlockCountDXT1();
|
size_t ComputeMippedBlockCountDXT1() const;
|
||||||
void BuildI4FromGCN(CInputStream& in);
|
void BuildI4FromGCN(CInputStream& in);
|
||||||
void BuildI8FromGCN(CInputStream& in);
|
void BuildI8FromGCN(CInputStream& in);
|
||||||
void BuildIA4FromGCN(CInputStream& in);
|
void BuildIA4FromGCN(CInputStream& in);
|
||||||
|
|
|
@ -27,7 +27,7 @@ constexpr uint8_t Convert6To8(uint8_t v) {
|
||||||
return (v << 2) | (v >> 4);
|
return (v << 2) | (v >> 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CTexture::ComputeMippedTexelCount() {
|
size_t CTexture::ComputeMippedTexelCount() const {
|
||||||
size_t w = x4_w;
|
size_t w = x4_w;
|
||||||
size_t h = x6_h;
|
size_t h = x6_h;
|
||||||
size_t ret = w * h;
|
size_t ret = w * h;
|
||||||
|
@ -41,7 +41,7 @@ size_t CTexture::ComputeMippedTexelCount() {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CTexture::ComputeMippedBlockCountDXT1() {
|
size_t CTexture::ComputeMippedBlockCountDXT1() const {
|
||||||
size_t w = x4_w / 4;
|
size_t w = x4_w / 4;
|
||||||
size_t h = x6_h / 4;
|
size_t h = x6_h / 4;
|
||||||
size_t ret = w * h;
|
size_t ret = w * h;
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
~CGuiFrame();
|
~CGuiFrame();
|
||||||
|
|
||||||
CGuiSys& GetGuiSys() { return x8_guiSys; }
|
CGuiSys& GetGuiSys() { return x8_guiSys; }
|
||||||
|
const CGuiSys& GetGuiSys() const { return x8_guiSys; }
|
||||||
CAssetId GetAssetId() const { return x0_id; }
|
CAssetId GetAssetId() const { return x0_id; }
|
||||||
|
|
||||||
CGuiLight* GetFrameLight(int idx) const { return m_indexedLights[idx]; }
|
CGuiLight* GetFrameLight(int idx) const { return m_indexedLights[idx]; }
|
||||||
|
@ -100,6 +101,7 @@ public:
|
||||||
void ResetMouseState();
|
void ResetMouseState();
|
||||||
|
|
||||||
CGuiWidgetIdDB& GetWidgetIdDB() { return x18_idDB; }
|
CGuiWidgetIdDB& GetWidgetIdDB() { return x18_idDB; }
|
||||||
|
const CGuiWidgetIdDB& GetWidgetIdDB() const { return x18_idDB; }
|
||||||
|
|
||||||
static std::unique_ptr<CGuiFrame> CreateFrame(CAssetId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp);
|
static std::unique_ptr<CGuiFrame> CreateFrame(CAssetId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp);
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,8 @@ void CGuiGroup::SelectWorkerWidget(int workerId, bool setActive, bool setVisible
|
||||||
|
|
||||||
CGuiWidget* CGuiGroup::GetSelectedWidget() { return GetWorkerWidget(xbc_selectedWorker); }
|
CGuiWidget* CGuiGroup::GetSelectedWidget() { return GetWorkerWidget(xbc_selectedWorker); }
|
||||||
|
|
||||||
|
const CGuiWidget* CGuiGroup::GetSelectedWidget() const { return GetWorkerWidget(xbc_selectedWorker); }
|
||||||
|
|
||||||
bool CGuiGroup::AddWorkerWidget(CGuiWidget* worker) {
|
bool CGuiGroup::AddWorkerWidget(CGuiWidget* worker) {
|
||||||
++xb8_workerCount;
|
++xb8_workerCount;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -15,6 +15,7 @@ public:
|
||||||
|
|
||||||
void SelectWorkerWidget(int workerId, bool setActive, bool setVisible);
|
void SelectWorkerWidget(int workerId, bool setActive, bool setVisible);
|
||||||
CGuiWidget* GetSelectedWidget();
|
CGuiWidget* GetSelectedWidget();
|
||||||
|
const CGuiWidget* GetSelectedWidget() const;
|
||||||
bool AddWorkerWidget(CGuiWidget* worker) override;
|
bool AddWorkerWidget(CGuiWidget* worker) override;
|
||||||
void OnActiveChange() override;
|
void OnActiveChange() override;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode);
|
CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode);
|
||||||
|
|
||||||
CSimplePool& GetResStore() { return x4_resStore; }
|
CSimplePool& GetResStore() { return x4_resStore; }
|
||||||
|
const CSimplePool& GetResStore() const { return x4_resStore; }
|
||||||
EUsageMode GetUsageMode() const { return x8_mode; }
|
EUsageMode GetUsageMode() const { return x8_mode; }
|
||||||
|
|
||||||
void OnViewportResize();
|
void OnViewportResize();
|
||||||
|
|
|
@ -228,7 +228,7 @@ void CHudMissileInterface::SetNumMissiles(int numMissiles, const CStateManager&
|
||||||
|
|
||||||
void CHudMissileInterface::SetMissileCapacity(int missileCapacity) { x4_missileCapacity = missileCapacity; }
|
void CHudMissileInterface::SetMissileCapacity(int missileCapacity) { x4_missileCapacity = missileCapacity; }
|
||||||
|
|
||||||
CHudMissileInterface::EInventoryStatus CHudMissileInterface::GetMissileInventoryStatus() {
|
CHudMissileInterface::EInventoryStatus CHudMissileInterface::GetMissileInventoryStatus() const {
|
||||||
if (x64_energybart01_missilebar->GetSetEnergy() == 0.f)
|
if (x64_energybart01_missilebar->GetSetEnergy() == 0.f)
|
||||||
return EInventoryStatus::Depleted;
|
return EInventoryStatus::Depleted;
|
||||||
return EInventoryStatus(x64_energybart01_missilebar->GetActualFraction() < g_tweakGui->GetMissileWarningFraction());
|
return EInventoryStatus(x64_energybart01_missilebar->GetActualFraction() < g_tweakGui->GetMissileWarningFraction());
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
void SetChargeBeamFactor(float t);
|
void SetChargeBeamFactor(float t);
|
||||||
void SetNumMissiles(int numMissiles, const CStateManager& mgr);
|
void SetNumMissiles(int numMissiles, const CStateManager& mgr);
|
||||||
void SetMissileCapacity(int missileCapacity);
|
void SetMissileCapacity(int missileCapacity);
|
||||||
EInventoryStatus GetMissileInventoryStatus();
|
EInventoryStatus GetMissileInventoryStatus() const;
|
||||||
static std::pair<zeus::CVector3f, zeus::CVector3f> CombatMissileBarCoordFunc(float t);
|
static std::pair<zeus::CVector3f, zeus::CVector3f> CombatMissileBarCoordFunc(float t);
|
||||||
static std::pair<zeus::CVector3f, zeus::CVector3f> XRayMissileBarCoordFunc(float t);
|
static std::pair<zeus::CVector3f, zeus::CVector3f> XRayMissileBarCoordFunc(float t);
|
||||||
static std::pair<zeus::CVector3f, zeus::CVector3f> ThermalMissileBarCoordFunc(float t);
|
static std::pair<zeus::CVector3f, zeus::CVector3f> ThermalMissileBarCoordFunc(float t);
|
||||||
|
|
|
@ -14,7 +14,7 @@ COrbitPointMarker::COrbitPointMarker() {
|
||||||
x28_orbitPointModel = g_SimplePool->GetObj("CMDL_OrbitPoint");
|
x28_orbitPointModel = g_SimplePool->GetObj("CMDL_OrbitPoint");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool COrbitPointMarker::CheckLoadComplete() { return x28_orbitPointModel.IsLoaded(); }
|
bool COrbitPointMarker::CheckLoadComplete() const { return x28_orbitPointModel.IsLoaded(); }
|
||||||
|
|
||||||
void COrbitPointMarker::Update(float dt, const CStateManager& mgr) {
|
void COrbitPointMarker::Update(float dt, const CStateManager& mgr) {
|
||||||
x24_curTime += dt;
|
x24_curTime += dt;
|
||||||
|
|
|
@ -20,7 +20,7 @@ class COrbitPointMarker {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
COrbitPointMarker();
|
COrbitPointMarker();
|
||||||
bool CheckLoadComplete();
|
bool CheckLoadComplete() const;
|
||||||
void Update(float dt, const CStateManager& mgr);
|
void Update(float dt, const CStateManager& mgr);
|
||||||
void Draw(const CStateManager& mgr) const;
|
void Draw(const CStateManager& mgr) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,7 @@ class TObjOwnerParam : public IVParamObj {
|
||||||
public:
|
public:
|
||||||
TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {}
|
TObjOwnerParam(T&& obj) : m_param(std::move(obj)) {}
|
||||||
T& GetParam() { return m_param; }
|
T& GetParam() { return m_param; }
|
||||||
|
const T& GetParam() const { return m_param; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CVParamTransfer {
|
class CVParamTransfer {
|
||||||
|
@ -27,7 +28,7 @@ public:
|
||||||
CVParamTransfer(IVParamObj* obj) : m_ref(obj) {}
|
CVParamTransfer(IVParamObj* obj) : m_ref(obj) {}
|
||||||
CVParamTransfer(const CVParamTransfer& other) : m_ref(other.m_ref) {}
|
CVParamTransfer(const CVParamTransfer& other) : m_ref(other.m_ref) {}
|
||||||
IVParamObj* GetObj() const { return m_ref.get(); }
|
IVParamObj* GetObj() const { return m_ref.get(); }
|
||||||
CVParamTransfer ShareTransferRef() { return CVParamTransfer(*this); }
|
CVParamTransfer ShareTransferRef() const { return CVParamTransfer(*this); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
T& GetOwnedObj() const {
|
T& GetOwnedObj() const {
|
||||||
|
|
|
@ -57,7 +57,7 @@ ECardResult CMemoryCardDriver::SFileInfo::FileRead() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ECardResult CMemoryCardDriver::SFileInfo::GetSaveDataOffset(u32& offOut) {
|
ECardResult CMemoryCardDriver::SFileInfo::GetSaveDataOffset(u32& offOut) const {
|
||||||
CMemoryCardSys::CardStat stat = {};
|
CMemoryCardSys::CardStat stat = {};
|
||||||
ECardResult result = CMemoryCardSys::GetStatus(x0_fileInfo.slot, x0_fileInfo.getFileNo(), stat);
|
ECardResult result = CMemoryCardSys::GetStatus(x0_fileInfo.slot, x0_fileInfo.getFileNo(), stat);
|
||||||
if (result != ECardResult::READY) {
|
if (result != ECardResult::READY) {
|
||||||
|
@ -135,7 +135,7 @@ void CMemoryCardDriver::NoCardFound() {
|
||||||
static_cast<CMain*>(g_Main)->SetCardBusy(false);
|
static_cast<CMain*>(g_Main)->SetCardBusy(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const CGameState::GameFileStateInfo* CMemoryCardDriver::GetGameFileStateInfo(int idx) {
|
const CGameState::GameFileStateInfo* CMemoryCardDriver::GetGameFileStateInfo(int idx) const {
|
||||||
SGameFileSlot* slot = xe4_fileSlots[idx].get();
|
SGameFileSlot* slot = xe4_fileSlots[idx].get();
|
||||||
if (!slot)
|
if (!slot)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -78,7 +78,7 @@ private:
|
||||||
kabufuda::ECardResult StartRead();
|
kabufuda::ECardResult StartRead();
|
||||||
kabufuda::ECardResult TryFileRead();
|
kabufuda::ECardResult TryFileRead();
|
||||||
kabufuda::ECardResult FileRead();
|
kabufuda::ECardResult FileRead();
|
||||||
kabufuda::ECardResult GetSaveDataOffset(u32& offOut);
|
kabufuda::ECardResult GetSaveDataOffset(u32& offOut) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SSaveHeader {
|
struct SSaveHeader {
|
||||||
|
@ -126,7 +126,7 @@ public:
|
||||||
bool importPersistent);
|
bool importPersistent);
|
||||||
|
|
||||||
void NoCardFound();
|
void NoCardFound();
|
||||||
const CGameState::GameFileStateInfo* GetGameFileStateInfo(int idx);
|
const CGameState::GameFileStateInfo* GetGameFileStateInfo(int idx) const;
|
||||||
static SSaveHeader LoadSaveHeader(CMemoryInStream& in);
|
static SSaveHeader LoadSaveHeader(CMemoryInStream& in);
|
||||||
static std::unique_ptr<SGameFileSlot> LoadSaveFile(CMemoryInStream& in);
|
static std::unique_ptr<SGameFileSlot> LoadSaveFile(CMemoryInStream& in);
|
||||||
void ReadFinished();
|
void ReadFinished();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
SaveReady = 16
|
SaveReady = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
bool IsHiddenFromFrontEnd() {
|
bool IsHiddenFromFrontEnd() const {
|
||||||
switch (x10_uiType) {
|
switch (x10_uiType) {
|
||||||
case EUIType::SaveReady:
|
case EUIType::SaveReady:
|
||||||
case EUIType::Empty:
|
case EUIType::Empty:
|
||||||
|
|
|
@ -172,7 +172,7 @@ public:
|
||||||
void Update();
|
void Update();
|
||||||
void Draw();
|
void Draw();
|
||||||
|
|
||||||
bool isRectDirty() { return m_rectIsDirty; }
|
bool isRectDirty() const { return m_rectIsDirty; }
|
||||||
const boo::SWindowRect& getWindowRect() {
|
const boo::SWindowRect& getWindowRect() {
|
||||||
m_rectIsDirty = false;
|
m_rectIsDirty = false;
|
||||||
return m_windowRect;
|
return m_windowRect;
|
||||||
|
@ -278,8 +278,8 @@ public:
|
||||||
|
|
||||||
void MemoryCardInitializePump();
|
void MemoryCardInitializePump();
|
||||||
|
|
||||||
bool CheckReset() { return m_doQuit; }
|
bool CheckReset() const { return m_doQuit; }
|
||||||
bool CheckTerminate() { return m_doQuit; }
|
bool CheckTerminate() const { return m_doQuit; }
|
||||||
void DrawDebugMetrics(double, CStopwatch&) {}
|
void DrawDebugMetrics(double, CStopwatch&) {}
|
||||||
void DoPredrawMetrics() {}
|
void DoPredrawMetrics() {}
|
||||||
void FillInAssetIDs();
|
void FillInAssetIDs();
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ void CBabygoth::UpdateHealthInfo(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float CBabygoth::CalculateShellCrackHP(EShellState state) {
|
float CBabygoth::CalculateShellCrackHP(EShellState state) const {
|
||||||
if (state == EShellState::Default)
|
if (state == EShellState::Default)
|
||||||
return x570_babyData.GetShellHitPoints();
|
return x570_babyData.GetShellHitPoints();
|
||||||
else if (state == EShellState::CrackOne)
|
else if (state == EShellState::CrackOne)
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
const CDamageInfo& GetFireBreathDamage() const { return x4c_fireBreathDamage; }
|
const CDamageInfo& GetFireBreathDamage() const { return x4c_fireBreathDamage; }
|
||||||
const CDamageVulnerability& GetShellDamageVulnerability() const { return xd0_shellVulnerabilities; }
|
const CDamageVulnerability& GetShellDamageVulnerability() const { return xd0_shellVulnerabilities; }
|
||||||
float GetShellHitPoints() const { return x140_shellHitPoints; }
|
float GetShellHitPoints() const { return x140_shellHitPoints; }
|
||||||
s16 GetShellCrackSfx() { return x144_shellCrackSfx; }
|
s16 GetShellCrackSfx() const { return x144_shellCrackSfx; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBabygoth final : public CPatterned {
|
class CBabygoth final : public CPatterned {
|
||||||
|
@ -130,9 +130,9 @@ private:
|
||||||
|
|
||||||
void ApplySeparationBehavior(CStateManager&);
|
void ApplySeparationBehavior(CStateManager&);
|
||||||
|
|
||||||
bool IsMouthCollisionActor(TUniqueId uid) { return x9f6_mouthCollisionActor == uid; }
|
bool IsMouthCollisionActor(TUniqueId uid) const { return x9f6_mouthCollisionActor == uid; }
|
||||||
|
|
||||||
bool IsShell(TUniqueId uid) {
|
bool IsShell(TUniqueId uid) const {
|
||||||
for (TUniqueId shellId : x9f8_shellIds) {
|
for (TUniqueId shellId : x9f8_shellIds) {
|
||||||
if (shellId == uid)
|
if (shellId == uid)
|
||||||
return true;
|
return true;
|
||||||
|
@ -172,7 +172,7 @@ private:
|
||||||
|
|
||||||
void UpdateHealth(CStateManager&);
|
void UpdateHealth(CStateManager&);
|
||||||
|
|
||||||
float CalculateShellCrackHP(EShellState state);
|
float CalculateShellCrackHP(EShellState state) const;
|
||||||
|
|
||||||
void UpdateAttackTimeLeft(CStateManager& mgr);
|
void UpdateAttackTimeLeft(CStateManager& mgr);
|
||||||
|
|
||||||
|
|
|
@ -718,9 +718,9 @@ void CFlaahgra::TurnAround(CStateManager& mgr, EStateMsg msg, float) {
|
||||||
x6cc_boneTracking->SetActive(false);
|
x6cc_boneTracking->SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool CFlaahgra::IsSphereCollider(TUniqueId uid) {
|
|
||||||
|
|
||||||
auto it = std::find(x7fc_sphereColliders.begin(), x7fc_sphereColliders.end(), uid);
|
bool CFlaahgra::IsSphereCollider(TUniqueId uid) const {
|
||||||
|
const auto it = std::find(x7fc_sphereColliders.cbegin(), x7fc_sphereColliders.cend(), uid);
|
||||||
return it != x7fc_sphereColliders.end();
|
return it != x7fc_sphereColliders.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -800,7 +800,7 @@ void CFlaahgra::UpdateScale(float t, float min, float max) {
|
||||||
ModelData()->SetScale(zeus::skOne3f * scale);
|
ModelData()->SetScale(zeus::skOne3f * scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
float CFlaahgra::GetEndActionTime() {
|
float CFlaahgra::GetEndActionTime() const {
|
||||||
CCharAnimTime eventTime =
|
CCharAnimTime eventTime =
|
||||||
GetModelData()->GetAnimationData()->GetTimeOfUserEvent(EUserEventType::EndAction, CCharAnimTime::Infinity());
|
GetModelData()->GetAnimationData()->GetTimeOfUserEvent(EUserEventType::EndAction, CCharAnimTime::Infinity());
|
||||||
if (eventTime == CCharAnimTime::Infinity())
|
if (eventTime == CCharAnimTime::Infinity())
|
||||||
|
@ -829,7 +829,7 @@ void CFlaahgra::Generate(CStateManager& mgr, EStateMsg msg, float) {
|
||||||
x7c0_ = 11.f;
|
x7c0_ = 11.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zeus::CVector3f CFlaahgra::GetAttacktargetPos(CStateManager& mgr) const {
|
zeus::CVector3f CFlaahgra::GetAttacktargetPos(const CStateManager& mgr) const {
|
||||||
if (mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed)
|
if (mgr.GetPlayer().GetMorphballTransitionState() == CPlayer::EPlayerMorphBallState::Morphed)
|
||||||
return mgr.GetPlayer().GetMorphBall()->GetBallToWorld().origin;
|
return mgr.GetPlayer().GetMorphBall()->GetBallToWorld().origin;
|
||||||
|
|
||||||
|
@ -988,7 +988,7 @@ void CFlaahgra::Attack(CStateManager& mgr, EStateMsg msg, float arg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 CFlaahgra::sub801ae828(CStateManager& mgr) {
|
u32 CFlaahgra::sub801ae828(const CStateManager& mgr) const {
|
||||||
const CPlayer& player = mgr.GetPlayer();
|
const CPlayer& player = mgr.GetPlayer();
|
||||||
if (player.GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed) {
|
if (player.GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed) {
|
||||||
if (x7cc_ > 0.f || player.GetVelocity().magSquared() < 25.f)
|
if (x7cc_ > 0.f || player.GetVelocity().magSquared() < 25.f)
|
||||||
|
@ -1000,7 +1000,7 @@ u32 CFlaahgra::sub801ae828(CStateManager& mgr) {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
zeus::CVector3f CFlaahgra::sub801ae754(CStateManager& mgr) {
|
zeus::CVector3f CFlaahgra::sub801ae754(const CStateManager& mgr) const {
|
||||||
float dt = (sub801ae650() && mgr.GetPlayer().GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed
|
float dt = (sub801ae650() && mgr.GetPlayer().GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed
|
||||||
? 0.75f
|
? 0.75f
|
||||||
: 0.5f);
|
: 0.5f);
|
||||||
|
@ -1170,7 +1170,7 @@ bool CFlaahgra::CoverCheck(CStateManager& mgr, float) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TUniqueId CFlaahgra::GetMirrorNearestPlayer(CStateManager& mgr) {
|
TUniqueId CFlaahgra::GetMirrorNearestPlayer(const CStateManager& mgr) const {
|
||||||
zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
|
zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
|
||||||
|
|
||||||
TUniqueId nearId = kInvalidUniqueId;
|
TUniqueId nearId = kInvalidUniqueId;
|
||||||
|
|
|
@ -164,23 +164,23 @@ class CFlaahgra : public CPatterned {
|
||||||
void SetMaterialProperties(const std::unique_ptr<CCollisionActorManager>&, CStateManager&);
|
void SetMaterialProperties(const std::unique_ptr<CCollisionActorManager>&, CStateManager&);
|
||||||
bool sub801ae650() const { return (x7a8_ == 0 || x7a8_ == 1); }
|
bool sub801ae650() const { return (x7a8_ == 0 || x7a8_ == 1); }
|
||||||
bool sub801ae670() const { return (x7a8_ == 2 || x7a8_ == 3 || x7a8_ == 4); }
|
bool sub801ae670() const { return (x7a8_ == 2 || x7a8_ == 3 || x7a8_ == 4); }
|
||||||
bool IsSphereCollider(TUniqueId);
|
bool IsSphereCollider(TUniqueId) const;
|
||||||
void SetCollisionActorBounds(CStateManager& mgr, const std::unique_ptr<CCollisionActorManager>& colMgr,
|
void SetCollisionActorBounds(CStateManager& mgr, const std::unique_ptr<CCollisionActorManager>& colMgr,
|
||||||
const zeus::CVector3f& extendedBounds);
|
const zeus::CVector3f& extendedBounds);
|
||||||
|
|
||||||
void UpdateScale(float, float, float);
|
void UpdateScale(float, float, float);
|
||||||
float GetEndActionTime();
|
float GetEndActionTime() const;
|
||||||
void SetupHealthInfo(CStateManager&);
|
void SetupHealthInfo(CStateManager&);
|
||||||
zeus::CVector3f GetAttacktargetPos(CStateManager&) const;
|
zeus::CVector3f GetAttacktargetPos(const CStateManager&) const;
|
||||||
void RattlePlayer(CStateManager& mgr, const zeus::CVector3f& vec);
|
void RattlePlayer(CStateManager& mgr, const zeus::CVector3f& vec);
|
||||||
bool sub801e4f8() { return x7a8_ == 0 || x7a8_ == 1; }
|
bool sub801e4f8() const { return x7a8_ == 0 || x7a8_ == 1; }
|
||||||
void sub801ade80();
|
void sub801ade80();
|
||||||
void UpdateHeadDamageVulnerability(CStateManager&, bool);
|
void UpdateHeadDamageVulnerability(CStateManager&, bool);
|
||||||
|
|
||||||
u32 sub801ae828(CStateManager&);
|
u32 sub801ae828(const CStateManager&) const;
|
||||||
zeus::CVector3f sub801ae754(CStateManager&);
|
zeus::CVector3f sub801ae754(const CStateManager&) const;
|
||||||
|
|
||||||
TUniqueId GetMirrorNearestPlayer(CStateManager&);
|
TUniqueId GetMirrorNearestPlayer(const CStateManager&) const;
|
||||||
public:
|
public:
|
||||||
DEFINE_PATTERNED(Flaahgra);
|
DEFINE_PATTERNED(Flaahgra);
|
||||||
CFlaahgra(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, const CAnimRes&,
|
CFlaahgra(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, const CAnimRes&,
|
||||||
|
|
|
@ -164,16 +164,16 @@ void CJellyZap::RemoveSelfFromFishCloud(CStateManager&) {}
|
||||||
|
|
||||||
void CJellyZap::RemoveAllAttractors(CStateManager& mgr) { RemoveSelfFromFishCloud(mgr); }
|
void CJellyZap::RemoveAllAttractors(CStateManager& mgr) { RemoveSelfFromFishCloud(mgr); }
|
||||||
|
|
||||||
bool CJellyZap::ClosestToPlayer(CStateManager& mgr) {
|
bool CJellyZap::ClosestToPlayer(const CStateManager& mgr) const {
|
||||||
zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
|
const zeus::CVector3f playerPos = mgr.GetPlayer().GetTranslation();
|
||||||
float ourDistance = (playerPos - GetTranslation()).magnitude();
|
const float ourDistance = (playerPos - GetTranslation()).magnitude();
|
||||||
float closestDistance = ourDistance;
|
float closestDistance = ourDistance;
|
||||||
for (CEntity* ent : mgr.GetPhysicsActorObjectList()) {
|
for (CEntity* ent : mgr.GetPhysicsActorObjectList()) {
|
||||||
if (CJellyZap* zap = CPatterned::CastTo<CJellyZap>(ent)) {
|
if (CJellyZap* zap = CPatterned::CastTo<CJellyZap>(ent)) {
|
||||||
if (zap->GetAreaIdAlways() != GetAreaIdAlways())
|
if (zap->GetAreaIdAlways() != GetAreaIdAlways())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float tmpDist = (playerPos - zap->GetTranslation()).magnitude();
|
const float tmpDist = (playerPos - zap->GetTranslation()).magnitude();
|
||||||
if (tmpDist < closestDistance)
|
if (tmpDist < closestDistance)
|
||||||
closestDistance = tmpDist;
|
closestDistance = tmpDist;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ class CJellyZap : public CPatterned {
|
||||||
void AddAttractor(CStateManager&);
|
void AddAttractor(CStateManager&);
|
||||||
void RemoveSelfFromFishCloud(CStateManager&);
|
void RemoveSelfFromFishCloud(CStateManager&);
|
||||||
void RemoveAllAttractors(CStateManager&);
|
void RemoveAllAttractors(CStateManager&);
|
||||||
bool ClosestToPlayer(CStateManager&);
|
bool ClosestToPlayer(const CStateManager&) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_PATTERNED(JellyZap)
|
DEFINE_PATTERNED(JellyZap)
|
||||||
|
|
|
@ -785,13 +785,13 @@ bool CParasite::ShouldAttack(CStateManager& mgr, float arg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CParasite::CloseToWall(CStateManager& mgr) {
|
bool CParasite::CloseToWall(const CStateManager& mgr) const {
|
||||||
static CMaterialFilter filter = CMaterialFilter::MakeInclude(EMaterialTypes::Solid);
|
static CMaterialFilter filter = CMaterialFilter::MakeInclude(EMaterialTypes::Solid);
|
||||||
zeus::CAABox aabb = CPhysicsActor::GetBoundingBox();
|
zeus::CAABox aabb = CPhysicsActor::GetBoundingBox();
|
||||||
float margin = x590_colSphere.GetSphere().radius + x5b0_collisionCloseMargin;
|
const float margin = x590_colSphere.GetSphere().radius + x5b0_collisionCloseMargin;
|
||||||
aabb.min -= zeus::CVector3f(margin);
|
aabb.min -= zeus::CVector3f(margin);
|
||||||
aabb.max += zeus::CVector3f(margin);
|
aabb.max += zeus::CVector3f(margin);
|
||||||
CCollidableAABox cAABB(aabb, x68_material);
|
const CCollidableAABox cAABB(aabb, x68_material);
|
||||||
return CGameCollision::DetectStaticCollisionBoolean(mgr, cAABB, {}, filter);
|
return CGameCollision::DetectStaticCollisionBoolean(mgr, cAABB, {}, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ class CParasite : public CWallWalker {
|
||||||
};
|
};
|
||||||
u16 _dummy = 0;
|
u16 _dummy = 0;
|
||||||
};
|
};
|
||||||
bool CloseToWall(CStateManager& mgr);
|
bool CloseToWall(const CStateManager& mgr) const;
|
||||||
void FaceTarget(const zeus::CVector3f& target);
|
void FaceTarget(const zeus::CVector3f& target);
|
||||||
TUniqueId RecursiveFindClosestWayPoint(CStateManager& mgr, TUniqueId id, float& dist);
|
TUniqueId RecursiveFindClosestWayPoint(CStateManager& mgr, TUniqueId id, float& dist);
|
||||||
TUniqueId GetClosestWaypointForState(EScriptObjectState state, CStateManager& mgr);
|
TUniqueId GetClosestWaypointForState(EScriptObjectState state, CStateManager& mgr);
|
||||||
|
|
|
@ -157,20 +157,20 @@ static CMaterialFilter kSolidFilter =
|
||||||
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {EMaterialTypes::Character, EMaterialTypes::Player,
|
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {EMaterialTypes::Character, EMaterialTypes::Player,
|
||||||
EMaterialTypes::ProjectilePassthrough});
|
EMaterialTypes::ProjectilePassthrough});
|
||||||
|
|
||||||
bool CPuddleToadGamma::PlayerInVortexArea(const CStateManager& mgr) {
|
bool CPuddleToadGamma::PlayerInVortexArea(const CStateManager& mgr) const {
|
||||||
CPlayer& player = mgr.GetPlayer();
|
const CPlayer& player = mgr.GetPlayer();
|
||||||
zeus::CTransform xf = GetLctrTransform(mMouthLocatorName);
|
const zeus::CTransform xf = GetLctrTransform(mMouthLocatorName);
|
||||||
|
|
||||||
zeus::CVector3f playerOffset =
|
const zeus::CVector3f playerOffset =
|
||||||
player.GetTranslation() + zeus::CVector3f{0.f, 0.f, player.GetMorphBall()->GetBallRadius()};
|
player.GetTranslation() + zeus::CVector3f{0.f, 0.f, player.GetMorphBall()->GetBallRadius()};
|
||||||
zeus::CVector3f rotatedDir = GetTransform().rotate(zeus::skForward);
|
const zeus::CVector3f rotatedDir = GetTransform().rotate(zeus::skForward);
|
||||||
|
|
||||||
zeus::CVector3f suckPointToPlayer = (playerOffset - (xf.origin - (1.f * rotatedDir)));
|
const zeus::CVector3f suckPointToPlayer = (playerOffset - (xf.origin - (1.f * rotatedDir)));
|
||||||
float suckProj = suckPointToPlayer.normalized().dot(rotatedDir);
|
const float suckProj = suckPointToPlayer.normalized().dot(rotatedDir);
|
||||||
float playerDist = suckPointToPlayer.magnitude();
|
const float playerDist = suckPointToPlayer.magnitude();
|
||||||
float suckAngleProj = (player.GetTranslation() - (xf.origin - (4.f * rotatedDir))).normalized().dot(rotatedDir);
|
const float suckAngleProj = (player.GetTranslation() - (xf.origin - (4.f * rotatedDir))).normalized().dot(rotatedDir);
|
||||||
if (playerDist > 2.f) {
|
if (playerDist > 2.f) {
|
||||||
CRayCastResult result =
|
const CRayCastResult result =
|
||||||
mgr.RayStaticIntersection(suckPointToPlayer, 1.f / playerDist * suckPointToPlayer,
|
mgr.RayStaticIntersection(suckPointToPlayer, 1.f / playerDist * suckPointToPlayer,
|
||||||
playerDist - player.GetMorphBall()->GetBallRadius(), kSolidFilter);
|
playerDist - player.GetMorphBall()->GetBallRadius(), kSolidFilter);
|
||||||
if (result.IsValid())
|
if (result.IsValid())
|
||||||
|
|
|
@ -32,7 +32,7 @@ class CPuddleToadGamma final : public CPatterned {
|
||||||
static void CenterPlayer(CStateManager&, const zeus::CVector3f&, float);
|
static void CenterPlayer(CStateManager&, const zeus::CVector3f&, float);
|
||||||
void ShootPlayer(CStateManager&, float);
|
void ShootPlayer(CStateManager&, float);
|
||||||
void SuckPlayer(CStateManager&, float);
|
void SuckPlayer(CStateManager&, float);
|
||||||
bool PlayerInVortexArea(const CStateManager&);
|
bool PlayerInVortexArea(const CStateManager&) const;
|
||||||
void SetPlayerPosition(CStateManager&, const zeus::CVector3f&);
|
void SetPlayerPosition(CStateManager&, const zeus::CVector3f&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -516,7 +516,7 @@ void CSpacePirate::SquadRemove(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSpacePirate::CheckTargetable(CStateManager& mgr) { return GetModelAlphau8(mgr) > 127; }
|
bool CSpacePirate::CheckTargetable(const CStateManager& mgr) const { return GetModelAlphau8(mgr) > 127; }
|
||||||
|
|
||||||
bool CSpacePirate::FireProjectile(float dt, CStateManager& mgr) {
|
bool CSpacePirate::FireProjectile(float dt, CStateManager& mgr) {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
@ -619,7 +619,7 @@ void CSpacePirate::UpdateAttacks(float dt, CStateManager& mgr) {
|
||||||
xe7_31_targetable = CheckTargetable(mgr);
|
xe7_31_targetable = CheckTargetable(mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CSpacePirate::GetTargetPos(CStateManager& mgr) {
|
zeus::CVector3f CSpacePirate::GetTargetPos(const CStateManager& mgr) {
|
||||||
if (x7c0_targetId != mgr.GetPlayer().GetUniqueId()) {
|
if (x7c0_targetId != mgr.GetPlayer().GetUniqueId()) {
|
||||||
if (TCastToConstPtr<CActor> act = mgr.GetObjectById(x7c0_targetId))
|
if (TCastToConstPtr<CActor> act = mgr.GetObjectById(x7c0_targetId))
|
||||||
if (act->GetActive())
|
if (act->GetActive())
|
||||||
|
@ -630,7 +630,7 @@ zeus::CVector3f CSpacePirate::GetTargetPos(CStateManager& mgr) {
|
||||||
return mgr.GetPlayer().GetTranslation();
|
return mgr.GetPlayer().GetTranslation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpacePirate::UpdateAimBodyState(float dt, CStateManager& mgr) {
|
void CSpacePirate::UpdateAimBodyState(float dt, const CStateManager& mgr) {
|
||||||
if (x400_25_alive && x637_25_enableAim && !x637_29_inWallHang && !x450_bodyController->IsFrozen() && !x634_27_melee &&
|
if (x400_25_alive && x637_25_enableAim && !x637_29_inWallHang && !x450_bodyController->IsFrozen() && !x634_27_melee &&
|
||||||
!x85c_ragDoll && (!x635_26_seated || x639_28_satUp) && x31c_faceVec.z() <= 0.f) {
|
!x85c_ragDoll && (!x635_26_seated || x639_28_satUp) && x31c_faceVec.z() <= 0.f) {
|
||||||
x8c4_aimDelayTimer = std::max(0.f, x8c4_aimDelayTimer - dt);
|
x8c4_aimDelayTimer = std::max(0.f, x8c4_aimDelayTimer - dt);
|
||||||
|
@ -1239,8 +1239,8 @@ void CSpacePirate::Dead(CStateManager& mgr, EStateMsg msg, float dt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSpacePirate::LineOfSightTest(CStateManager& mgr, const zeus::CVector3f& eyePos, const zeus::CVector3f& targetPos,
|
bool CSpacePirate::LineOfSightTest(const CStateManager& mgr, const zeus::CVector3f& eyePos,
|
||||||
const CMaterialList& excludeList) const {
|
const zeus::CVector3f& targetPos, const CMaterialList& excludeList) const {
|
||||||
return mgr.RayCollideWorld(eyePos, targetPos,
|
return mgr.RayCollideWorld(eyePos, targetPos,
|
||||||
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, excludeList), this);
|
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, excludeList), this);
|
||||||
}
|
}
|
||||||
|
@ -1555,14 +1555,14 @@ void CSpacePirate::Attack(CStateManager& mgr, EStateMsg msg, float dt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSpacePirate::CantJumpBack(CStateManager& mgr, const zeus::CVector3f& dir, float dist) const {
|
bool CSpacePirate::CantJumpBack(const CStateManager& mgr, const zeus::CVector3f& dir, float dist) const {
|
||||||
zeus::CVector3f center = GetBoundingBox().center();
|
const zeus::CVector3f center = GetBoundingBox().center();
|
||||||
if (!LineOfSightTest(mgr, center, center + dist * dir, {}))
|
if (!LineOfSightTest(mgr, center, center + dist * dir, {}))
|
||||||
return false;
|
return false;
|
||||||
zeus::CVector3f center2 = (dist * 0.5f) * dir + center;
|
const zeus::CVector3f center2 = (dist * 0.5f) * dir + center;
|
||||||
if (LineOfSightTest(mgr, center2, center2 + 5.f * zeus::skDown, {}))
|
if (LineOfSightTest(mgr, center2, center2 + 5.f * zeus::skDown, {}))
|
||||||
return false;
|
return false;
|
||||||
zeus::CVector3f center3 = dist * dir + center;
|
const zeus::CVector3f center3 = dist * dir + center;
|
||||||
if (LineOfSightTest(mgr, center3, center3 + 5.f * zeus::skDown, {}))
|
if (LineOfSightTest(mgr, center3, center3 + 5.f * zeus::skDown, {}))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -225,11 +225,11 @@ private:
|
||||||
void SquadReset(CStateManager& mgr);
|
void SquadReset(CStateManager& mgr);
|
||||||
void SquadAdd(CStateManager& mgr);
|
void SquadAdd(CStateManager& mgr);
|
||||||
void SquadRemove(CStateManager& mgr);
|
void SquadRemove(CStateManager& mgr);
|
||||||
bool CheckTargetable(CStateManager& mgr);
|
bool CheckTargetable(const CStateManager& mgr) const;
|
||||||
bool FireProjectile(float dt, CStateManager& mgr);
|
bool FireProjectile(float dt, CStateManager& mgr);
|
||||||
void UpdateAttacks(float dt, CStateManager& mgr);
|
void UpdateAttacks(float dt, CStateManager& mgr);
|
||||||
zeus::CVector3f GetTargetPos(CStateManager& mgr);
|
zeus::CVector3f GetTargetPos(const CStateManager& mgr);
|
||||||
void UpdateAimBodyState(float dt, CStateManager& mgr);
|
void UpdateAimBodyState(float dt, const CStateManager& mgr);
|
||||||
void SetCinematicCollision(CStateManager& mgr);
|
void SetCinematicCollision(CStateManager& mgr);
|
||||||
void SetNonCinematicCollision(CStateManager& mgr);
|
void SetNonCinematicCollision(CStateManager& mgr);
|
||||||
void CheckForProjectiles(CStateManager& mgr);
|
void CheckForProjectiles(CStateManager& mgr);
|
||||||
|
@ -237,11 +237,11 @@ private:
|
||||||
void SetVelocityForJump();
|
void SetVelocityForJump();
|
||||||
void AvoidActors(CStateManager& mgr);
|
void AvoidActors(CStateManager& mgr);
|
||||||
void UpdateCantSeePlayer(CStateManager& mgr);
|
void UpdateCantSeePlayer(CStateManager& mgr);
|
||||||
bool LineOfSightTest(CStateManager& mgr, const zeus::CVector3f& eyePos, const zeus::CVector3f& targetPos,
|
bool LineOfSightTest(const CStateManager& mgr, const zeus::CVector3f& eyePos, const zeus::CVector3f& targetPos,
|
||||||
const CMaterialList& excludeList) const;
|
const CMaterialList& excludeList) const;
|
||||||
void UpdateHeldPosition(CStateManager& mgr, float dt);
|
void UpdateHeldPosition(CStateManager& mgr, float dt);
|
||||||
void CheckBlade(CStateManager& mgr);
|
void CheckBlade(CStateManager& mgr);
|
||||||
bool CantJumpBack(CStateManager& mgr, const zeus::CVector3f& dir, float dist) const;
|
bool CantJumpBack(const CStateManager& mgr, const zeus::CVector3f& dir, float dist) const;
|
||||||
void UpdateLeashTimer(float dt);
|
void UpdateLeashTimer(float dt);
|
||||||
pas::EStepDirection GetStrafeDir(CStateManager& mgr, float dist) const;
|
pas::EStepDirection GetStrafeDir(CStateManager& mgr, float dist) const;
|
||||||
|
|
||||||
|
|
|
@ -543,7 +543,7 @@ void CTryclops::DragPlayer(CStateManager& mgr, const zeus::CVector3f& locOrig) {
|
||||||
player.SetTransform(xf);
|
player.SetTransform(xf);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CTryclops::InRangeToLocator(const zeus::CVector3f& vec, float arg) {
|
bool CTryclops::InRangeToLocator(const zeus::CVector3f& vec, float arg) const {
|
||||||
return (vec - GetLctrTransform("ballGrab_locator"sv).origin).magSquared() <= arg;
|
return (vec - GetLctrTransform("ballGrab_locator"sv).origin).magSquared() <= arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class CTryclops : public CPatterned {
|
||||||
void ApplySeparation(CStateManager&);
|
void ApplySeparation(CStateManager&);
|
||||||
void GrabBomb(CStateManager& mgr);
|
void GrabBomb(CStateManager& mgr);
|
||||||
void DragPlayer(CStateManager& mgr, const zeus::CVector3f& locOrig);
|
void DragPlayer(CStateManager& mgr, const zeus::CVector3f& locOrig);
|
||||||
bool InRangeToLocator(const zeus::CVector3f& vec, float);
|
bool InRangeToLocator(const zeus::CVector3f& vec, float) const;
|
||||||
bool sub80260180(const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CAABox&, CStateManager&);
|
bool sub80260180(const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CAABox&, CStateManager&);
|
||||||
void SuckPlayer(CStateManager& mgr, float);
|
void SuckPlayer(CStateManager& mgr, float);
|
||||||
void AttractPlayer(CStateManager& mgr, const zeus::CVector3f& dest, float);
|
void AttractPlayer(CStateManager& mgr, const zeus::CVector3f& dest, float);
|
||||||
|
|
|
@ -124,7 +124,7 @@ std::optional<zeus::CAABox> CWarWasp::GetTouchBounds() const {
|
||||||
return {x570_cSphere.CalculateAABox(GetTransform())};
|
return {x570_cSphere.CalculateAABox(GetTransform())};
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CWarWasp::GetProjectileAimPos(CStateManager& mgr, float zBias) {
|
zeus::CVector3f CWarWasp::GetProjectileAimPos(const CStateManager& mgr, float zBias) const {
|
||||||
zeus::CVector3f ret = mgr.GetPlayer().GetAimPosition(mgr, 0.f);
|
zeus::CVector3f ret = mgr.GetPlayer().GetAimPosition(mgr, 0.f);
|
||||||
if (mgr.GetPlayer().GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed)
|
if (mgr.GetPlayer().GetMorphballTransitionState() != CPlayer::EPlayerMorphBallState::Morphed)
|
||||||
ret += zeus::CVector3f(0.f, 0.f, zBias);
|
ret += zeus::CVector3f(0.f, 0.f, zBias);
|
||||||
|
@ -353,7 +353,7 @@ void CWarWasp::ApplySeparationBehavior(CStateManager& mgr, float sep) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CWarWasp::PathToHiveIsClear(CStateManager& mgr) {
|
bool CWarWasp::PathToHiveIsClear(CStateManager& mgr) const {
|
||||||
zeus::CVector3f delta = x3a0_latestLeashPosition - GetTranslation();
|
zeus::CVector3f delta = x3a0_latestLeashPosition - GetTranslation();
|
||||||
if (GetTransform().basis[1].dot(delta) > 0.f) {
|
if (GetTransform().basis[1].dot(delta) > 0.f) {
|
||||||
zeus::CAABox aabb(GetTranslation() - 10.f, GetTranslation() + 10.f);
|
zeus::CAABox aabb(GetTranslation() - 10.f, GetTranslation() + 10.f);
|
||||||
|
@ -652,7 +652,7 @@ void CWarWasp::JumpBack(CStateManager& mgr, EStateMsg msg, float dt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CWarWasp::CalcShuffleDest(CStateManager& mgr) {
|
zeus::CVector3f CWarWasp::CalcShuffleDest(const CStateManager& mgr) const {
|
||||||
zeus::CVector2f aimPos2d = GetProjectileAimPos(mgr, -1.25f).toVec2f();
|
zeus::CVector2f aimPos2d = GetProjectileAimPos(mgr, -1.25f).toVec2f();
|
||||||
zeus::CVector3f playerDir2d = mgr.GetPlayer().GetTransform().basis[1];
|
zeus::CVector3f playerDir2d = mgr.GetPlayer().GetTransform().basis[1];
|
||||||
playerDir2d.z() = 0.f;
|
playerDir2d.z() = 0.f;
|
||||||
|
@ -754,7 +754,7 @@ void CWarWasp::ProjectileAttack(CStateManager& mgr, EStateMsg msg, float dt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 CWarWasp::GetAttackTeamSize(CStateManager& mgr, s32 team) {
|
s32 CWarWasp::GetAttackTeamSize(const CStateManager& mgr, s32 team) const {
|
||||||
s32 count = 0;
|
s32 count = 0;
|
||||||
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
||||||
if (aimgr->IsPartOfTeam(GetUniqueId())) {
|
if (aimgr->IsPartOfTeam(GetUniqueId())) {
|
||||||
|
@ -769,21 +769,20 @@ s32 CWarWasp::GetAttackTeamSize(CStateManager& mgr, s32 team) {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CWarWasp::CalcTimeToNextAttack(CStateManager& mgr) {
|
float CWarWasp::CalcTimeToNextAttack(CStateManager& mgr) const {
|
||||||
float mul = 1.f;
|
float mul = 1.f;
|
||||||
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
||||||
s32 maxCount = (x3fc_flavor == EFlavorType::Two) ?
|
const s32 maxCount =
|
||||||
aimgr->GetMaxRangedAttackerCount() : aimgr->GetMaxMeleeAttackerCount();
|
(x3fc_flavor == EFlavorType::Two) ? aimgr->GetMaxRangedAttackerCount() : aimgr->GetMaxMeleeAttackerCount();
|
||||||
s32 count = (x3fc_flavor == EFlavorType::Two) ?
|
const s32 count = (x3fc_flavor == EFlavorType::Two) ? aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Ranged)
|
||||||
aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Ranged) :
|
: aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Melee);
|
||||||
aimgr->GetNumAssignedOfRole(CTeamAiRole::ETeamAiRole::Melee);
|
|
||||||
if (count <= maxCount)
|
if (count <= maxCount)
|
||||||
mul *= 0.5f;
|
mul *= 0.5f;
|
||||||
}
|
}
|
||||||
return (mgr.GetActiveRandom()->Float() * x308_attackTimeVariation + x304_averageAttackTime) * mul;
|
return (mgr.GetActiveRandom()->Float() * x308_attackTimeVariation + x304_averageAttackTime) * mul;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CWarWasp::CalcOffTotemAngle(CStateManager& mgr) {
|
float CWarWasp::CalcOffTotemAngle(CStateManager& mgr) const {
|
||||||
return mgr.GetActiveRandom()->Float() * zeus::degToRad(80.f) + zeus::degToRad(10.f);
|
return mgr.GetActiveRandom()->Float() * zeus::degToRad(80.f) + zeus::degToRad(10.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +832,7 @@ void CWarWasp::SetUpCircleTelegraphTeam(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TUniqueId CWarWasp::GetAttackTeamLeader(CStateManager& mgr, s32 team) {
|
TUniqueId CWarWasp::GetAttackTeamLeader(const CStateManager& mgr, s32 team) const {
|
||||||
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
||||||
if (aimgr->IsPartOfTeam(GetUniqueId())) {
|
if (aimgr->IsPartOfTeam(GetUniqueId())) {
|
||||||
for (const CTeamAiRole& role : aimgr->GetRoles()) {
|
for (const CTeamAiRole& role : aimgr->GetRoles()) {
|
||||||
|
@ -866,7 +865,7 @@ void CWarWasp::TryCircleTeamMerge(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float CWarWasp::GetTeamZStratum(s32 team) {
|
float CWarWasp::GetTeamZStratum(s32 team) const {
|
||||||
if (team > 0) {
|
if (team > 0) {
|
||||||
if ((team & 1) == 1)
|
if ((team & 1) == 1)
|
||||||
return -3.f - float(team / 2) * 3.f;
|
return -3.f - float(team / 2) * 3.f;
|
||||||
|
@ -878,19 +877,19 @@ float CWarWasp::GetTeamZStratum(s32 team) {
|
||||||
|
|
||||||
static const float Table[] = {0.4f, 0.6f, 1.f};
|
static const float Table[] = {0.4f, 0.6f, 1.f};
|
||||||
|
|
||||||
float CWarWasp::CalcSeekMagnitude(CStateManager& mgr) {
|
float CWarWasp::CalcSeekMagnitude(const CStateManager& mgr) const {
|
||||||
float ret = ((x708_circleAttackTeam >= 0 && x708_circleAttackTeam < 3) ? Table[x708_circleAttackTeam] : 1.f) * 0.9f;
|
const float ret = ((x708_circleAttackTeam >= 0 && x708_circleAttackTeam < 3) ? Table[x708_circleAttackTeam] : 1.f) * 0.9f;
|
||||||
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
||||||
if (aimgr->IsPartOfTeam(GetUniqueId())) {
|
if (aimgr->IsPartOfTeam(GetUniqueId())) {
|
||||||
if (aimgr->GetMaxMeleeAttackerCount() > 1) {
|
if (aimgr->GetMaxMeleeAttackerCount() > 1) {
|
||||||
if (GetAttackTeamLeader(mgr, x708_circleAttackTeam) != GetUniqueId()) {
|
if (GetAttackTeamLeader(mgr, x708_circleAttackTeam) != GetUniqueId()) {
|
||||||
zeus::CVector3f fromPlatformCenter = GetTranslation() - x6b0_circleBurstPos;
|
const zeus::CVector3f fromPlatformCenter = GetTranslation() - x6b0_circleBurstPos;
|
||||||
float minAngle = zeus::degToRad(360.f);
|
float minAngle = zeus::degToRad(360.f);
|
||||||
for (const CTeamAiRole& role : aimgr->GetRoles()) {
|
for (const CTeamAiRole& role : aimgr->GetRoles()) {
|
||||||
if (const CWarWasp* other = CPatterned::CastTo<CWarWasp>(mgr.GetObjectById(role.GetOwnerId()))) {
|
if (const CWarWasp* other = CPatterned::CastTo<CWarWasp>(mgr.GetObjectById(role.GetOwnerId()))) {
|
||||||
if (x708_circleAttackTeam == other->x708_circleAttackTeam &&
|
if (x708_circleAttackTeam == other->x708_circleAttackTeam &&
|
||||||
GetTransform().basis[1].dot(other->GetTranslation() - GetTranslation()) > 0.f) {
|
GetTransform().basis[1].dot(other->GetTranslation() - GetTranslation()) > 0.f) {
|
||||||
float angle =
|
const float angle =
|
||||||
zeus::CVector3f::getAngleDiff(fromPlatformCenter, other->GetTranslation() - x6b0_circleBurstPos);
|
zeus::CVector3f::getAngleDiff(fromPlatformCenter, other->GetTranslation() - x6b0_circleBurstPos);
|
||||||
if (angle < minAngle)
|
if (angle < minAngle)
|
||||||
minAngle = angle;
|
minAngle = angle;
|
||||||
|
@ -1155,14 +1154,14 @@ bool CWarWasp::ShouldDodge(CStateManager& mgr, float arg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CWarWasp::CheckCircleAttackSpread(CStateManager& mgr, s32 team) {
|
bool CWarWasp::CheckCircleAttackSpread(const CStateManager& mgr, s32 team) const {
|
||||||
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(x674_aiMgr)) {
|
||||||
s32 teamSize = GetAttackTeamSize(mgr, team);
|
const s32 teamSize = GetAttackTeamSize(mgr, team);
|
||||||
if (teamSize == 1)
|
if (teamSize == 1)
|
||||||
return true;
|
return true;
|
||||||
TUniqueId leaderId = GetAttackTeamLeader(mgr, team);
|
const TUniqueId leaderId = GetAttackTeamLeader(mgr, team);
|
||||||
if (const CWarWasp* leaderWasp = CPatterned::CastTo<CWarWasp>(mgr.GetObjectById(leaderId))) {
|
if (const CWarWasp* leaderWasp = CPatterned::CastTo<CWarWasp>(mgr.GetObjectById(leaderId))) {
|
||||||
zeus::CVector3f platformToLeaderWasp = leaderWasp->GetTranslation() - x6b0_circleBurstPos;
|
const zeus::CVector3f platformToLeaderWasp = leaderWasp->GetTranslation() - x6b0_circleBurstPos;
|
||||||
float maxAng = 0.f;
|
float maxAng = 0.f;
|
||||||
for (const CTeamAiRole& role : aimgr->GetRoles()) {
|
for (const CTeamAiRole& role : aimgr->GetRoles()) {
|
||||||
if (role.GetOwnerId() == leaderId)
|
if (role.GetOwnerId() == leaderId)
|
||||||
|
@ -1171,7 +1170,7 @@ bool CWarWasp::CheckCircleAttackSpread(CStateManager& mgr, s32 team) {
|
||||||
if (wasp2->x708_circleAttackTeam == team) {
|
if (wasp2->x708_circleAttackTeam == team) {
|
||||||
if (leaderWasp->GetTransform().basis[1].dot(wasp2->GetTranslation() - leaderWasp->GetTranslation()) > 0.f)
|
if (leaderWasp->GetTransform().basis[1].dot(wasp2->GetTranslation() - leaderWasp->GetTranslation()) > 0.f)
|
||||||
return false;
|
return false;
|
||||||
float angle =
|
const float angle =
|
||||||
zeus::CVector3f::getAngleDiff(wasp2->GetTranslation() - x6b0_circleBurstPos, platformToLeaderWasp);
|
zeus::CVector3f::getAngleDiff(wasp2->GetTranslation() - x6b0_circleBurstPos, platformToLeaderWasp);
|
||||||
if (angle > maxAng)
|
if (angle > maxAng)
|
||||||
maxAng = angle;
|
maxAng = angle;
|
||||||
|
|
|
@ -47,26 +47,26 @@ class CWarWasp : public CPatterned {
|
||||||
void SwarmRemove(CStateManager& mgr);
|
void SwarmRemove(CStateManager& mgr);
|
||||||
void ApplyDamage(CStateManager& mgr);
|
void ApplyDamage(CStateManager& mgr);
|
||||||
void SetUpCircleBurstWaypoint(CStateManager& mgr);
|
void SetUpCircleBurstWaypoint(CStateManager& mgr);
|
||||||
zeus::CVector3f GetProjectileAimPos(CStateManager& mgr, float zBias);
|
zeus::CVector3f GetProjectileAimPos(const CStateManager& mgr, float zBias) const;
|
||||||
zeus::CVector3f GetCloseInPos(const CStateManager& mgr, const zeus::CVector3f& aimPos) const;
|
zeus::CVector3f GetCloseInPos(const CStateManager& mgr, const zeus::CVector3f& aimPos) const;
|
||||||
float GetCloseInZBasis(const CStateManager& mgr) const;
|
float GetCloseInZBasis(const CStateManager& mgr) const;
|
||||||
void SetUpPathFindBehavior(CStateManager& mgr);
|
void SetUpPathFindBehavior(CStateManager& mgr);
|
||||||
s32 GetAttackTeamSize(CStateManager& mgr, s32 team);
|
s32 GetAttackTeamSize(const CStateManager& mgr, s32 team) const;
|
||||||
float CalcTimeToNextAttack(CStateManager& mgr);
|
float CalcTimeToNextAttack(CStateManager& mgr) const;
|
||||||
float CalcOffTotemAngle(CStateManager& mgr);
|
float CalcOffTotemAngle(CStateManager& mgr) const;
|
||||||
void JoinCircleAttackTeam(s32 unit, CStateManager& mgr);
|
void JoinCircleAttackTeam(s32 unit, CStateManager& mgr);
|
||||||
void SetUpCircleTelegraphTeam(CStateManager& mgr);
|
void SetUpCircleTelegraphTeam(CStateManager& mgr);
|
||||||
TUniqueId GetAttackTeamLeader(CStateManager& mgr, s32 team);
|
TUniqueId GetAttackTeamLeader(const CStateManager& mgr, s32 team) const;
|
||||||
void TryCircleTeamMerge(CStateManager& mgr);
|
void TryCircleTeamMerge(CStateManager& mgr);
|
||||||
float GetTeamZStratum(s32 team);
|
float GetTeamZStratum(s32 team) const;
|
||||||
float CalcSeekMagnitude(CStateManager& mgr);
|
float CalcSeekMagnitude(const CStateManager& mgr) const;
|
||||||
void UpdateTelegraphMoveSpeed(CStateManager& mgr);
|
void UpdateTelegraphMoveSpeed(CStateManager& mgr);
|
||||||
bool CheckCircleAttackSpread(CStateManager& mgr, s32 team);
|
bool CheckCircleAttackSpread(const CStateManager& mgr, s32 team) const;
|
||||||
void ApplyNormalSteering(CStateManager& mgr);
|
void ApplyNormalSteering(CStateManager& mgr);
|
||||||
void ApplySeparationBehavior(CStateManager& mgr, float sep);
|
void ApplySeparationBehavior(CStateManager& mgr, float sep);
|
||||||
bool PathToHiveIsClear(CStateManager& mgr);
|
bool PathToHiveIsClear(CStateManager& mgr) const;
|
||||||
bool SteerToDeactivatePos(CStateManager& mgr, EStateMsg msg, float dt);
|
bool SteerToDeactivatePos(CStateManager& mgr, EStateMsg msg, float dt);
|
||||||
zeus::CVector3f CalcShuffleDest(CStateManager& mgr);
|
zeus::CVector3f CalcShuffleDest(const CStateManager& mgr) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_PATTERNED(WarWasp)
|
DEFINE_PATTERNED(WarWasp)
|
||||||
|
|
|
@ -566,7 +566,7 @@ void CElementGen::UpdatePSTranslationAndOrientation() {
|
||||||
sepo->GetValue(x74_curFrame, x2c0_SEPO);
|
sepo->GetValue(x74_curFrame, x2c0_SEPO);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<CParticleGen> CElementGen::ConstructChildParticleSystem(const TToken<CGenDescription>& desc) {
|
std::unique_ptr<CParticleGen> CElementGen::ConstructChildParticleSystem(const TToken<CGenDescription>& desc) const {
|
||||||
CElementGen* ret = new CElementGen(desc, EModelOrientationType::Normal,
|
CElementGen* ret = new CElementGen(desc, EModelOrientationType::Normal,
|
||||||
x26d_27_enableOPTS ? EOptionalSystemFlags::Two : EOptionalSystemFlags::One);
|
x26d_27_enableOPTS ? EOptionalSystemFlags::Two : EOptionalSystemFlags::One);
|
||||||
ret->x26d_26_modelsUseLights = x26d_26_modelsUseLights;
|
ret->x26d_26_modelsUseLights = x26d_26_modelsUseLights;
|
||||||
|
|
|
@ -172,7 +172,7 @@ public:
|
||||||
void CreateNewParticles(int);
|
void CreateNewParticles(int);
|
||||||
void UpdatePSTranslationAndOrientation();
|
void UpdatePSTranslationAndOrientation();
|
||||||
void UpdateChildParticleSystems(double);
|
void UpdateChildParticleSystems(double);
|
||||||
std::unique_ptr<CParticleGen> ConstructChildParticleSystem(const TToken<CGenDescription>&);
|
std::unique_ptr<CParticleGen> ConstructChildParticleSystem(const TToken<CGenDescription>&) const;
|
||||||
void UpdateLightParameters();
|
void UpdateLightParameters();
|
||||||
void BuildParticleSystemBounds();
|
void BuildParticleSystemBounds();
|
||||||
u32 GetEmitterTime() const { return x74_curFrame; }
|
u32 GetEmitterTime() const { return x74_curFrame; }
|
||||||
|
|
|
@ -133,6 +133,7 @@ public:
|
||||||
void EnterComboFire(s32 gunId, CStateManager& mgr);
|
void EnterComboFire(s32 gunId, CStateManager& mgr);
|
||||||
void ReturnToDefault(CStateManager& mgr, float dt, bool setState);
|
void ReturnToDefault(CStateManager& mgr, float dt, bool setState);
|
||||||
CGunController* GunController() { return x328_gunController.get(); }
|
CGunController* GunController() { return x328_gunController.get(); }
|
||||||
|
const CGunController* GunController() const { return x328_gunController.get(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -811,7 +811,7 @@ void CPlayerGun::ChangeWeapon(const CPlayerState& playerState, CStateManager& mg
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayerGun::GetLctrWithShake(zeus::CTransform& xfOut, const CModelData& mData, std::string_view lctrName,
|
void CPlayerGun::GetLctrWithShake(zeus::CTransform& xfOut, const CModelData& mData, std::string_view lctrName,
|
||||||
bool shake, bool dyn) {
|
bool shake, bool dyn) const {
|
||||||
if (dyn)
|
if (dyn)
|
||||||
xfOut = mData.GetScaledLocatorTransformDynamic(lctrName, nullptr);
|
xfOut = mData.GetScaledLocatorTransformDynamic(lctrName, nullptr);
|
||||||
else
|
else
|
||||||
|
|
|
@ -284,7 +284,7 @@ private:
|
||||||
void ReturnToRestPose();
|
void ReturnToRestPose();
|
||||||
void ChangeWeapon(const CPlayerState& playerState, CStateManager& mgr);
|
void ChangeWeapon(const CPlayerState& playerState, CStateManager& mgr);
|
||||||
void GetLctrWithShake(zeus::CTransform& xfOut, const CModelData& mData, std::string_view lctrName, bool shake,
|
void GetLctrWithShake(zeus::CTransform& xfOut, const CModelData& mData, std::string_view lctrName, bool shake,
|
||||||
bool dyn);
|
bool dyn) const;
|
||||||
void UpdateLeftArmTransform(const CModelData& mData, const CStateManager& mgr);
|
void UpdateLeftArmTransform(const CModelData& mData, const CStateManager& mgr);
|
||||||
void ProcessGunMorph(float dt, CStateManager& mgr);
|
void ProcessGunMorph(float dt, CStateManager& mgr);
|
||||||
void SetPhazonBeamFeedback(bool active);
|
void SetPhazonBeamFeedback(bool active);
|
||||||
|
@ -338,6 +338,7 @@ public:
|
||||||
void SetTransform(const zeus::CTransform& xf) { x3e8_xf = xf; }
|
void SetTransform(const zeus::CTransform& xf) { x3e8_xf = xf; }
|
||||||
void SetAssistAimTransform(const zeus::CTransform& xf) { x478_assistAimXf = xf; }
|
void SetAssistAimTransform(const zeus::CTransform& xf) { x478_assistAimXf = xf; }
|
||||||
CGrappleArm& GetGrappleArm() { return *x740_grappleArm; }
|
CGrappleArm& GetGrappleArm() { return *x740_grappleArm; }
|
||||||
|
const CGrappleArm& GetGrappleArm() const { return *x740_grappleArm; }
|
||||||
void DamageRumble(const zeus::CVector3f& location, float damage, const CStateManager& mgr);
|
void DamageRumble(const zeus::CVector3f& location, float damage, const CStateManager& mgr);
|
||||||
void ResetCharge(CStateManager& mgr, bool resetBeam);
|
void ResetCharge(CStateManager& mgr, bool resetBeam);
|
||||||
void HandleBeamChange(const CFinalInput& input, CStateManager& mgr);
|
void HandleBeamChange(const CFinalInput& input, CStateManager& mgr);
|
||||||
|
|
|
@ -62,7 +62,7 @@ float CProjectileInfo::GetProjectileSpeed() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CProjectileInfo::PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
|
zeus::CVector3f CProjectileInfo::PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
|
||||||
const CPlayer& player, bool gravity, float dt) {
|
const CPlayer& player, bool gravity, float dt) const {
|
||||||
return PredictInterceptPos(gunPos, aimPos, player, gravity, GetProjectileSpeed(), dt);
|
return PredictInterceptPos(gunPos, aimPos, player, gravity, GetProjectileSpeed(), dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ public:
|
||||||
static zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
|
static zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
|
||||||
const CPlayer& player, bool gravity, float speed, float dt);
|
const CPlayer& player, bool gravity, float speed, float dt);
|
||||||
zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
|
zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
|
||||||
const CPlayer& player, bool gravity, float dt);
|
const CPlayer& player, bool gravity, float dt) const;
|
||||||
|
|
||||||
const CDamageInfo& GetDamage() const { return xc_damageInfo; }
|
const CDamageInfo& GetDamage() const { return xc_damageInfo; }
|
||||||
TToken<CWeaponDescription>& Token() { return x0_weaponDescription; }
|
TToken<CWeaponDescription>& Token() { return x0_weaponDescription; }
|
||||||
|
|
|
@ -212,7 +212,7 @@ void CFishCloud::BuildBoidNearPartitionList(const zeus::CVector3f& pos, float ra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFishCloud::PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb) {
|
void CFishCloud::PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb) const {
|
||||||
auto plane = FindClosestPlane(aabb, boid.x0_pos);
|
auto plane = FindClosestPlane(aabb, boid.x0_pos);
|
||||||
boid.x0_pos -= plane.pointToPlaneDist(boid.x0_pos) * plane.normal() + 0.0001f * plane.normal();
|
boid.x0_pos -= plane.pointToPlaneDist(boid.x0_pos) * plane.normal() + 0.0001f * plane.normal();
|
||||||
boid.xc_vel.y() = mgr.GetActiveRandom()->Float() - 0.5f;
|
boid.xc_vel.y() = mgr.GetActiveRandom()->Float() - 0.5f;
|
||||||
|
|
|
@ -100,7 +100,7 @@ class CFishCloud : public CActor {
|
||||||
void BuildBoidNearList(const zeus::CVector3f& pos, float radius, rstl::reserved_vector<CBoid*, 25>& nearList);
|
void BuildBoidNearList(const zeus::CVector3f& pos, float radius, rstl::reserved_vector<CBoid*, 25>& nearList);
|
||||||
void BuildBoidNearPartitionList(const zeus::CVector3f& pos, float radius,
|
void BuildBoidNearPartitionList(const zeus::CVector3f& pos, float radius,
|
||||||
rstl::reserved_vector<CBoid*, 25>& nearList);
|
rstl::reserved_vector<CBoid*, 25>& nearList);
|
||||||
void PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb);
|
void PlaceBoid(CStateManager& mgr, CBoid& boid, const zeus::CAABox& aabb) const;
|
||||||
void ApplySeparation(CBoid& boid, const rstl::reserved_vector<CBoid*, 25>& nearList) const;
|
void ApplySeparation(CBoid& boid, const rstl::reserved_vector<CBoid*, 25>& nearList) const;
|
||||||
void ApplySeparation(CBoid& boid, const zeus::CVector3f& separateFrom,
|
void ApplySeparation(CBoid& boid, const zeus::CVector3f& separateFrom,
|
||||||
float separationRadius, float separationMagnitude) const;
|
float separationRadius, float separationMagnitude) const;
|
||||||
|
|
|
@ -895,7 +895,7 @@ void CGameArea::LoadScriptObjects(CStateManager& mgr) {
|
||||||
mgr.InitScriptObjects(objIds);
|
mgr.InitScriptObjects(objIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<const u8*, u32> CGameArea::GetLayerScriptBuffer(int layer) {
|
std::pair<const u8*, u32> CGameArea::GetLayerScriptBuffer(int layer) const {
|
||||||
if (!xf0_24_postConstructed)
|
if (!xf0_24_postConstructed)
|
||||||
return {};
|
return {};
|
||||||
return x12c_postConstructed->x110c_layerPtrs[layer];
|
return x12c_postConstructed->x110c_layerPtrs[layer];
|
||||||
|
|
|
@ -315,7 +315,7 @@ public:
|
||||||
void StartStreamIn(CStateManager& mgr);
|
void StartStreamIn(CStateManager& mgr);
|
||||||
void Validate(CStateManager& mgr);
|
void Validate(CStateManager& mgr);
|
||||||
void LoadScriptObjects(CStateManager& mgr);
|
void LoadScriptObjects(CStateManager& mgr);
|
||||||
std::pair<const u8*, u32> GetLayerScriptBuffer(int layer);
|
std::pair<const u8*, u32> GetLayerScriptBuffer(int layer) const;
|
||||||
void PostConstructArea();
|
void PostConstructArea();
|
||||||
void FillInStaticGeometry(bool textures = true);
|
void FillInStaticGeometry(bool textures = true);
|
||||||
void VerifyTokenList(CStateManager& stateMgr);
|
void VerifyTokenList(CStateManager& stateMgr);
|
||||||
|
|
|
@ -116,7 +116,7 @@ void CPFOpenList::Pop(CPFRegion* reg) {
|
||||||
reg->Data()->SetOpenLess(nullptr);
|
reg->Data()->SetOpenLess(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPFOpenList::Test(CPFRegion* reg) { return x0_bitSet.Test(reg->GetIndex()); }
|
bool CPFOpenList::Test(const CPFRegion* reg) const { return x0_bitSet.Test(reg->GetIndex()); }
|
||||||
|
|
||||||
CPFArea::CPFArea(std::unique_ptr<u8[]>&& buf, u32 len) {
|
CPFArea::CPFArea(std::unique_ptr<u8[]>&& buf, u32 len) {
|
||||||
CMemoryInStream r(buf.get(), len);
|
CMemoryInStream r(buf.get(), len);
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
void Push(CPFRegion* reg);
|
void Push(CPFRegion* reg);
|
||||||
CPFRegion* Pop();
|
CPFRegion* Pop();
|
||||||
void Pop(CPFRegion* reg);
|
void Pop(CPFRegion* reg);
|
||||||
bool Test(CPFRegion* reg);
|
bool Test(const CPFRegion* reg) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPFArea {
|
class CPFArea {
|
||||||
|
|
|
@ -66,7 +66,7 @@ float CPFRegion::PointHeight(const zeus::CVector3f& point) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPFRegion::FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& normal,
|
bool CPFRegion::FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& normal,
|
||||||
const zeus::CVector3f& point, bool excludePolyPoints) {
|
const zeus::CVector3f& point, bool excludePolyPoints) const {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < polyPoints.size(); ++i) {
|
for (i = 0; i < polyPoints.size(); ++i) {
|
||||||
|
@ -122,7 +122,7 @@ bool CPFRegion::FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>& po
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPFRegion::FindBestPoint(std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& point, u32 flags,
|
bool CPFRegion::FindBestPoint(std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& point, u32 flags,
|
||||||
float paddingSq) {
|
float paddingSq) const {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
bool isFlyer = (flags & 0x2) != 0;
|
bool isFlyer = (flags & 0x2) != 0;
|
||||||
x4c_regionData->SetBestPointDistanceSquared(paddingSq);
|
x4c_regionData->SetBestPointDistanceSquared(paddingSq);
|
||||||
|
|
|
@ -65,9 +65,9 @@ public:
|
||||||
const CPFNode* GetNode(u32 i) const { return x4_startNode + i; }
|
const CPFNode* GetNode(u32 i) const { return x4_startNode + i; }
|
||||||
float PointHeight(const zeus::CVector3f& point) const;
|
float PointHeight(const zeus::CVector3f& point) const;
|
||||||
bool FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>&, const zeus::CVector3f&, const zeus::CVector3f&,
|
bool FindClosestPointOnPolygon(const std::vector<zeus::CVector3f>&, const zeus::CVector3f&, const zeus::CVector3f&,
|
||||||
bool);
|
bool) const;
|
||||||
bool FindBestPoint(std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& point, u32 flags,
|
bool FindBestPoint(std::vector<zeus::CVector3f>& polyPoints, const zeus::CVector3f& point, u32 flags,
|
||||||
float paddingSq);
|
float paddingSq) const;
|
||||||
void SetLinkTo(s32 idx);
|
void SetLinkTo(s32 idx);
|
||||||
void DropToGround(zeus::CVector3f& point) const;
|
void DropToGround(zeus::CVector3f& point) const;
|
||||||
zeus::CVector3f GetLinkMidPoint(const CPFLink& link) const;
|
zeus::CVector3f GetLinkMidPoint(const CPFLink& link) const;
|
||||||
|
|
|
@ -1165,7 +1165,7 @@ void CPatterned::UpdateAlphaDelta(float dt, CStateManager& mgr) {
|
||||||
x64_modelData->AnimationData()->GetParticleDB().SetModulationColorAllActiveEffects(zeus::CColor(1.f, alpha));
|
x64_modelData->AnimationData()->GetParticleDB().SetModulationColorAllActiveEffects(zeus::CColor(1.f, alpha));
|
||||||
}
|
}
|
||||||
|
|
||||||
float CPatterned::CalcDyingThinkRate() {
|
float CPatterned::CalcDyingThinkRate() const {
|
||||||
float f0 = (x401_28_burning ? (x3f4_burnThinkRateTimer / 1.5f) : 1.f);
|
float f0 = (x401_28_burning ? (x3f4_burnThinkRateTimer / 1.5f) : 1.f);
|
||||||
return zeus::max(0.1f, f0);
|
return zeus::max(0.1f, f0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,7 +372,7 @@ public:
|
||||||
void SetDestPos(const zeus::CVector3f& pos) { x2e0_destPos = pos; }
|
void SetDestPos(const zeus::CVector3f& pos) { x2e0_destPos = pos; }
|
||||||
void UpdateAlphaDelta(float dt, CStateManager& mgr);
|
void UpdateAlphaDelta(float dt, CStateManager& mgr);
|
||||||
void SetModelAlpha(float a) { x42c_color.a() = a; }
|
void SetModelAlpha(float a) { x42c_color.a() = a; }
|
||||||
float CalcDyingThinkRate();
|
float CalcDyingThinkRate() const;
|
||||||
void UpdateDamageColor(float dt);
|
void UpdateDamageColor(float dt);
|
||||||
CScriptCoverPoint* GetCoverPoint(CStateManager& mgr, TUniqueId id) const;
|
CScriptCoverPoint* GetCoverPoint(CStateManager& mgr, TUniqueId id) const;
|
||||||
void SetCoverPoint(CScriptCoverPoint* cp, TUniqueId& id);
|
void SetCoverPoint(CScriptCoverPoint* cp, TUniqueId& id);
|
||||||
|
|
|
@ -218,7 +218,7 @@ void CPhysicsActor::ComputeDerivedQuantities() {
|
||||||
x144_angularVelocity = xf4_inertiaTensorRecip * x108_angularMomentum;
|
x144_angularVelocity = xf4_inertiaTensorRecip * x108_angularMomentum;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPhysicsActor::WillMove(const CStateManager&) {
|
bool CPhysicsActor::WillMove(const CStateManager&) const {
|
||||||
return !zeus::close_enough(zeus::skZero3f, x138_velocity) ||
|
return !zeus::close_enough(zeus::skZero3f, x138_velocity) ||
|
||||||
!zeus::close_enough(zeus::skZero3f, x168_impulse) ||
|
!zeus::close_enough(zeus::skZero3f, x168_impulse) ||
|
||||||
!zeus::close_enough(zeus::skZero3f, x174_torque) ||
|
!zeus::close_enough(zeus::skZero3f, x174_torque) ||
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
void SetVelocityWR(const zeus::CVector3f& vel);
|
void SetVelocityWR(const zeus::CVector3f& vel);
|
||||||
void SetVelocityOR(const zeus::CVector3f& vel);
|
void SetVelocityOR(const zeus::CVector3f& vel);
|
||||||
void SetMomentumWR(const zeus::CVector3f& m) { x150_momentum = m; }
|
void SetMomentumWR(const zeus::CVector3f& m) { x150_momentum = m; }
|
||||||
const zeus::CVector3f& GetConstantForce() { return xfc_constantForce; }
|
const zeus::CVector3f& GetConstantForce() const { return xfc_constantForce; }
|
||||||
void SetConstantForce(const zeus::CVector3f& f) { xfc_constantForce = f; }
|
void SetConstantForce(const zeus::CVector3f& f) { xfc_constantForce = f; }
|
||||||
void SetAngularMomentum(const zeus::CAxisAngle& m) { x108_angularMomentum = m; }
|
void SetAngularMomentum(const zeus::CAxisAngle& m) { x108_angularMomentum = m; }
|
||||||
const zeus::CVector3f& GetMomentum() const { return x150_momentum; }
|
const zeus::CVector3f& GetMomentum() const { return x150_momentum; }
|
||||||
|
@ -170,7 +170,7 @@ public:
|
||||||
void ClearForcesAndTorques();
|
void ClearForcesAndTorques();
|
||||||
void Stop();
|
void Stop();
|
||||||
void ComputeDerivedQuantities();
|
void ComputeDerivedQuantities();
|
||||||
bool WillMove(const CStateManager&);
|
bool WillMove(const CStateManager&) const;
|
||||||
void SetPhysicsState(const CPhysicsState& state);
|
void SetPhysicsState(const CPhysicsState& state);
|
||||||
CPhysicsState GetPhysicsState() const;
|
CPhysicsState GetPhysicsState() const;
|
||||||
bool IsMovable() const { return xf8_24_movable; }
|
bool IsMovable() const { return xf8_24_movable; }
|
||||||
|
|
|
@ -915,7 +915,7 @@ void CPlayer::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||||
|
|
||||||
CHealthInfo* CPlayer::HealthInfo(CStateManager& mgr) { return &mgr.GetPlayerState()->HealthInfo(); }
|
CHealthInfo* CPlayer::HealthInfo(CStateManager& mgr) { return &mgr.GetPlayerState()->HealthInfo(); }
|
||||||
|
|
||||||
bool CPlayer::IsUnderBetaMetroidAttack(CStateManager& mgr) const {
|
bool CPlayer::IsUnderBetaMetroidAttack(const CStateManager& mgr) const {
|
||||||
if (x274_energyDrain.GetEnergyDrainIntensity() > 0.f) {
|
if (x274_energyDrain.GetEnergyDrainIntensity() > 0.f) {
|
||||||
for (const CEnergyDrainSource& source : x274_energyDrain.GetEnergyDrainSources())
|
for (const CEnergyDrainSource& source : x274_energyDrain.GetEnergyDrainSources())
|
||||||
if (CPatterned::CastTo<MP1::CMetroidBeta>(mgr.GetObjectById(source.GetEnergyDrainSourceId())))
|
if (CPatterned::CastTo<MP1::CMetroidBeta>(mgr.GetObjectById(source.GetEnergyDrainSourceId())))
|
||||||
|
@ -1000,7 +1000,7 @@ void CPlayer::UpdateScanningState(const CFinalInput& input, CStateManager& mgr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPlayer::ValidateScanning(const CFinalInput& input, CStateManager& mgr) {
|
bool CPlayer::ValidateScanning(const CFinalInput& input, const CStateManager& mgr) const {
|
||||||
if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::ScanItem, input)) {
|
if (ControlMapper::GetDigitalInput(ControlMapper::ECommands::ScanItem, input)) {
|
||||||
if (x304_orbitState == EPlayerOrbitState::OrbitObject) {
|
if (x304_orbitState == EPlayerOrbitState::OrbitObject) {
|
||||||
if (TCastToPtr<CActor> act = mgr.ObjectById(x310_orbitTargetId)) {
|
if (TCastToPtr<CActor> act = mgr.ObjectById(x310_orbitTargetId)) {
|
||||||
|
@ -2660,7 +2660,7 @@ void CPlayer::UpdateFootstepSounds(const CFinalInput& input, CStateManager& mgr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 CPlayer::GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16* table, u32 length, u16 defId) {
|
u16 CPlayer::GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16* table, u32 length, u16 defId) const {
|
||||||
u16 ret = defId;
|
u16 ret = defId;
|
||||||
zeus::CAABox aabb = GetBoundingBox();
|
zeus::CAABox aabb = GetBoundingBox();
|
||||||
aabb.accumulateBounds(x34_transform.origin + zeus::skDown);
|
aabb.accumulateBounds(x34_transform.origin + zeus::skDown);
|
||||||
|
@ -3274,7 +3274,7 @@ void CPlayer::ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, f
|
||||||
SetAngularVelocityOR(newAngVel);
|
SetAngularVelocityOR(newAngVel);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr) {
|
bool CPlayer::ValidateFPPosition(const zeus::CVector3f& pos, const CStateManager& mgr) const {
|
||||||
CMaterialFilter solidFilter = CMaterialFilter::MakeInclude({EMaterialTypes::Solid});
|
CMaterialFilter solidFilter = CMaterialFilter::MakeInclude({EMaterialTypes::Solid});
|
||||||
zeus::CAABox aabb(x2d8_fpBounds.min - 1.f + pos, x2d8_fpBounds.max + 1.f + pos);
|
zeus::CAABox aabb(x2d8_fpBounds.min - 1.f + pos, x2d8_fpBounds.max + 1.f + pos);
|
||||||
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
||||||
|
@ -3837,7 +3837,7 @@ static zeus::CAABox BuildNearListBox(bool cropBottom, const zeus::CTransform& xf
|
||||||
return aabb.getTransformedAABox(xf);
|
return aabb.getTransformedAABox(xf);
|
||||||
}
|
}
|
||||||
|
|
||||||
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr) {
|
TUniqueId CPlayer::FindAimTargetId(CStateManager& mgr) const {
|
||||||
float dist = g_tweakPlayer->GetAimMaxDistance();
|
float dist = g_tweakPlayer->GetAimMaxDistance();
|
||||||
if (x9c6_24_extendTargetDistance)
|
if (x9c6_24_extendTargetDistance)
|
||||||
dist *= 5.f;
|
dist *= 5.f;
|
||||||
|
@ -3917,7 +3917,7 @@ TUniqueId CPlayer::CheckEnemiesAgainstOrbitZone(const rstl::reserved_vector<TUni
|
||||||
return bestId;
|
return bestId;
|
||||||
}
|
}
|
||||||
|
|
||||||
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) {
|
TUniqueId CPlayer::FindOrbitTargetId(CStateManager& mgr) const {
|
||||||
return FindBestOrbitableObject(x354_onScreenOrbitObjects, x330_orbitZoneMode, mgr);
|
return FindBestOrbitableObject(x354_onScreenOrbitObjects, x330_orbitZoneMode, mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,13 +381,13 @@ public:
|
||||||
void TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr);
|
void TakeDamage(bool, const zeus::CVector3f&, float, EWeaponType, CStateManager& mgr);
|
||||||
void Accept(IVisitor& visitor) override;
|
void Accept(IVisitor& visitor) override;
|
||||||
CHealthInfo* HealthInfo(CStateManager& mgr) override;
|
CHealthInfo* HealthInfo(CStateManager& mgr) override;
|
||||||
bool IsUnderBetaMetroidAttack(CStateManager& mgr) const;
|
bool IsUnderBetaMetroidAttack(const CStateManager& mgr) const;
|
||||||
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
||||||
void Touch(CActor& actor, CStateManager& mgr) override;
|
void Touch(CActor& actor, CStateManager& mgr) override;
|
||||||
void DoPreThink(float dt, CStateManager& mgr);
|
void DoPreThink(float dt, CStateManager& mgr);
|
||||||
void DoThink(float dt, CStateManager& mgr);
|
void DoThink(float dt, CStateManager& mgr);
|
||||||
void UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float);
|
void UpdateScanningState(const CFinalInput& input, CStateManager& mgr, float);
|
||||||
bool ValidateScanning(const CFinalInput& input, CStateManager& mgr);
|
bool ValidateScanning(const CFinalInput& input, const CStateManager& mgr) const;
|
||||||
void FinishNewScan(CStateManager& mgr);
|
void FinishNewScan(CStateManager& mgr);
|
||||||
void SetScanningState(EPlayerScanState, CStateManager& mgr);
|
void SetScanningState(EPlayerScanState, CStateManager& mgr);
|
||||||
void SetSpawnedMorphBallState(EPlayerMorphBallState, CStateManager&);
|
void SetSpawnedMorphBallState(EPlayerMorphBallState, CStateManager&);
|
||||||
|
@ -432,7 +432,7 @@ public:
|
||||||
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
||||||
void SetVisorSteam(float, float, float, CAssetId, bool);
|
void SetVisorSteam(float, float, float, CAssetId, bool);
|
||||||
void UpdateFootstepSounds(const CFinalInput& input, CStateManager&, float);
|
void UpdateFootstepSounds(const CFinalInput& input, CStateManager&, float);
|
||||||
u16 GetMaterialSoundUnderPlayer(CStateManager& mgr, const u16*, u32, u16);
|
u16 GetMaterialSoundUnderPlayer(const CStateManager& mgr, const u16*, u32, u16) const;
|
||||||
static u16 SfxIdFromMaterial(const CMaterialList&, const u16*, u32, u16);
|
static u16 SfxIdFromMaterial(const CMaterialList&, const u16*, u32, u16);
|
||||||
void UpdateCrosshairsState(const CFinalInput&);
|
void UpdateCrosshairsState(const CFinalInput&);
|
||||||
void UpdateVisorTransition(float, CStateManager& mgr);
|
void UpdateVisorTransition(float, CStateManager& mgr);
|
||||||
|
@ -460,7 +460,7 @@ public:
|
||||||
void UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float);
|
void UpdateGrappleArmTransform(const zeus::CVector3f&, CStateManager& mgr, float);
|
||||||
float GetGravity() const;
|
float GetGravity() const;
|
||||||
void ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float);
|
void ApplyGrappleForces(const CFinalInput& input, CStateManager& mgr, float);
|
||||||
bool ValidateFPPosition(const zeus::CVector3f& pos, CStateManager& mgr);
|
bool ValidateFPPosition(const zeus::CVector3f& pos, const CStateManager& mgr) const;
|
||||||
void UpdateGrappleState(const CFinalInput& input, CStateManager& mgr);
|
void UpdateGrappleState(const CFinalInput& input, CStateManager& mgr);
|
||||||
void ApplyGrappleJump(CStateManager& mgr);
|
void ApplyGrappleJump(CStateManager& mgr);
|
||||||
void BeginGrapple(zeus::CVector3f&, CStateManager& mgr);
|
void BeginGrapple(zeus::CVector3f&, CStateManager& mgr);
|
||||||
|
@ -482,11 +482,11 @@ public:
|
||||||
void UpdateAimTargetTimer(float);
|
void UpdateAimTargetTimer(float);
|
||||||
bool ValidateAimTargetId(TUniqueId, CStateManager& mgr);
|
bool ValidateAimTargetId(TUniqueId, CStateManager& mgr);
|
||||||
bool ValidateObjectForMode(TUniqueId, CStateManager& mgr) const;
|
bool ValidateObjectForMode(TUniqueId, CStateManager& mgr) const;
|
||||||
TUniqueId FindAimTargetId(CStateManager& mgr);
|
TUniqueId FindAimTargetId(CStateManager& mgr) const;
|
||||||
TUniqueId GetAimTarget() const { return x3f4_aimTarget; }
|
TUniqueId GetAimTarget() const { return x3f4_aimTarget; }
|
||||||
TUniqueId CheckEnemiesAgainstOrbitZone(const rstl::reserved_vector<TUniqueId, 1024>&, EPlayerZoneInfo,
|
TUniqueId CheckEnemiesAgainstOrbitZone(const rstl::reserved_vector<TUniqueId, 1024>&, EPlayerZoneInfo,
|
||||||
EPlayerZoneType, CStateManager& mgr) const;
|
EPlayerZoneType, CStateManager& mgr) const;
|
||||||
TUniqueId FindOrbitTargetId(CStateManager& mgr);
|
TUniqueId FindOrbitTargetId(CStateManager& mgr) const;
|
||||||
void UpdateOrbitableObjects(CStateManager& mgr);
|
void UpdateOrbitableObjects(CStateManager& mgr);
|
||||||
TUniqueId FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const;
|
TUniqueId FindBestOrbitableObject(const std::vector<TUniqueId>&, EPlayerZoneInfo, CStateManager& mgr) const;
|
||||||
void FindOrbitableObjects(const rstl::reserved_vector<TUniqueId, 1024>&, std::vector<TUniqueId>&, EPlayerZoneInfo,
|
void FindOrbitableObjects(const rstl::reserved_vector<TUniqueId, 1024>&, std::vector<TUniqueId>&, EPlayerZoneInfo,
|
||||||
|
|
|
@ -165,13 +165,13 @@ void CPlayerCameraBob::Update(float dt, CStateManager& mgr) {
|
||||||
zeus::lookAt(zeus::skZero3f, {0.f, 2.f, x78_camTranslation}, zeus::skUp);
|
zeus::lookAt(zeus::skZero3f, {0.f, 2.f, x78_camTranslation}, zeus::skUp);
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CPlayerCameraBob::CalculateRandomViewWanderPosition(CStateManager& mgr) {
|
zeus::CVector3f CPlayerCameraBob::CalculateRandomViewWanderPosition(CStateManager& mgr) const {
|
||||||
const float angle = (2.f * (M_PIF * mgr.GetActiveRandom()->Float()));
|
const float angle = (2.f * (M_PIF * mgr.GetActiveRandom()->Float()));
|
||||||
const float bias = kViewWanderRadius * mgr.GetActiveRandom()->Float();
|
const float bias = kViewWanderRadius * mgr.GetActiveRandom()->Float();
|
||||||
return {(bias * std::sin(angle)), 1.f, (bias * std::cos(angle))};
|
return {(bias * std::sin(angle)), 1.f, (bias * std::cos(angle))};
|
||||||
}
|
}
|
||||||
|
|
||||||
float CPlayerCameraBob::CalculateRandomViewWanderPitch(CStateManager& mgr) {
|
float CPlayerCameraBob::CalculateRandomViewWanderPitch(CStateManager& mgr) const {
|
||||||
return zeus::degToRad((2.f * (mgr.GetActiveRandom()->Float() - 0.5f)) * kViewWanderRollVariation);
|
return zeus::degToRad((2.f * (mgr.GetActiveRandom()->Float() - 0.5f)) * kViewWanderRollVariation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,8 +87,8 @@ public:
|
||||||
void InitViewWander(CStateManager&);
|
void InitViewWander(CStateManager&);
|
||||||
void UpdateViewWander(float, CStateManager&);
|
void UpdateViewWander(float, CStateManager&);
|
||||||
void Update(float, CStateManager&);
|
void Update(float, CStateManager&);
|
||||||
zeus::CVector3f CalculateRandomViewWanderPosition(CStateManager&);
|
zeus::CVector3f CalculateRandomViewWanderPosition(CStateManager&) const;
|
||||||
float CalculateRandomViewWanderPitch(CStateManager&);
|
float CalculateRandomViewWanderPitch(CStateManager&) const;
|
||||||
void CalculateMovingTranslation(float& x, float& y) const;
|
void CalculateMovingTranslation(float& x, float& y) const;
|
||||||
float CalculateLandingTranslation() const;
|
float CalculateLandingTranslation() const;
|
||||||
zeus::CTransform CalculateCameraBobTransformation() const;
|
zeus::CTransform CalculateCameraBobTransformation() const;
|
||||||
|
|
|
@ -223,7 +223,7 @@ void CScriptDoor::ForceClosed(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ORIGINAL 0-00 OFFSET: 8007E1C4 */
|
/* ORIGINAL 0-00 OFFSET: 8007E1C4 */
|
||||||
bool CScriptDoor::IsConnectedToArea(const CStateManager& mgr, TAreaId areaId) {
|
bool CScriptDoor::IsConnectedToArea(const CStateManager& mgr, TAreaId areaId) const {
|
||||||
const CScriptDock* dockEnt = TCastToConstPtr<CScriptDock>(mgr.GetObjectById(x282_dockId));
|
const CScriptDock* dockEnt = TCastToConstPtr<CScriptDock>(mgr.GetObjectById(x282_dockId));
|
||||||
if (dockEnt) {
|
if (dockEnt) {
|
||||||
if (dockEnt->GetAreaId() == areaId)
|
if (dockEnt->GetAreaId() == areaId)
|
||||||
|
@ -286,7 +286,7 @@ void CScriptDoor::OpenDoor(TUniqueId uid, CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ORIGINAL 0-00 OFFSET: 8007ED4C */
|
/* ORIGINAL 0-00 OFFSET: 8007ED4C */
|
||||||
CScriptDoor::EDoorOpenCondition CScriptDoor::GetDoorOpenCondition(CStateManager& mgr) {
|
CScriptDoor::EDoorOpenCondition CScriptDoor::GetDoorOpenCondition(CStateManager& mgr) const {
|
||||||
const TCastToPtr<CScriptDock> dock = mgr.ObjectById(x282_dockId);
|
const TCastToPtr<CScriptDock> dock = mgr.ObjectById(x282_dockId);
|
||||||
if (!dock)
|
if (!dock)
|
||||||
return EDoorOpenCondition::Ready;
|
return EDoorOpenCondition::Ready;
|
||||||
|
|
|
@ -49,9 +49,9 @@ public:
|
||||||
void AddToRenderer(const zeus::CFrustum&, const CStateManager& mgr) const override;
|
void AddToRenderer(const zeus::CFrustum&, const CStateManager& mgr) const override;
|
||||||
void Render(const CStateManager&) const override {}
|
void Render(const CStateManager&) const override {}
|
||||||
void ForceClosed(CStateManager&);
|
void ForceClosed(CStateManager&);
|
||||||
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area);
|
bool IsConnectedToArea(const CStateManager& mgr, TAreaId area) const;
|
||||||
void OpenDoor(TUniqueId, CStateManager&);
|
void OpenDoor(TUniqueId, CStateManager&);
|
||||||
EDoorOpenCondition GetDoorOpenCondition(CStateManager& mgr);
|
EDoorOpenCondition GetDoorOpenCondition(CStateManager& mgr) const;
|
||||||
void SetDoorAnimation(EDoorAnimType);
|
void SetDoorAnimation(EDoorAnimType);
|
||||||
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
std::optional<zeus::CAABox> GetTouchBounds() const override;
|
||||||
std::optional<zeus::CAABox> GetProjectileBounds() const;
|
std::optional<zeus::CAABox> GetProjectileBounds() const;
|
||||||
|
|
|
@ -353,7 +353,7 @@ zeus::CAABox CScriptEffect::GetSortingBounds(const CStateManager& mgr) const {
|
||||||
return static_cast<const CScriptTrigger*>(mgr.GetObjectById(x13c_triggerId))->GetTriggerBoundsWR();
|
return static_cast<const CScriptTrigger*>(mgr.GetObjectById(x13c_triggerId))->GetTriggerBoundsWR();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CScriptEffect::AreBothSystemsDeleteable() {
|
bool CScriptEffect::AreBothSystemsDeleteable() const {
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
if (x104_particleSystem && !x104_particleSystem->IsSystemDeletable())
|
if (x104_particleSystem && !x104_particleSystem->IsSystemDeletable())
|
||||||
ret = false;
|
ret = false;
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
}
|
}
|
||||||
void CalculateRenderBounds() override;
|
void CalculateRenderBounds() override;
|
||||||
zeus::CAABox GetSortingBounds(const CStateManager&) const override;
|
zeus::CAABox GetSortingBounds(const CStateManager&) const override;
|
||||||
bool AreBothSystemsDeleteable();
|
bool AreBothSystemsDeleteable() const;
|
||||||
static void ResetParticleCounts() {
|
static void ResetParticleCounts() {
|
||||||
g_NumParticlesUpdating = 0;
|
g_NumParticlesUpdating = 0;
|
||||||
g_NumParticlesRendered = 0;
|
g_NumParticlesRendered = 0;
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
CAiTrigger() = default;
|
CAiTrigger() = default;
|
||||||
CAiTrigger* GetAnd() const { return x10_andTrig; }
|
CAiTrigger* GetAnd() const { return x10_andTrig; }
|
||||||
CAiState* GetState() const { return x14_state; }
|
CAiState* GetState() const { return x14_state; }
|
||||||
bool CallFunc(CStateManager& mgr, CAi& ai) {
|
bool CallFunc(CStateManager& mgr, CAi& ai) const {
|
||||||
if (x0_func) {
|
if (x0_func) {
|
||||||
bool ret = (ai.*x0_func)(mgr, xc_arg);
|
bool ret = (ai.*x0_func)(mgr, xc_arg);
|
||||||
return x18_lNot ? !ret : ret;
|
return x18_lNot ? !ret : ret;
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
TToken<CTexture> GetTexture() const;
|
TToken<CTexture> GetTexture() const;
|
||||||
zeus::CColor GetColor() { return x10_color; }
|
zeus::CColor GetColor() const { return x10_color; }
|
||||||
float GetScale() const;
|
float GetScale() const;
|
||||||
float GetPosition() const;
|
float GetPosition() const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
bool IsTransitionEnabled() const { return x30_type != ETransType::Disabled; }
|
bool IsTransitionEnabled() const { return x30_type != ETransType::Disabled; }
|
||||||
void DisableTransition();
|
void DisableTransition();
|
||||||
void TouchModels();
|
void TouchModels();
|
||||||
ETransType GetTransType() { return x30_type; }
|
ETransType GetTransType() const { return x30_type; }
|
||||||
void SetSfx(u16 sfx, u8 volume, u8 panning) {
|
void SetSfx(u16 sfx, u8 volume, u8 panning) {
|
||||||
x24_sfx = sfx;
|
x24_sfx = sfx;
|
||||||
x2c_volume = volume;
|
x2c_volume = volume;
|
||||||
|
|
Loading…
Reference in New Issue