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

Collision flags and SFX type handling

This commit is contained in:
2016-12-25 23:58:44 -08:00
parent bc89518c9d
commit 7b79e52740
13 changed files with 134 additions and 26 deletions

View File

@@ -9,4 +9,24 @@ CCollisionSurface::CCollisionSurface(const zeus::CVector3f& a, const zeus::CVect
x24_flags(flags)
{
}
zeus::CVector3f CCollisionSurface::GetNormal() const
{
zeus::CVector3f v1 = ((xc_b - x0_a) * ((x18_c - x0_a) * (xc_b - x0_a))) - (x18_c - x0_a);
return zeus::CUnitVector3f({v1.y, v1.z, v1.x}, true);
}
zeus::CVector3f CCollisionSurface::GetVert(s32 idx) const
{
if (idx < 0 || idx > 3)
return zeus::CVector3f::skZero;
return (&x0_a)[idx];
}
zeus::CPlane CCollisionSurface::GetPlane() const
{
zeus::CVector3f norm = GetNormal();
return {norm, norm.dot(x0_a)};
}
}