Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Triangle Class Reference

Class representing a single triangle. More...

#include <triangle.h>

Inherits Intersectable.

Inheritance diagram for Triangle:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Triangle ()
 Constructor.
 Triangle (Mesh *owner, const Mesh::vertex &vtx1, const Mesh::vertex &vtx2, const Mesh::vertex &vtx3)
 Constructor initializing the triangle with the given vertices.
Vector getFaceNormal () const
 Compute the triangle's face normal from the position of its vertices.
float getArea () const
 Return the area of the triangle.
bool intersect (const Ray &ray) const
 Returns true if the ray intersects the triangle.
bool intersect (const Ray &ray, Intersection &isect) const
 Returns true if the ray intersects the triangle.
const PointgetVtxPosition (int i) const
 Returns the position of vertex i=[0,1,2].
const VectorgetVtxNormal (int i) const
 Returns the normal of vertex i=[0,1,2].
const UVgetVtxTexture (int i) const
 Returns the texture coordinate of vertex i=[0,1,2].

Protected Attributes

MeshmMesh
 Ptr to the mesh this triangle belongs to.
Mesh::vertex mVtx [3]
 The three vertices of the triangle.

Detailed Description

Class representing a single triangle.


The documentation for this class was generated from the following files:
Generated on Tue Mar 14 09:46:43 2006 for ASR by  doxygen 1.4.4