#include <Sphere.hh>


Implements collisions, UV coordinates and normal calculations for spheres.
Definition at line 28 of file Sphere.hh.
Public Member Functions | |
| Sphere (const Math::Vector &Center, Double Radius, const Material &M=MatLib::Red(), Bool Visible=true) | |
| virtual Bool | Collide (const Render::Ray &R, Double &RayPos) const |
| virtual Math::Vector | NormalAt (const Math::Vector &Point) const |
| virtual Math::Point | UVAt (const Math::Vector &Point) const |
Protected Member Functions | |
| virtual std::string | Dump () const |
Protected Attributes | |
| Math::Vector | Center |
| Double | Radius |
| World::Sphere::Sphere | ( | const Math::Vector & | Center, | |
| Double | Radius, | |||
| const Material & | M = MatLib::Red(), |
|||
| Bool | Visible = true | |||
| ) | [inline] |
| std::string World::Sphere::Dump | ( | ) | const [protected, virtual] |
Debug function
Reimplemented from World::Object.
Definition at line 89 of file Sphere.cc.
References Center, World::Object::M, and Radius.
| Bool World::Sphere::Collide | ( | const Render::Ray & | R, | |
| Double & | RayPos | |||
| ) | const [virtual] |
Find a collision point with a ray
Implements World::Object.
Definition at line 25 of file Sphere.cc.
References Center, Render::Ray::Direction(), Math::Vector::Dot(), World::NearestCollision(), Radius, Math::Tuple< T, DoCropping, Count >::SquareLength(), and Render::Ray::Start().
Referenced by Testcases::Scene().


| Math::Vector World::Sphere::NormalAt | ( | const Math::Vector & | Point | ) | const [virtual] |
Find a normal to the object at it's surface
Implements World::Object.
Definition at line 66 of file Sphere.cc.
References Center.
| Math::Point World::Sphere::UVAt | ( | const Math::Vector & | Point | ) | const [virtual] |
Find object UV coordinates at specified surface location
Implements World::Object.
Definition at line 71 of file Sphere.cc.
References Center, Math::PI(), and Radius.

Math::Vector World::Sphere::Center [protected] |
Double World::Sphere::Radius [protected] |
1.5.5