mirror of https://github.com/AxioDL/metaforce.git
Various bug fixes
This commit is contained in:
parent
57c1196599
commit
35a3923cdf
|
@ -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<s32, float>& a,
|
||||
|
@ -1974,7 +1974,7 @@ float CBSLocomotion::ComputeWeightPercentage(const std::pair<s32, float>& 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);
|
||||
|
|
|
@ -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<s32, float>& a,
|
||||
const std::pair<s32, float>& b, float f) const;
|
||||
public:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -250,7 +250,7 @@ enum class EBodyStateCmd
|
|||
ExitState,
|
||||
LeanFromCover,
|
||||
NextState,
|
||||
Thirteen,
|
||||
MaintainVelocity,
|
||||
Generate,
|
||||
Hurled,
|
||||
Jump,
|
||||
|
|
|
@ -92,6 +92,7 @@ CRayCastResult CCollidableOBBTreeGroup::CastRayInternal(const CInternalRayCastSt
|
|||
}
|
||||
}
|
||||
|
||||
ret.Transform(rayCast.GetTransform());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<zeus::CAABox> GetTouchBounds() const;
|
||||
void SetDamageVulnerability(const CDamageVulnerability& vuln);
|
||||
|
|
|
@ -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<CIOWin> splash = std::make_shared<CSplashScreen>(CSplashScreen::ESplashScreen::Nintendo);
|
||||
x58_ioWinManager.AddIOWin(splash, 1000, 10000);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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<CActor> act = mgr.ObjectById(x2c6_))
|
||||
if (TCastToPtr<CActor> 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, {}};
|
||||
}
|
||||
|
|
|
@ -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<CProjectileTouchResult> x2d0_touchResults;
|
||||
|
|
|
@ -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); }
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -8,12 +8,12 @@ namespace urde
|
|||
|
||||
enum class EVulnerability
|
||||
{
|
||||
DoubleDamage,
|
||||
Weak,
|
||||
Normal,
|
||||
Deflect,
|
||||
Immune,
|
||||
PassThrough,
|
||||
DirectDouble,
|
||||
DirectWeak,
|
||||
DirectNormal,
|
||||
DirectImmune
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
2
specter
2
specter
|
@ -1 +1 @@
|
|||
Subproject commit 91cdaddfd976307c6d97982831c39c1b5110c47b
|
||||
Subproject commit b5b8de3aa8a5ca846b90b653496d33fbd2f5dbab
|
Loading…
Reference in New Issue