2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 17:11:22 +00:00
metaforce/Runtime/Collision/CCollisionSurface.cpp
Lioncash a633b8e8fd General: Normalize RuntimeCommon include paths
Performs the same normalizing done to the RuntimeCommonB target, now all
of the runtime headers have normalized include paths.
2019-09-28 04:14:29 -04:00

21 lines
617 B
C++

#include "Runtime/Collision/CCollisionSurface.hpp"
#include <zeus/CUnitVector.hpp>
namespace urde {
CCollisionSurface::CCollisionSurface(const zeus::CVector3f& a, const zeus::CVector3f& b, const zeus::CVector3f& c,
u32 flags)
: x0_a(a), xc_b(b), x18_c(c), x24_flags(flags) {}
zeus::CVector3f CCollisionSurface::GetNormal() const {
zeus::CVector3f v1 = (xc_b - x0_a).cross(x18_c - x0_a);
return zeus::CUnitVector3f(v1, true);
}
zeus::CPlane CCollisionSurface::GetPlane() const {
zeus::CVector3f norm = GetNormal();
return {norm, norm.dot(x0_a)};
}
} // namespace urde