World::Sphere Class Reference

#include <Sphere.hh>

Inheritance diagram for World::Sphere:

Inheritance graph
[legend]
Collaboration diagram for World::Sphere:

Collaboration graph
[legend]

List of all members.


Detailed Description

Mathematical sphere (ball rather).

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

Constructor & Destructor Documentation

World::Sphere::Sphere ( const Math::Vector Center,
Double  Radius,
const Material M = MatLib::Red(),
Bool  Visible = true 
) [inline]

Construct sphere object

Definition at line 39 of file Sphere.hh.


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:


Member Data Documentation

Sphere center

Definition at line 31 of file Sphere.hh.

Referenced by Collide(), Dump(), NormalAt(), and UVAt().

Double World::Sphere::Radius [protected]

Sphere radius

Definition at line 34 of file Sphere.hh.

Referenced by Collide(), Dump(), and UVAt().


The documentation for this class was generated from the following files:

Generated on Wed Mar 12 00:36:59 2008 for blaRAY by  doxygen 1.5.5