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

ray.h

00001 /* ************************************************************************* 00002 ray.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: ray_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 RAY_H 00022 #define RAY_H 00023 00024 #include "vector.h" 00025 00030 class Ray { 00031 00032 friend class TransparentTransformatable; 00033 friend class BoundingBox; 00034 00035 protected: // Protected attributes 00036 00037 Vector3 origin; 00038 Vector3 direction; 00039 00040 public: // Constructors and destructor 00041 Ray(Vector3 o, Vector3 d):origin(o),direction(d) {}; 00042 00043 public: // Public methods: 00047 Vector3 getOrigin() const {return origin;} 00048 00052 Vector3 getDirection() const {return direction;} 00053 00058 Vector3 positionAtTime(DBL t) const { 00059 Vector3 r = direction.scaled(t); 00060 r.add(origin); 00061 return r; 00062 } 00063 00064 }; 00065 #endif

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