home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / oct93 / graphics / graphtal.lha / Graphtal / Plane.h < prev    next >
C/C++ Source or Header  |  1992-11-19  |  1KB  |  47 lines

  1. /*
  2.  * Plane.h - class definition for geometric object plane.
  3.  *
  4.  * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
  5.  *                     University of Berne, Switzerland
  6.  * Copyright (C) 1989, 1991, Craig E. Kolb
  7.  * All rights reserved.
  8.  *
  9.  * This software may be freely copied, modified, and redistributed
  10.  * provided that this copyright notice is preserved on all copies.
  11.  *
  12.  * You may not distribute this software, in whole or in part, as part of
  13.  * any commercial product without the express consent of the authors.
  14.  *
  15.  * There is no warranty or other guarantee of fitness of this software
  16.  * for any purpose.  It is provided solely "as is".
  17.  *
  18.  */
  19.  
  20. #ifndef Plane_H
  21. # define Plane_H
  22.  
  23. #include "GeoObject.h"
  24.  
  25. //___________________________________________________________ Plane
  26.  
  27. class Plane : public GeoObject 
  28. {
  29. public:
  30.   static GeoObject* create(const Vector&, const Vector&);
  31.  
  32.   int intersect(const Ray&, real, real&);
  33.   Vector normal(const Vector&) const;
  34.   PolygonList* tesselate(const BoundingBox&);
  35.  
  36. private:
  37.   Plane(const Vector&, const Vector&);
  38.   int intersectPlaneWithSegment(const Vector&, const Vector&, Vector&);
  39.  
  40. private:
  41.   Vector n;   // plane normal
  42.   Vector pos; // point on the plane
  43.   real D;     // plane constant
  44. };
  45.  
  46. #endif // Plane_H
  47.