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

Work on CStateManager

This commit is contained in:
Jack Andersen
2017-03-28 16:51:12 -10:00
parent f016a251db
commit a0549cd82b
21 changed files with 433 additions and 32 deletions

View File

@@ -10,7 +10,10 @@ namespace Collide
bool Sphere_AABox(const CInternalCollisionStructure&, CCollisionInfoList&) { return false; }
bool Sphere_AABox_Bool(const CInternalCollisionStructure&) { return false; }
bool Sphere_AABox_Bool(const CInternalCollisionStructure&)
{
return false;
}
bool Sphere_Sphere(const CInternalCollisionStructure&, CCollisionInfoList&) { return false; }
@@ -54,4 +57,25 @@ bool CCollidableSphere::CollideMovingSphere(const CInternalCollisionStructure&,
{
return false;
}
bool CCollidableSphere::Sphere_AABox_Bool(const zeus::CSphere& sphere, const zeus::CAABox& aabb)
{
float mag = 0.f;
for (int i=0 ; i<3 ; ++i)
{
if (sphere.position[i] < aabb.min[i])
{
float tmp = sphere.position[i] - aabb.min[i];
mag += tmp * tmp;
}
else if (sphere.position[i] > aabb.max[i])
{
float tmp = sphere.position[i] - aabb.max[i];
mag += tmp * tmp;
}
}
return mag <= sphere.radius * sphere.radius;
}
}