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

OpenCAL::Triangle Class Reference

#include <Triangle.h>

Collaboration diagram for OpenCAL::Triangle:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Triangle (Vertex *a, Vertex *b, Vertex *c)
VertexgetVertex (unsigned int i)
const VertexgetVertex (unsigned int i) const
const Vector3 & getNormal ()
bool isNormalValid () const
const Material * getMaterial () const
Material * getMaterial ()
bool hasMaterial () const
void setMaterial (Material *material)
void invalidateNormal ()
void calculateNormal ()
float getArea () const
Vector3 getMidpoint () const

Protected Attributes

Vertexm_vertices [3]
Vector3 m_normal
bool m_normalValid
Material * m_material

Detailed Description

Description

Definition at line 33 of file Triangle.h.


Member Function Documentation

void Triangle::calculateNormal  ) 
 

<

Todo:
Is this necesarry?
Definition at line 63 of file Triangle.cpp.

References OpenCAL::Vertex::getPosition().

Referenced by OpenCAL::JellyBeam::constructBeam(), OpenCAL::Cloth::constructCloth(), OpenCAL::PLYLoader::loadMesh(), OpenCAL::MLoader::loadMesh(), OpenCAL::ASELoader::loadMesh(), and OpenCAL::ASCLoader::loadMesh().

Here is the call graph for this function:

float Triangle::getArea  )  const
 

This functions calculates the area of the triangle, as in Rick Parent's book, at page 428

\[ area(v1, v2, v3) = \frac{1}{2} . |(v1 - v3) x (v2 - v3)| \]

Definition at line 80 of file Triangle.cpp.

References OpenCAL::Vertex::getPosition().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 19:19:28 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8