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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user