Main Page | Class Hierarchy | Class List | File List | Class Members

plane.h

00001 /* ************************************************************************* 00002 plane.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: plane_8h-source.html,v 1.1 2005/02/04 21:02:27 micha Exp $ 00009 00010 ************************************************************************* */ 00011 00012 /* ************************************************************************* 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ************************************************************************* */ 00020 00021 #ifndef PLANE_H 00022 #define PLANE_H 00023 00024 #include "object3d.h" 00025 #include "intersection.h" 00026 00031 class Plane: public Object3D { 00032 00033 public: // Constructors and destructor 00037 Plane(const Vector3& n): normal(n) {}; 00038 ~Plane() {} 00039 00040 public: // Public methods 00041 00042 // Inherited by Object3D 00043 Object3D* duplicate() const {return new Plane(*this);} 00044 Intersection* intersectLocal(const Ray& r) const; 00045 Intersection* intersectLocalLimitedTime(const Ray &r, DBL maxtime) const; 00046 bool isInsideAt(const Vector3 &locallocation) const; 00047 00048 private: // Static members 00049 00052 static HitStatistics stat; 00053 00054 private: // Private attributes 00055 #ifdef WRONG_INNER_CLASSES_ACCESS 00056 public: 00057 #endif 00058 Vector3 normal; 00059 00060 private: // Private inner classes 00061 00064 class PlaneIntersection: public Intersection { 00065 private: // Private attributes 00066 DBL time; 00067 00068 public: // Constructors and destructor 00069 PlaneIntersection(const Plane* o, const Ray& r, DBL hittime): 00070 Intersection(o,r), time(hittime) {} 00071 ~PlaneIntersection() {} 00072 00073 public: // Intersection methods 00074 DBL currentTime() {return time;} 00075 void next() {time = INTERSECTION_INFINIT_TIME;} 00076 Vector3 normal(); 00077 }; 00078 00079 }; 00080 00081 #endif

Generated on Thu Jan 27 12:16:06 2005 for raytracer.kdevelop by doxygen 1.3.8