#include <box.h>
Inheritance diagram for Triangle:
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 |
|
Default constructor |
|
Constructor to build a triangle from 3 points |
|
Test for intersection with a sphere (O origin) Returns true if collision occured. Outputs collision point in cp |
|
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 |
|
Tests for intersection with another triangle. |
|
|
|
|
|
|
|
|