Sphere.hh

00001 /**********************************************************************
00002  * blaRAY -- photon mapper/raytracer
00003  * (C) 2008 by Tomasz bla Fortuna <bla@thera.be>, <bla@af.gliwice.pl>
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation, either version 3 of the License, or
00008  * any later version.
00009  *
00010  * See Docs/LICENSE
00011  *********************/
00012 
00013 #ifndef _SPHERE_H_
00014 #define _SPHERE_H_
00015 
00016 #include <iostream>
00017 #include <string>
00018 
00019 #include "World/Object.hh"
00020 
00021 namespace World {
00028         class Sphere : public Object {
00029         protected:
00031                 Math::Vector Center;
00032 
00034                 Double Radius;
00035 
00036                 virtual std::string Dump() const;
00037         public:
00039                 Sphere(const Math::Vector &Center,
00040                        Double Radius,
00041                        const Material &M = MatLib::Red(), 
00042                        Bool Visible = true)
00043                         : Object(M, Visible), 
00044                           Center(Center), Radius(Radius)
00045                 {
00046                 }
00047 
00048                 virtual Bool Collide(const Render::Ray &R, Double &RayPos) const;
00049                 virtual Math::Vector NormalAt(const Math::Vector &Point) const;
00050                 virtual Math::Point UVAt(const Math::Vector &Point) const;
00051 
00052         };
00053 };
00054 
00055 #endif

Generated on Wed Mar 12 00:34:58 2008 for blaRAY by  doxygen 1.5.5