Triangle3.hh
Go to the documentation of this file.
Vector3d Normal() const
Get the triangle's normal vector.
Definition: Triangle3.hh:159
Triangle3< double > Triangle3d
Double specialization of the Triangle class.
Definition: Triangle3.hh:279
static Vector3 Normal(const Vector3< T > &_v1, const Vector3< T > &_v2, const Vector3< T > &_v3)
Get a normal vector to a triangle.
Definition: Vector3.hh:258
bool Intersects(const Line3< T > &_line, Vector3< T > &_ipt1) const
Get whether the given line intersects an edge of this triangle.
Definition: Triangle3.hh:183
double Area() const
Get the area of this triangle.
Definition: Triangle3.hh:250
Line3< T > Side(const unsigned int _index) const
Get a line segment for one side of the triangle.
Definition: Triangle3.hh:107
bool equal(const T &_a, const T &_b, const T &_epsilon=T(1e-6))
check if two values are equal, within a tolerance
Definition: Helpers.hh:556
Triangle3< float > Triangle3f
Float specialization of the Triangle class.
Definition: Triangle3.hh:282
Triangle3< int > Triangle3i
Integer specialization of the Triangle class.
Definition: Triangle3.hh:276
bool Contains(const Line3< T > &_line) const
Check if this triangle completely contains the given line segment.
Definition: Triangle3.hh:122
T Dot(const Vector3< T > &_v) const
Return the dot product of this vector and another vector.
Definition: Vector3.hh:205
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:227
Vector3< T > operator[](const size_t _index) const
Get one of points that define the triangle.
Definition: Triangle3.hh:266
Triangle3(const Vector3< T > &_pt1, const Vector3< T > &_pt2, const Vector3< T > &_pt3)
Constructor.
Definition: Triangle3.hh:49
void Set(const Vector3< T > &_pt1, const Vector3< T > &_pt2, const Vector3< T > &_pt3)
Set all vertices of the triangle.
Definition: Triangle3.hh:79
The Vector3 class represents the generic vector containing 3 elements. Since it's commonly used to ke...
Definition: Vector3.hh:41
A 3-dimensional triangle and related functions.
Definition: Triangle3.hh:36
T Perimeter() const
Get the length of the triangle's perimeter.
Definition: Triangle3.hh:242
static const size_t IGN_TWO_SIZE_T
size_t type with a value of 2
Definition: Helpers.hh:233
A three dimensional line segment. The line is defined by a start and end point.
Definition: Line3.hh:35
Definition: Angle.hh:42
bool Valid() const
Get whether this triangle is valid, based on triangle inequality: the sum of the lengths of any two s...
Definition: Triangle3.hh:92
bool Contains(const Vector3< T > &_pt) const
Get whether this triangle contains the given point.
Definition: Triangle3.hh:130
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:406
bool Intersect(const Line3< T > &_line, double _epsilon=1e-6) const
Check if this line intersects the given line segment.
Definition: Line3.hh:267
void Set(const unsigned int _index, const Vector3< T > &_pt)
Set one vertex of the triangle.
Definition: Triangle3.hh:65