• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

Ray.h

Go to the documentation of this file.
00001 // GMTL is (C) Copyright 2001-2010 by Allen Bierbaum
00002 // Distributed under the GNU Lesser General Public License 2.1 with an
00003 // addendum covering inlined code. (See accompanying files LICENSE and
00004 // LICENSE.addendum or http://www.gnu.org/copyleft/lesser.txt)
00005 
00006 #ifndef _GMTL_RAY_H_
00007 #define _GMTL_RAY_H_
00008 
00009 #include <gmtl/Point.h>
00010 #include <gmtl/Vec.h>
00011 #include <gmtl/VecOps.h>
00012 
00013 namespace gmtl {
00014 
00025 template< class DATA_TYPE >
00026 class Ray
00027 {
00028 public:
00032    Ray()
00033    {}
00034 
00042    Ray( const Point<DATA_TYPE, 3>& origin, const Vec<DATA_TYPE, 3>& dir )
00043       : mOrigin( origin ), mDir( dir )
00044    {}
00045 
00046    
00047 
00053    Ray( const Ray& lineseg )
00054    {
00055       mOrigin = lineseg.mOrigin;
00056       mDir = lineseg.mDir;
00057    }
00058 
00064    const Point<DATA_TYPE, 3>& getOrigin() const
00065    {
00066       return mOrigin;
00067    }
00068 
00074    void setOrigin( const Point<DATA_TYPE, 3>& origin )
00075    {
00076       mOrigin = origin;
00077    }
00078 
00084    const Vec<DATA_TYPE, 3>& getDir() const
00085    {
00086       return mDir;
00087    }
00088 
00094    void setDir( const Vec<DATA_TYPE, 3>& dir )
00095    {
00096       mDir = dir;
00097    }
00098 
00099 public:
00103    Point<DATA_TYPE, 3> mOrigin;
00104 
00108    Vec<DATA_TYPE, 3> mDir;
00109 };
00110 
00111 
00112 // --- helper types --- //
00113 typedef Ray<float>  Rayf;
00114 typedef Ray<double> Rayd;
00115 }
00116 
00117 #endif

Generated on Sun Sep 19 2010 14:35:14 for GenericMathTemplateLibrary by  doxygen 1.7.1