28#ifndef INCLUDED_OOMATHS_h
29 #error Do not include OOTriangle.h directly; include OOMaths.h.
46OOINLINE Vector resolveVectorInIJK(Vector v0, Triangle ijk);
54OOINLINE Triangle make_triangle(Vector v0, Vector v1, Vector v2)
56 return (Triangle){{ v0, v1, v2 }};
60OOINLINE Vector calculateNormalForTriangle(Triangle *tri)
62 Vector v01 = vector_subtract(tri->v[1], tri->v[0]);
63 Vector v12 = vector_subtract(tri->v[2], tri->v[1]);
64 return cross_product(v01, v12);
68OOINLINE Vector resolveVectorInIJK(Vector v0, Triangle ijk)
71 result.x = dot_product(v0, ijk.v[0]);
72 result.y = dot_product(v0, ijk.v[1]);
73 result.z = dot_product(v0, ijk.v[2]);
78OOINLINE bool OOTriangleIsDegenerate(Triangle tri)
80 return vector_equal(tri.v[0], tri.v[1]) ||
81 vector_equal(tri.v[1], tri.v[2]) ||
82 vector_equal(tri.v[2], tri.v[0]);