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

cameraray.h

00001 /* ************************************************************************* 00002 cameraray.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: cameraray_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 CAMERARAY_H 00022 #define CAMERARAY_H 00023 00024 #include "ray.h" 00025 #include "insidelist.h" 00026 #include "intersection.h" 00027 #include "colour.h" 00028 #include "statistics.h" 00029 00030 class Scene; 00031 00036 class CameraRay: public Ray { 00037 00038 public: // Constructors and destructor 00039 00046 CameraRay(const Vector3 o, const Vector3 d, Scene* s, InsideList* l); 00047 00048 ~CameraRay(); 00049 00052 CameraRay(const CameraRay& r): 00053 Ray(r), norm(r.norm), myscene(r.myscene), inside(new InsideList(*r.inside)), 00054 hit(0), htime(0), ltime(0), hpoint(r.hpoint), hitstatus(NONE), 00055 tracelevel(r.tracelevel), weight(r.weight) {} 00056 00057 private: 00058 CameraRay& operator=(const CameraRay&); 00059 00060 public: // Public methods 00061 00064 FLT getWeight() {return weight;} 00065 00069 void scaleWeight(FLT s) {weight *= s;} 00070 00073 bool shoot(); 00074 00079 bool refract(FLT weightmult); 00080 00084 void reflect(FLT weightmult); 00085 00088 Vector3 normal() const {return norm;} 00089 00092 Texture* texture() const {return hit->texture();} 00093 00096 Vector3 hitpoint() const {return hpoint;} 00097 00101 Colour evaluateMedia(Colour& absorb) const; 00102 00105 InsideList* getInside() const {return inside;} 00106 00107 private: // Type definitions 00108 enum hitstatustype {NONE, OWN, OLD}; 00109 00110 private: // Static attributes 00113 static HitStatistics statcount; 00114 00117 static HitStatistics statref; 00118 00119 private: // Private attributes 00120 00124 Vector3 norm; 00125 00126 Scene* myscene; 00127 InsideList* inside; 00128 Intersection* hit; 00129 DBL htime, ltime; 00130 Vector3 hpoint; 00131 hitstatustype hitstatus; 00132 int tracelevel; 00133 FLT weight; 00134 00135 private: // Private methods 00136 void getIntersectionInfo(); 00137 void deleteIntersectionInfo(); 00138 00139 }; 00140 00141 #endif

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