10 #include <AtomsUtils/Globals.h>
11 #include <AtomsUtils/AtomsMath.h>
31 Triangle(
const AtomsMath::Vector3f& v0,
const AtomsMath::Vector3f& v1,
const AtomsMath::Vector3f& v2,
unsigned int id = 0);
43 AtomsMath::Vector3f
barycentric(
const AtomsMath::Vector3f &point);
54 bool intersect(
const AtomsMath::Vector3f &orig,
const AtomsMath::Vector3f &dir,
float &t,
float &u,
float &v);
64 AtomsMath::Vector3f
closestPoint(
const AtomsMath::Vector3f& inP,
float& outU,
float& outV,
float& sqrDistance);
72 AtomsMath::Vector3f
p0;
75 AtomsMath::Vector3f
p1;
78 AtomsMath::Vector3f
p2;
101 Triangle2(
const AtomsMath::Vector2f& v0,
const AtomsMath::Vector2f& v1,
const AtomsMath::Vector2f& v2,
unsigned int id = 0);
103 Triangle2(
const AtomsMath::Vector2f& v0,
const AtomsMath::Vector2f& v1,
const AtomsMath::Vector2f& v2,
const unsigned int p0Id,
const unsigned int p1Id,
const unsigned int p2Id);
108 bool contains(
const unsigned int index)
const;
110 bool isEqual(
const Triangle2 &other)
const;
112 void makeCounterClockWise();
114 double distanceToCenter(
const AtomsMath::Vector2f &point)
const;
116 double distanceTo(
const AtomsMath::Vector2f& point)
const;
118 AtomsMath::Vector2f closestPoint(
const AtomsMath::Vector2f& point,
float& outU,
float& outV,
float& sqrDistance)
const;
124 AtomsMath::Vector2f
p0;
127 AtomsMath::Vector2f
p1;
130 AtomsMath::Vector2f
p2;
Triangle 2D class.
Definition: Triangle.h:87
AtomsMath::Vector2f p2
Vertex 2.
Definition: Triangle.h:130
unsigned int id
Triangle id.
Definition: Triangle.h:142
AtomsMath::Vector2f p1
Vertex 1.
Definition: Triangle.h:127
unsigned int p2Id
Vertex 2 id.
Definition: Triangle.h:139
Triangle2(const AtomsMath::Vector2f &v0, const AtomsMath::Vector2f &v1, const AtomsMath::Vector2f &v2, unsigned int id=0)
Constructor.
unsigned int p1Id
Vertex 1 id.
Definition: Triangle.h:136
unsigned int p0Id
Vertex 0 id.
Definition: Triangle.h:133
AtomsMath::Vector2f p0
Vertex 0.
Definition: Triangle.h:124
Triangle class.
Definition: Triangle.h:18
AtomsMath::Box3f bbox()
Get triangle bounding box.
AtomsMath::Vector3f midPoint()
Get triangle mid point.
AtomsMath::Box3f boundingbox
Triangle bounding box.
Definition: Triangle.h:69
AtomsMath::Vector3f closestPoint(const AtomsMath::Vector3f &inP, float &outU, float &outV, float &sqrDistance)
! Closest point
AtomsMath::Vector3f p0
Vertex 0.
Definition: Triangle.h:72
AtomsMath::Vector3f barycentric(const AtomsMath::Vector3f &point)
Get the barycentric coordinates of the given point.
AtomsMath::Vector3f p1
Vertex 1.
Definition: Triangle.h:75
bool intersect(const AtomsMath::Vector3f &orig, const AtomsMath::Vector3f &dir, float &t, float &u, float &v)
Ray/triangle intersector.
unsigned int id
Triangle id.
Definition: Triangle.h:81
Triangle(const AtomsMath::Vector3f &v0, const AtomsMath::Vector3f &v1, const AtomsMath::Vector3f &v2, unsigned int id=0)
Constructor.
bool intersect(const AtomsMath::Box3f &bbox)
Triange/BBox intersector.
AtomsMath::Vector3f p2
Vertex 2.
Definition: Triangle.h:78
AtomsCore namespace.
Definition: Base64.h:13