2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:07:42 +00:00

SIMD refactor

This commit is contained in:
Jack Andersen
2018-12-07 15:49:15 -10:00
parent e1fa938127
commit 7c7da6671a
201 changed files with 2475 additions and 1906 deletions

View File

@@ -167,12 +167,12 @@ void CGameProjectile::Chase(float dt, CStateManager& mgr)
if (!swarm && !TCastToConstPtr<CPhysicsActor>(act.GetPtr()))
if (auto tb = act->GetTouchBounds())
projToPos.z += (tb->max.z - tb->min.z) * 0.5f;
projToPos.z() += (tb->max.z() - tb->min.z()) * 0.5f;
zeus::CQuaternion qDelta =
zeus::CQuaternion::shortestRotationArc(x170_projectile.GetTransform().basis[1], projToPos);
float wThres = qDelta.w * qDelta.w * 2.f - 1.f;
float wThres = qDelta.w() * qDelta.w() * 2.f - 1.f;
if (wThres > 0.99f)
return;
@@ -527,12 +527,12 @@ CProjectileTouchResult CGameProjectile::CanCollideWithTrigger(CActor& act, CStat
zeus::CAABox CGameProjectile::GetProjectileBounds() const
{
return {{std::min(x298_lastOrigin.x, GetTranslation().x) - x2a4_projExtent,
std::min(x298_lastOrigin.y, GetTranslation().y) - x2a4_projExtent,
std::min(x298_lastOrigin.z, GetTranslation().z) - x2a4_projExtent},
{std::max(x298_lastOrigin.x, GetTranslation().x) + x2a4_projExtent,
std::max(x298_lastOrigin.y, GetTranslation().y) + x2a4_projExtent,
std::max(x298_lastOrigin.z, GetTranslation().z) + x2a4_projExtent}};
return {{std::min(x298_lastOrigin.x(), GetTranslation().x()) - x2a4_projExtent,
std::min(x298_lastOrigin.y(), GetTranslation().y()) - x2a4_projExtent,
std::min(x298_lastOrigin.z(), GetTranslation().z()) - x2a4_projExtent},
{std::max(x298_lastOrigin.x(), GetTranslation().x()) + x2a4_projExtent,
std::max(x298_lastOrigin.y(), GetTranslation().y()) + x2a4_projExtent,
std::max(x298_lastOrigin.z(), GetTranslation().z()) + x2a4_projExtent}};
}
std::experimental::optional<zeus::CAABox> CGameProjectile::GetTouchBounds() const