#include <Triangle.h>
Inheritance diagram for Physsim::Triangle:

Public Member Functions | |
| Triangle (Vector3ConstPtr a, Vector3ConstPtr b, Vector3ConstPtr c) | |
| Constructs the triangle. | |
| Triangle (const Vector3 &a, const Vector3 &b, const Vector3 &c) | |
| Constructs the triangle, making copies of the vertices. | |
| ~Triangle () | |
| Destroys the triangle. | |
| Triangle (const Triangle &t) | |
| void | operator= (const Triangle &t) |
| Overloads the assignment operator. | |
| Vector3ConstPtr | get_vertex (unsigned i) const |
| Gets the specified vertex of the triangle. | |
| const Vector3 & | normal () const |
| bool | on_vertex (const Vector3 &x) const |
| Determines whether a point is on a vertex of the triangle. | |
| bool | on_edge (const Vector3 &x) const |
| Determines whether a point is on an edge of the triangle. | |
| bool | inside (const Vector3 &x) const |
| Determines whether a point is inside this triangle. | |
| bool | strictly_inside (const Vector3 &x) const |
| Determines whether a point is strictly inside this triangle. | |
| void | to_VRML (std::ostream &o, bool wireframe) const |
| Sends the triangle to the specified stream using VRML. | |
| void | set_a (Vector3ConstPtr a) |
| Sets the vertex 'a'. | |
| void | set_b (Vector3ConstPtr b) |
| Sets the vertex 'b'. | |
| void | set_c (Vector3ConstPtr c) |
| Sets the vertex 'c'. | |
| void | set_a (const Vector3 &a) |
| void | set_b (const Vector3 &b) |
| void | set_c (const Vector3 &c) |
| Real | get_area () const |
| void | force_normal_update () |
| Calculates the outward facing normal for this triangle (triangle is assumed to be oriented counter-clockwise). | |
| Real | calc_distance (const Vector3 &point, Vector3 &closest_point) const |
| Determines the distance between this triangle and a given point. | |
| Real | get_d () const |
| Gets the value 'd' in the equation n[X]*x + n[Y]*y + n[Z]*z - d, where n is the normal of the triangle, and [x y z] is a point on the triangle. | |
| Vector3ConstPtr | a () const |
| The first vertex of the triangle. | |
| Vector3ConstPtr | b () const |
| The second vertex of the triangle. | |
| Vector3ConstPtr | c () const |
| The third vertex of the triangle. | |
Static Public Member Functions | |
| static bool | intersects (const Triangle &t1, const Triangle &t2) |
| Triangle intersection test, adapted from PQP. | |
| static Triangle | transform (const Triangle &t, const Matrix4 &m) |
| Transforms the given triangle using the specified transformation matrix. | |
Triangle intersection test, adapted from PQP.
| Vector3ConstPtr Triangle::get_vertex | ( | unsigned | i | ) | const |
Gets the specified vertex of the triangle.
| i | a zero-index in the range [0,2] |
| void Triangle::force_normal_update | ( | ) |
Calculates the outward facing normal for this triangle (triangle is assumed to be oriented counter-clockwise).
The user will only need to call this method directly if the triangle's vertices are modified outside of the Triangle class.
Determines the distance between this triangle and a given point.
| point | the query point | |
| closest_point | the closest point on the triangle is returned here |
1.5.1