Triangle Class Reference

#include <Triangle.h>

List of all members.

Public Member Functions

 Triangle ()
virtual ~Triangle ()
VectorgetNormal ()
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_


Detailed Description

Definition at line 31 of file Triangle.h.


Member Enumeration Documentation

enum Triangle::largestNormalPart [protected]

Enumerator:
scalarX 
scalarY 
scalarZ 

Definition at line 64 of file Triangle.h.


Constructor & Destructor Documentation

Triangle::Triangle (  ) 

Definition at line 34 of file Triangle.cpp.

Triangle::~Triangle (  )  [virtual]

Definition at line 39 of file Triangle.cpp.


Member Function Documentation

Vector& Triangle::getNormal (  )  [inline]

Definition at line 37 of file Triangle.h.

References faceN_.

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().

bool Triangle::sphereIntersect ( Vector sphereCentre,
float &  sphereRadius,
Vector intersectPt,
Vector intersectN,
float &  intersectDist 
) [virtual]

Definition at line 195 of file Triangle.cpp.

References faceN_, and rayIntersect().

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:08 2009 for Scorched3D by  doxygen 1.5.3