39 #ifndef IECORE_TRIANGLEALGO_H
40 #define IECORE_TRIANGLEALGO_H
42 #include "IECore/VectorTraits.h"
44 #include "OpenEXR/ImathVec.h"
51 typename VectorTraits<Vec>::BaseType
triangleArea(
const Vec &v0,
const Vec &v1,
const Vec &v2 );
60 Vec trianglePoint(
const Vec &v0,
const Vec &v1,
const Vec &v2,
const Imath::Vec3<
typename VectorTraits<Vec>::BaseType> &barycentric );
64 typename VectorTraits<Vec>::BaseType
triangleClosestBarycentric(
const Vec &v0,
const Vec &v1,
const Vec &v2,
const Vec &p, Imath::Vec3<
typename VectorTraits<Vec>::BaseType> &barycentric );
68 Vec
triangleClosestPoint(
const Vec &v0,
const Vec &v1,
const Vec &v2,
const Vec &p, Imath::Vec3<
typename VectorTraits<Vec>::BaseType> &barycentric );
86 bool triangleContainsPoint(
const Vec &v0,
const Vec &v1,
const Vec &v2,
const Vec &p );
89 bool triangleContainsPoint(
const Vec &v0,
const Vec &v1,
const Vec &v2,
const Vec &p, Imath::Vec3<
typename VectorTraits<Vec>::BaseType> &barycentric );
94 bool triangleRayIntersection(
const Vec &v0,
const Vec &v1,
const Vec &v2,
const Vec &origin,
const Vec &dir, Vec &pt, Vec &barycentric,
bool &front );
98 #include "IECore/TriangleAlgo.inl"
100 #endif // IECORE_TRIANGLEALGO_H
VectorTraits< Vec >::BaseType triangleClosestBarycentric(const Vec &v0, const Vec &v1, const Vec &v2, const Vec &p, Imath::Vec3< typename VectorTraits< Vec >::BaseType > &barycentric)
Returns the squared-distance to the closest point on the triangle, and places that point's barycentri...
int triangleBarycentricFeature(const Vec &barycentric, typename VectorTraits< Vec >::BaseType tolerance=1.e-6)
int triangleClosestFeature(const Vec &v0, const Vec &v1, const Vec &v2, const Vec &p)
Returns the closest feature on the triangle to the given point. The return values are as barycentricF...
Vec triangleNormal(const Vec &v0, const Vec &v1, const Vec &v2)
bool triangleRayIntersection(const Vec &v0, const Vec &v1, const Vec &v2, const Vec &origin, const Vec &dir, Vec &pt, Vec &barycentric, bool &front)
Vec triangleClosestPoint(const Vec &v0, const Vec &v1, const Vec &v2, const Vec &p, Imath::Vec3< typename VectorTraits< Vec >::BaseType > &barycentric)
Returns the closest point on the triangle, and places that point's barycentric coordinates in the 4th...
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43
VectorTraits< Vec >::BaseType triangleArea(const Vec &v0, const Vec &v1, const Vec &v2)