Restructure
This commit is contained in:
@ -51,13 +51,13 @@ namespace ia::iae
|
||||
const auto nodeA = g_colliders[i]->GetNode();
|
||||
|
||||
if(IsIntersectingH(boxB, boxA.z) && (IsIntersectingV(boxB, boxA.y) || IsIntersectingV(boxB, boxA.w)))
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec3(-boxA.z + boxB.x, 0, 0));
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec2(-boxA.z + boxB.x, 0));
|
||||
else if(IsIntersectingH(boxB, boxA.x) && (IsIntersectingV(boxB, boxA.y) || IsIntersectingV(boxB, boxA.w)))
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec3(-boxA.x + boxB.z, 0, 0));
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec2(-boxA.x + boxB.z, 0));
|
||||
else if(IsIntersectingV(boxB, boxA.w) && (IsIntersectingH(boxB, boxA.x) || IsIntersectingH(boxB, boxA.z)))
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec3(0, -boxA.w + boxB.y, 0));
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec2(0, -boxA.w + boxB.y));
|
||||
else if(IsIntersectingV(boxB, boxA.y) && (IsIntersectingH(boxB, boxA.x) || IsIntersectingH(boxB, boxA.z)))
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec3(0, -boxA.y + boxB.w, 0));
|
||||
nodeA->SetLocalPosition(nodeA->GetLocalPosition() + glm::vec2(0, -boxA.y + boxB.w));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user