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

Several collision fixes

This commit is contained in:
Jack Andersen
2017-12-17 16:54:50 -10:00
parent 2a8edf9da8
commit 73ae278c87
29 changed files with 114 additions and 110 deletions

View File

@@ -224,12 +224,12 @@ bool CCollidableOBBTree::SphereCollideWithLeafMoving(const COBBTree::CLeafData&
{
CMetroidAreaCollider::g_DupEdgeList[edgeIdx] = CMetroidAreaCollider::g_DupPrimitiveCheckCount;
CMaterialList edgeMat(x10_tree->GetEdgeMaterial(edgeIdx));
if (!edgeMat.HasMaterial(EMaterialTypes::TwentyFour))
if (!edgeMat.HasMaterial(EMaterialTypes::NoEdgeCollision))
{
int nextIdx = (k + 1) % 3;
zeus::CVector3f edgeVec = surf.GetVert(nextIdx) - surf.GetVert(k);
float edgeVecMag = edgeVec.magnitude();
edgeVec *= (1.f / edgeVecMag);
edgeVec *= zeus::CVector3f(1.f / edgeVecMag);
float dirDotEdge = dir.dot(edgeVec);
zeus::CVector3f edgeRej = dir - dirDotEdge * edgeVec;
float edgeRejMagSq = edgeRej.magSquared();
@@ -429,7 +429,7 @@ bool CCollidableOBBTree::AABoxCollideWithLeafMoving(const COBBTree::CLeafData& l
{
CMetroidAreaCollider::g_DupEdgeList[edgeIdx] = CMetroidAreaCollider::g_DupPrimitiveCheckCount;
CMaterialList edgeMat(x10_tree->GetEdgeMaterial(edgeIdx));
if (!edgeMat.HasMaterial(EMaterialTypes::TwentyFour))
if (!edgeMat.HasMaterial(EMaterialTypes::NoEdgeCollision))
{
d = dOut;
const CCollisionEdge& edge = x10_tree->GetEdge(edgeIdx);