2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 06:27:43 +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

@@ -36,7 +36,7 @@ void CIkChain::Solve(zeus::CQuaternion& q1, zeus::CQuaternion& q2, const zeus::C
zeus::CVector3f vecA = q2.transform(x10_);
zeus::CVector3f crossVecA = x4_.cross(vecA);
float crossAMag = crossVecA.magnitude();
crossVecA *= (1.f / crossVecA.magnitude());
crossVecA *= zeus::CVector3f(1.f / crossVecA.magnitude());
float angle = std::asin(zeus::min(crossAMag, 1.f));
if (x4_.dot(vecA) < 0.f)
angle = M_PIF - angle;