Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Triangle Class Reference

#include <box.h>

Inheritance diagram for Triangle:

BoxedTriangle TriangleDesc List of all members.

Public Methods

 Triangle ()
 Triangle (const Vector3D& _1, const Vector3D& _2, const Vector3D& _3)
bool intersect (const Triangle& t) const
bool intersect (const Vector3D& O, const Vector3D& D, Vector3D& cp, float& tparm, float segmax)
bool intersect (const Vector3D& O, float radius, Vector3D& cp)

Public Attributes

Vector3D v1
Vector3D v2
Vector3D v3
Vector3D center

Detailed Description

A single triangle in the model


Constructor & Destructor Documentation

Triangle::Triangle ( ) [inline]
 

Default constructor

Triangle::Triangle ( const Vector3D & _1,
const Vector3D & _2,
const Vector3D & _3 )
 

Constructor to build a triangle from 3 points


Member Function Documentation

bool Triangle::intersect ( const Vector3D & O,
float radius,
Vector3D & cp )
 

Test for intersection with a sphere (O origin) Returns true if collision occured. Outputs collision point in cp

bool Triangle::intersect ( const Vector3D & O,
const Vector3D & D,
Vector3D & cp,
float & tparm,
float segmax )
 

Tests for intersection with a ray (O origin, D direction) Returns true if collision occured. Outputs collision point in cp Outputs the distance from the origin to the collision point in tparm This distance is relative to the magnitude of D Allows testing against a finite segment, by specifying the maximum length of the ray in segmax This length is also relative to the magnitude of D

bool Triangle::intersect ( const Triangle & t ) const
 

Tests for intersection with another triangle.


Member Data Documentation

Vector3D Triangle::center
 

Vector3D Triangle::v1
 

Vector3D Triangle::v2
 

Vector3D Triangle::v3
 


The documentation for this class was generated from the following files:
Generated at Sat Nov 18 00:15:14 2000 for coldet by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000