#include <Triangle.h>
Public Member Functions | |
| Triangle () | |
| virtual | ~Triangle () |
| Vector & | getNormal () |
| void | setPointComponents (const float ptA1, const float ptA2, const float ptA3, Vector &normalA, const float ptB1, const float ptB2, const float ptB3, Vector &normalB, const float ptC1, const float ptC2, const float ptC3, Vector &normalC) |
| bool | pointInBoundingBox (const Vector &pt) |
| bool | pointInTriangle (const Vector &pt) |
| virtual bool | rayIntersect (const Line &ray, Vector &intersectPt, Vector &intersectN, float &intersectDist, const bool checkPtOnLine=true) |
| virtual bool | sphereIntersect (Vector &sphereCentre, float &sphereRadius, Vector &intersectPt, Vector &intersectN, float &intersectDist) |
Protected Types | |
| enum | largestNormalPart { scalarX, scalarY, scalarZ } |
Protected Member Functions | |
| void | calcNormal () |
| void | calcLargest () |
Protected Attributes | |
| enum Triangle::largestNormalPart | largest_ |
| Vector | ptA_ |
| Vector | ptB_ |
| Vector | ptC_ |
| Vector | faceN_ |
Definition at line 31 of file Triangle.h.
enum Triangle::largestNormalPart [protected] |
| Triangle::Triangle | ( | ) |
Definition at line 34 of file Triangle.cpp.
| Triangle::~Triangle | ( | ) | [virtual] |
Definition at line 39 of file Triangle.cpp.
| Vector& Triangle::getNormal | ( | ) | [inline] |
| void Triangle::setPointComponents | ( | const float | ptA1, | |
| const float | ptA2, | |||
| const float | ptA3, | |||
| Vector & | normalA, | |||
| const float | ptB1, | |||
| const float | ptB2, | |||
| const float | ptB3, | |||
| Vector & | normalB, | |||
| const float | ptC1, | |||
| const float | ptC2, | |||
| const float | ptC3, | |||
| Vector & | normalC | |||
| ) |
Definition at line 44 of file Triangle.cpp.
References calcLargest(), faceN_, Vector::initialise(), ptA_, ptB_, and ptC_.
| bool Triangle::pointInBoundingBox | ( | const Vector & | pt | ) |
Definition at line 78 of file Triangle.cpp.
References MAX, MIN, ptA_, ptB_, and ptC_.
Referenced by rayIntersect().
| bool Triangle::pointInTriangle | ( | const Vector & | pt | ) |
Definition at line 95 of file Triangle.cpp.
References largest_, ptA_, ptB_, ptC_, scalarX, scalarY, and scalarZ.
Referenced by rayIntersect().
| bool Triangle::rayIntersect | ( | const Line & | ray, | |
| Vector & | intersectPt, | |||
| Vector & | intersectN, | |||
| float & | intersectDist, | |||
| const bool | checkPtOnLine = true | |||
| ) | [virtual] |
Definition at line 156 of file Triangle.cpp.
References Vector::dotP(), faceN_, Line::getDirection(), Line::getStart(), pointInBoundingBox(), pointInTriangle(), and ptA_.
Referenced by sphereIntersect().
| void Triangle::calcNormal | ( | ) | [protected] |
| void Triangle::calcLargest | ( | ) | [protected] |
Definition at line 62 of file Triangle.cpp.
References faceN_, largest_, scalarX, scalarY, and scalarZ.
Referenced by setPointComponents().
enum Triangle::largestNormalPart Triangle::largest_ [protected] |
Referenced by calcLargest(), and pointInTriangle().
Vector Triangle::ptA_ [protected] |
Definition at line 71 of file Triangle.h.
Referenced by pointInBoundingBox(), pointInTriangle(), rayIntersect(), and setPointComponents().
Vector Triangle::ptB_ [protected] |
Definition at line 71 of file Triangle.h.
Referenced by pointInBoundingBox(), pointInTriangle(), and setPointComponents().
Vector Triangle::ptC_ [protected] |
Definition at line 71 of file Triangle.h.
Referenced by pointInBoundingBox(), pointInTriangle(), and setPointComponents().
Vector Triangle::faceN_ [protected] |
Definition at line 72 of file Triangle.h.
Referenced by calcLargest(), getNormal(), rayIntersect(), setPointComponents(), and sphereIntersect().
1.5.3