1 /**********************************************************************
2 * blaRAY -- photon mapper/raytracer
3 * (C) 2008 by Tomasz bla Fortuna <bla@thera.be>, <bla@af.gliwice.pl>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
11 *********************/
19 #include "World/Object.hh"
23 * Mathematical sphere (ball rather)
25 * Implements collisions, UV coordinates and normal
26 * calculations for spheres.
28 class Sphere
: public Object
{
36 virtual std::string
Dump() const;
38 /** Construct sphere object */
39 Sphere(const Math::Vector
&Center
,
41 const Material
&M
= MatLib::Red(),
44 Center(Center
), Radius(Radius
)
48 virtual Bool
Collide(const Render::Ray
&R
, Double
&RayPos
) const;
49 virtual Math::Vector
NormalAt(const Math::Vector
&Point
) const;
50 virtual Math::Point
UVAt(const Math::Vector
&Point
) const;