diff --git a/Runtime/Character/CBodyState.cpp b/Runtime/Character/CBodyState.cpp index 629f9888f..685b26544 100644 --- a/Runtime/Character/CBodyState.cpp +++ b/Runtime/Character/CBodyState.cpp @@ -1957,9 +1957,9 @@ float CBSLocomotion::GetStartVelocityMagnitude(CBodyController& bc) return 0.f; } -void CBSLocomotion::ReStartBodyState(CBodyController& bc, bool b) +void CBSLocomotion::ReStartBodyState(CBodyController& bc, bool maintainVel) { - UpdateLocomotionAnimation(0.f, b ? GetStartVelocityMagnitude(bc) : 0.f, bc, true); + UpdateLocomotionAnimation(0.f, maintainVel ? GetStartVelocityMagnitude(bc) : 0.f, bc, true); } float CBSLocomotion::ComputeWeightPercentage(const std::pair& a, @@ -1974,7 +1974,7 @@ float CBSLocomotion::ComputeWeightPercentage(const std::pair& a, void CBSLocomotion::Start(CBodyController& bc, CStateManager& mgr) { x4_locomotionType = bc.GetLocomotionType(); - if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::Thirteen)) + if (bc.GetCommandMgr().GetCmd(EBodyStateCmd::MaintainVelocity)) ReStartBodyState(bc, true); else ReStartBodyState(bc, false); diff --git a/Runtime/Character/CBodyState.hpp b/Runtime/Character/CBodyState.hpp index 75508287a..3fd7a6b4b 100644 --- a/Runtime/Character/CBodyState.hpp +++ b/Runtime/Character/CBodyState.hpp @@ -347,7 +347,7 @@ class CBSLocomotion : public CBodyState protected: pas::ELocomotionType x4_locomotionType = pas::ELocomotionType::Invalid; float GetStartVelocityMagnitude(CBodyController& bc); - void ReStartBodyState(CBodyController& bc, bool); + void ReStartBodyState(CBodyController& bc, bool maintainVel); float ComputeWeightPercentage(const std::pair& a, const std::pair& b, float f) const; public: diff --git a/Runtime/Character/CBodyStateCmdMgr.hpp b/Runtime/Character/CBodyStateCmdMgr.hpp index 039855b6e..6dd0e3d46 100644 --- a/Runtime/Character/CBodyStateCmdMgr.hpp +++ b/Runtime/Character/CBodyStateCmdMgr.hpp @@ -323,7 +323,7 @@ class CBodyStateCmdMgr CBodyStateCmd x16c_ = {EBodyStateCmd::ExitState}; CBodyStateCmd x174_ = {EBodyStateCmd::LeanFromCover}; CBodyStateCmd x17c_ = {EBodyStateCmd::NextState}; - CBodyStateCmd x184_ = {EBodyStateCmd::Thirteen}; + CBodyStateCmd x184_ = {EBodyStateCmd::MaintainVelocity}; CBCGenerateCmd x18c_generate; CBCHurledCmd x1ac_hurled; CBCJumpCmd x1d0_jump; diff --git a/Runtime/Character/CharacterCommon.hpp b/Runtime/Character/CharacterCommon.hpp index 71c1eca3c..52922ed40 100644 --- a/Runtime/Character/CharacterCommon.hpp +++ b/Runtime/Character/CharacterCommon.hpp @@ -250,7 +250,7 @@ enum class EBodyStateCmd ExitState, LeanFromCover, NextState, - Thirteen, + MaintainVelocity, Generate, Hurled, Jump, diff --git a/Runtime/Collision/CCollidableOBBTreeGroup.cpp b/Runtime/Collision/CCollidableOBBTreeGroup.cpp index 5dd2bb15d..31eaac6c6 100644 --- a/Runtime/Collision/CCollidableOBBTreeGroup.cpp +++ b/Runtime/Collision/CCollidableOBBTreeGroup.cpp @@ -92,6 +92,7 @@ CRayCastResult CCollidableOBBTreeGroup::CastRayInternal(const CInternalRayCastSt } } + ret.Transform(rayCast.GetTransform()); return ret; } diff --git a/Runtime/Collision/CCollisionActor.cpp b/Runtime/Collision/CCollisionActor.cpp index 85dfe178e..af747545c 100644 --- a/Runtime/Collision/CCollisionActor.cpp +++ b/Runtime/Collision/CCollisionActor.cpp @@ -132,6 +132,12 @@ const CCollisionPrimitive* CCollisionActor::GetCollisionPrimitive() const return x284_spherePrimitive.get(); } +EWeaponCollisionResponseTypes CCollisionActor::GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, + const CWeaponMode&, EProjectileAttrib) const +{ + return x300_responseType; +} + zeus::CTransform CCollisionActor::GetPrimitiveTransform() const { zeus::CTransform xf = x34_transform; diff --git a/Runtime/Collision/CCollisionActor.hpp b/Runtime/Collision/CCollisionActor.hpp index 54f1c4dde..180fe50ee 100644 --- a/Runtime/Collision/CCollisionActor.hpp +++ b/Runtime/Collision/CCollisionActor.hpp @@ -47,6 +47,8 @@ public: void Touch(CActor &, CStateManager &); zeus::CVector3f GetOrbitPosition(const CStateManager &) const; const CCollisionPrimitive* GetCollisionPrimitive() const; + EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, + const CWeaponMode&, EProjectileAttrib) const; zeus::CTransform GetPrimitiveTransform() const; std::experimental::optional GetTouchBounds() const; void SetDamageVulnerability(const CDamageVulnerability& vuln); diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 473de46af..b34767c8e 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -93,7 +93,7 @@ CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent, CStreamAudioManager::SetMusicVolume(0x7f); m->ResetGameState(); - if (!g_tweakGame->GetSplashScreensDisabled()) + if (false && !g_tweakGame->GetSplashScreensDisabled()) { std::shared_ptr splash = std::make_shared(CSplashScreen::ESplashScreen::Nintendo); x58_ioWinManager.AddIOWin(splash, 1000, 10000); diff --git a/Runtime/MP1/World/CParasite.cpp b/Runtime/MP1/World/CParasite.cpp index ba656875d..83278d504 100644 --- a/Runtime/MP1/World/CParasite.cpp +++ b/Runtime/MP1/World/CParasite.cpp @@ -271,7 +271,7 @@ void CParasite::Think(float dt, CStateManager& mgr) return; } - xf8_24_movable = !xf8_24_movable; + xf8_24_movable = !x5d6_24_alignToFloor; if (!x5d6_27_disableMove) { diff --git a/Runtime/Weapon/CEnergyProjectile.cpp b/Runtime/Weapon/CEnergyProjectile.cpp index 7a32941e5..a8b15806e 100644 --- a/Runtime/Weapon/CEnergyProjectile.cpp +++ b/Runtime/Weapon/CEnergyProjectile.cpp @@ -134,13 +134,13 @@ void CEnergyProjectile::ResolveCollisionWithWorld(const CRayCastResult& res, CSt if (Explode(res.GetPoint(), res.GetPlane().normal(), crType, mgr, CDamageVulnerability::NormalVulnerabilty(), kInvalidUniqueId)) mgr.ApplyDamageToWorld(xec_ownerId, *this, res.GetPoint(), x12c_curDamageInfo, xf8_filter); - x2c2_ = kInvalidUniqueId; + x2c2_lastResolvedObj = kInvalidUniqueId; } } void CEnergyProjectile::ResolveCollisionWithActor(const CRayCastResult& res, CActor& act, CStateManager& mgr) { - x2c2_ = act.GetUniqueId(); + x2c2_lastResolvedObj = act.GetUniqueId(); EWeaponCollisionResponseTypes crType = act.GetCollisionResponseType(res.GetPoint(), x34_transform.basis[1].normalized(), x12c_curDamageInfo.GetWeaponMode(), xe8_projectileAttribs); @@ -283,7 +283,7 @@ bool CEnergyProjectile::Explode(const zeus::CVector3f& pos, const zeus::CVector3 EVulnerability deflectType = dVuln.GetDeflectionType(x12c_curDamageInfo.GetWeaponMode()); switch (deflectType) { - case EVulnerability::DoubleDamage: + case EVulnerability::Weak: deflect = false; break; case EVulnerability::Deflect: diff --git a/Runtime/Weapon/CGameProjectile.cpp b/Runtime/Weapon/CGameProjectile.cpp index 18d8c4e80..4948edd6a 100644 --- a/Runtime/Weapon/CGameProjectile.cpp +++ b/Runtime/Weapon/CGameProjectile.cpp @@ -245,16 +245,16 @@ CGameProjectile::DoCollisionCheck(TUniqueId& idOut, CStateManager& mgr) void CGameProjectile::ApplyDamageToActors(CStateManager& mgr, const CDamageInfo& dInfo) { - if (x2c6_ != kInvalidUniqueId) + if (x2c6_pendingDamagee != kInvalidUniqueId) { - if (TCastToPtr act = mgr.ObjectById(x2c6_)) + if (TCastToPtr act = mgr.ObjectById(x2c6_pendingDamagee)) { mgr.ApplyDamage(GetUniqueId(), act->GetUniqueId(), xec_ownerId, dInfo, xf8_filter, x34_transform.basis[1]); if ((xe8_projectileAttribs & EProjectileAttrib::PlayerUnFreeze) == EProjectileAttrib::PlayerUnFreeze && mgr.GetPlayer().GetUniqueId() == act->GetUniqueId() && mgr.GetPlayer().GetFrozenState()) mgr.GetPlayer().UnFreeze(mgr); } - x2c6_ = kInvalidUniqueId; + x2c6_pendingDamagee = kInvalidUniqueId; } for (CProjectileTouchResult& res : x2d0_touchResults) @@ -285,7 +285,7 @@ CGameProjectile::RayCollisionCheckWithWorld(TUniqueId& idOut, const zeus::CVecto { x2d0_touchResults.clear(); idOut = kInvalidUniqueId; - x2c6_ = kInvalidUniqueId; + x2c6_pendingDamagee = kInvalidUniqueId; CRayCastResult res; zeus::CVector3f delta = end - start; if (!delta.canBeNormalized()) @@ -314,7 +314,7 @@ CGameProjectile::RayCollisionCheckWithWorld(TUniqueId& idOut, const zeus::CVecto ent->Touch(*this, mgr); bestMag = tRes.GetRayCastResult().GetT(); res = tRes.GetRayCastResult(); - x2c6_ = idOut = tRes.GetActorId(); + x2c6_pendingDamagee = idOut = tRes.GetActorId(); } } else @@ -343,12 +343,12 @@ CGameProjectile::RayCollisionCheckWithWorld(TUniqueId& idOut, const zeus::CVecto { bestMag = res3.GetT(); res = res3; - x2c6_ = idOut = tRes.GetActorId(); + x2c6_pendingDamagee = idOut = tRes.GetActorId(); } } else if (tb->pointInside(start) || (projObj && projObj->GetProjectileBounds().intersects(*tb))) { - x2c6_ = idOut = ent->GetUniqueId(); + x2c6_pendingDamagee = idOut = ent->GetUniqueId(); zeus::CUnitVector3f norm(-dir); res = CRayCastResult(0.f, start, {norm, norm.dot(start)}, ent->GetMaterialList()); break; @@ -475,7 +475,7 @@ CProjectileTouchResult CGameProjectile::CanCollideWithGameObject(CActor& act, CS { return {kInvalidUniqueId, {}}; } - else if (act.GetUniqueId() == x2c2_) + else if (act.GetUniqueId() == x2c2_lastResolvedObj) { return {kInvalidUniqueId, {}}; } diff --git a/Runtime/Weapon/CGameProjectile.hpp b/Runtime/Weapon/CGameProjectile.hpp index 56848908d..8580b5c91 100644 --- a/Runtime/Weapon/CGameProjectile.hpp +++ b/Runtime/Weapon/CGameProjectile.hpp @@ -38,9 +38,9 @@ protected: double x2b0_targetHomingTime = 0.0; double x2b8_curHomingTime = x2a8_homingDt; TUniqueId x2c0_homingTargetId; - TUniqueId x2c2_ = kInvalidUniqueId; + TUniqueId x2c2_lastResolvedObj = kInvalidUniqueId; TUniqueId x2c4_ = kInvalidUniqueId; - TUniqueId x2c6_ = kInvalidUniqueId; + TUniqueId x2c6_pendingDamagee = kInvalidUniqueId; TUniqueId x2c8_projectileLight = kInvalidUniqueId; CAssetId x2cc_wpscId; std::vector x2d0_touchResults; diff --git a/Runtime/Weapon/CWeaponMode.cpp b/Runtime/Weapon/CWeaponMode.cpp index f730f6243..ef34be257 100644 --- a/Runtime/Weapon/CWeaponMode.cpp +++ b/Runtime/Weapon/CWeaponMode.cpp @@ -8,8 +8,6 @@ CWeaponMode::CWeaponMode(EWeaponType type, bool charged, bool comboed, bool inst { } -EWeaponType CWeaponMode::GetType() const { return x0_weaponType; } - CWeaponMode CWeaponMode::Invalid() { return CWeaponMode(EWeaponType::None); } CWeaponMode CWeaponMode::Phazon() { return CWeaponMode(EWeaponType::Phazon); } diff --git a/Runtime/Weapon/CWeaponMode.hpp b/Runtime/Weapon/CWeaponMode.hpp index fdfe4e17f..6358326e9 100644 --- a/Runtime/Weapon/CWeaponMode.hpp +++ b/Runtime/Weapon/CWeaponMode.hpp @@ -14,7 +14,7 @@ class CWeaponMode public: CWeaponMode() { x4_24_charged = false; x4_25_comboed = false; x4_26_instantKill = false; } CWeaponMode(EWeaponType, bool charged = false, bool comboed = false, bool instaKill = false); - EWeaponType GetType() const; + EWeaponType GetType() const { return x0_weaponType; } bool IsCharged() const { return x4_24_charged; } bool IsComboed() const { return x4_25_comboed; } diff --git a/Runtime/World/CDamageInfo.cpp b/Runtime/World/CDamageInfo.cpp index 4d0bf39e3..efbe5070b 100644 --- a/Runtime/World/CDamageInfo.cpp +++ b/Runtime/World/CDamageInfo.cpp @@ -31,7 +31,7 @@ float CDamageInfo::GetDamage(const CDamageVulnerability& dVuln) const EVulnerability vuln = dVuln.GetVulnerability(x0_weaponMode, false); if (vuln == EVulnerability::Deflect) return 0.f; - else if (vuln == EVulnerability::DoubleDamage) + else if (vuln == EVulnerability::Weak) return 2.f * x8_damage; return x8_damage; @@ -42,7 +42,7 @@ float CDamageInfo::GetRadiusDamage(const CDamageVulnerability& dVuln) const EVulnerability vuln = dVuln.GetVulnerability(x0_weaponMode, false); if (vuln == EVulnerability::Deflect) return 0.f; - else if (vuln == EVulnerability::DoubleDamage) + else if (vuln == EVulnerability::Weak) return 2.f * xc_radiusDamage; return xc_radiusDamage; diff --git a/Runtime/World/CDamageVulnerability.cpp b/Runtime/World/CDamageVulnerability.cpp index 4c62af240..3801ceb9b 100644 --- a/Runtime/World/CDamageVulnerability.cpp +++ b/Runtime/World/CDamageVulnerability.cpp @@ -9,7 +9,7 @@ const CDamageVulnerability CDamageVulnerability::sNormalVulnerability( EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, - EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::DoubleDamage); + EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Normal, EVulnerability::Weak); const CDamageVulnerability CDamageVulnerability::sImmuneVulnerability( EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, @@ -17,7 +17,7 @@ const CDamageVulnerability CDamageVulnerability::sImmuneVulnerability( EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, - EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::DoubleDamage); + EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Weak); /* LOL, thanks retro */ const CDamageVulnerability CDamageVulnerability::sReflectVulnerability( EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, @@ -25,7 +25,7 @@ const CDamageVulnerability CDamageVulnerability::sReflectVulnerability( EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, - EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::DoubleDamage); + EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Deflect, EVulnerability::Weak); const CDamageVulnerability CDamageVulnerability::sPassThroughVulnerability( EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, @@ -33,13 +33,18 @@ const CDamageVulnerability CDamageVulnerability::sPassThroughVulnerability( EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, - EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::DoubleDamage); + EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::PassThrough, EVulnerability::Weak); static inline bool is_not_immune(EVulnerability vuln) { return vuln != EVulnerability::Immune && vuln != EVulnerability::DirectImmune; } +static inline bool is_normal_or_weak(EVulnerability vuln) +{ + return vuln == EVulnerability::Normal || vuln == EVulnerability::Weak; +} + void CDamageVulnerability::ConstructNew(CInputStream& in, int propCount) { propCount -= 3; @@ -81,7 +86,7 @@ CDamageVulnerability::CDamageVulnerability(CInputStream& in) vulns[i] = EVulnerability(in.readUint32Big()); if (propCount == 15) - x5c_deflected = EVulnerability::DoubleDamage; + x5c_deflected = EVulnerability::Weak; else x5c_deflected = EVulnerability(in.readUint32Big()); @@ -154,11 +159,13 @@ bool CDamageVulnerability::WeaponHurts(const CWeaponMode& mode, bool ignoreDirec EVulnerability normalVuln = (&x0_power)[u32(mode.GetType())]; bool normalHurts = true; if (ignoreDirect) - normalHurts = is_not_immune(normalVuln); + { + normalHurts = is_normal_or_weak(normalVuln); + } else { - if (!is_not_immune(normalVuln) && - (normalVuln != EVulnerability::DirectDouble && normalVuln != EVulnerability::DirectNormal)) + if (!is_normal_or_weak(normalVuln) && + (normalVuln != EVulnerability::DirectWeak && normalVuln != EVulnerability::DirectNormal)) normalHurts = false; } @@ -170,16 +177,16 @@ bool CDamageVulnerability::WeaponHurts(const CWeaponMode& mode, bool ignoreDirec EVulnerability comboedVuln = (&x4c_superMissile)[u32(mode.GetType())]; if (ignoreDirect) { - chargedHurts = is_not_immune(chargedVuln); - comboedHurts = is_not_immune(comboedVuln); + chargedHurts = is_normal_or_weak(chargedVuln); + comboedHurts = is_normal_or_weak(comboedVuln); } else { - if (!is_not_immune(chargedVuln) && - (chargedVuln != EVulnerability::DirectDouble && chargedVuln != EVulnerability::DirectNormal)) + if (!is_normal_or_weak(chargedVuln) && + (chargedVuln != EVulnerability::DirectWeak && chargedVuln != EVulnerability::DirectNormal)) chargedHurts = false; - if (!is_not_immune(comboedVuln) && - (comboedVuln != EVulnerability::DirectDouble && comboedVuln != EVulnerability::DirectNormal)) + if (!is_normal_or_weak(comboedVuln) && + (comboedVuln != EVulnerability::DirectWeak && comboedVuln != EVulnerability::DirectNormal)) comboedHurts = false; } } @@ -258,8 +265,8 @@ EVulnerability CDamageVulnerability::GetVulnerability(const CWeaponMode& mode, b if (ignoreDirect) return vuln; - if (vuln == EVulnerability::DirectDouble) - return EVulnerability::DoubleDamage; + if (vuln == EVulnerability::DirectWeak) + return EVulnerability::Weak; else if (vuln == EVulnerability::DirectNormal) return EVulnerability::Normal; else if (vuln == EVulnerability::DirectImmune) diff --git a/Runtime/World/CDamageVulnerability.hpp b/Runtime/World/CDamageVulnerability.hpp index 4b60701c5..4fd87cb97 100644 --- a/Runtime/World/CDamageVulnerability.hpp +++ b/Runtime/World/CDamageVulnerability.hpp @@ -8,12 +8,12 @@ namespace urde enum class EVulnerability { - DoubleDamage, + Weak, Normal, Deflect, Immune, PassThrough, - DirectDouble, + DirectWeak, DirectNormal, DirectImmune }; diff --git a/Runtime/World/CPatterned.cpp b/Runtime/World/CPatterned.cpp index 59c4dc541..121d2dcfd 100644 --- a/Runtime/World/CPatterned.cpp +++ b/Runtime/World/CPatterned.cpp @@ -1099,7 +1099,7 @@ void CPatterned::Burn(float duration, float damage) { switch (GetDamageVulnerability()->GetVulnerability(CWeaponMode(EWeaponType::Plasma), false)) { - case EVulnerability::DoubleDamage: + case EVulnerability::Weak: x450_bodyController->SetOnFire(1.5f * duration); x3ec_pendingFireDamage = 1.5f * damage; break; @@ -1116,7 +1116,7 @@ void CPatterned::Shock(float duration, float damage) { switch (GetDamageVulnerability()->GetVulnerability(CWeaponMode(EWeaponType::Wave), false)) { - case EVulnerability::DoubleDamage: + case EVulnerability::Weak: x450_bodyController->SetElectrocuting(1.5f * duration); x3f0_pendingShockDamage = 1.5f * damage; break; diff --git a/Runtime/World/CPlayerCameraBob.cpp b/Runtime/World/CPlayerCameraBob.cpp index 82056c7fd..e79b39d18 100644 --- a/Runtime/World/CPlayerCameraBob.cpp +++ b/Runtime/World/CPlayerCameraBob.cpp @@ -29,6 +29,7 @@ const float CPlayerCameraBob::kCameraDamping = 6.f * std::sqrt(80.f); CPlayerCameraBob::CPlayerCameraBob(ECameraBobType type, const zeus::CVector2f& vec, float bobPeriod) : x0_type(type), x4_vec(vec), xc_bobPeriod(bobPeriod) { + std::fill(std::begin(x7c_wanderPoints), std::end(x7c_wanderPoints), zeus::CVector3f::skForward); } zeus::CTransform CPlayerCameraBob::GetViewWanderTransform() const { return xd0_viewWanderXf; } @@ -107,19 +108,19 @@ void CPlayerCameraBob::UpdateViewWander(float dt, CStateManager& mgr) { zeus::CVector3f pt = zeus::getCatmullRomSplinePoint( x7c_wanderPoints[xcc_wanderIndex], x7c_wanderPoints[(xcc_wanderIndex + 1) & 3], - x7c_wanderPoints[(xcc_wanderIndex + 2) & 3], x7c_wanderPoints[(xcc_wanderIndex + 3) & 3], dt); + x7c_wanderPoints[(xcc_wanderIndex + 2) & 3], x7c_wanderPoints[(xcc_wanderIndex + 3) & 3], xc4_wanderTime); pt.x *= x100_wanderMagnitude; pt.z *= x100_wanderMagnitude; zeus::CTransform orient = zeus::CTransform::RotateY(( zeus::getCatmullRomSplinePoint(xb0_wanderPitches[xcc_wanderIndex], xb0_wanderPitches[(xcc_wanderIndex + 1) & 3], xb0_wanderPitches[(xcc_wanderIndex + 2) & 3], - xb0_wanderPitches[(xcc_wanderIndex + 3) & 3], dt) * + xb0_wanderPitches[(xcc_wanderIndex + 3) & 3], xc4_wanderTime) * x100_wanderMagnitude)); xd0_viewWanderXf = zeus::lookAt(zeus::CVector3f::skZero, pt, zeus::CVector3f::skUp) * orient; - xc4_wanderTime = (xc8_viewWanderSpeed * xc4_wanderTime) + dt; - if (xc4_wanderTime > 1.f) + xc4_wanderTime += xc8_viewWanderSpeed * dt; + if (xc4_wanderTime >= 1.f) { x7c_wanderPoints[xcc_wanderIndex] = CalculateRandomViewWanderPosition(mgr); xb0_wanderPitches[xcc_wanderIndex] = CalculateRandomViewWanderPitch(mgr); diff --git a/Runtime/World/CPlayerCameraBob.hpp b/Runtime/World/CPlayerCameraBob.hpp index 7133c8b40..c288fa1fa 100644 --- a/Runtime/World/CPlayerCameraBob.hpp +++ b/Runtime/World/CPlayerCameraBob.hpp @@ -69,8 +69,8 @@ private: float x70_landingTranslation = 0.f; float x74_camVelocity = 0.f; float x78_camTranslation = 0.f; - zeus::CVector3f x7c_wanderPoints[4] = {zeus::CVector3f{0.f, 1.f, 0.f}}; - float xb0_wanderPitches[4] = {0.f}; + zeus::CVector3f x7c_wanderPoints[4]; + float xb0_wanderPitches[4] = {}; float xc4_wanderTime = 0.f; float xc8_viewWanderSpeed = kViewWanderSpeedMin; u32 xcc_wanderIndex = 0; diff --git a/specter b/specter index 91cdaddfd..b5b8de3aa 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit 91cdaddfd976307c6d97982831c39c1b5110c47b +Subproject commit b5b8de3aa8a5ca846b90b653496d33fbd2f5dbab