home *** CD-ROM | disk | FTP | other *** search
- /*
- * Triangle.h - class definition for geometric object triangle.
- *
- * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
- * University of Berne, Switzerland
- * Copyright (C) 1989, 1991, Craig E. Kolb
- * All rights reserved.
- *
- * This software may be freely copied, modified, and redistributed
- * provided that this copyright notice is preserved on all copies.
- *
- * You may not distribute this software, in whole or in part, as part of
- * any commercial product without the express consent of the authors.
- *
- * There is no warranty or other guarantee of fitness of this software
- * for any purpose. It is provided solely "as is".
- *
- */
-
- #ifndef Triangle_H
- # define Triangle_H
-
- #include "GeoObject.h"
-
- //___________________________________________________________ Triangle
-
- class Triangle : public GeoObject
- {
- public:
- static GeoObject* create(const Vector&, const Vector&, const Vector&);
-
- int intersect(const Ray&, real, real&);
- Vector normal(const Vector&) const;
- PolygonList* tesselate(const BoundingBox&);
-
- private:
- Triangle(const Vector&, const Vector&, const Vector&);
-
- private:
- Vector v1, v2, v3; // triangle vertices
- Vector e1, e2; // triangle edges (scaled)
- Vector n; // triangle normal
- real D; // plane constant
- int index1, index2;
- };
-
- #endif // Triangle_H
-