rcrt::Sphere Class Reference

#include <Sphere.h>

Inheritance diagram for rcrt::Sphere:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Sphere (const Point3D &c, float r, SolidObject *parent=0)
 Sphere (const Sphere &s, SolidObject *parent=0)
virtual ~Sphere ()
virtual Intersection intersect (Ray &ray) const
virtual const AABBgetBoundingBox () const
virtual const Point3DgetCentroid () const
float getRadius () const
virtual Vec3D getSNormal (float zenith, float azimuth) const
virtual Vec3D getGNormal (float zenith, float azimuth) const
virtual Point2D getUV (float zenith, float azimuth) const
AABB clipBox (AABB &cbox) const

Private Member Functions

void assign (const Sphere &s)

Private Attributes

Point3D center
float radius
AABB box


Detailed Description

A sphere.

TODO UV mapping

Definition at line 15 of file Sphere.h.


Constructor & Destructor Documentation

rcrt::Sphere::Sphere ( const Point3D c,
float  r,
SolidObject parent = 0 
)

Definition at line 12 of file Sphere.cpp.

References box, center, rcrt::AABB::extend(), and radius.

rcrt::Sphere::Sphere ( const Sphere s,
SolidObject parent = 0 
)

Definition at line 19 of file Sphere.cpp.

References assign().

rcrt::Sphere::~Sphere (  )  [virtual]

Definition at line 25 of file Sphere.cpp.


Member Function Documentation

void rcrt::Sphere::assign ( const Sphere s  )  [private]

Definition at line 30 of file Sphere.cpp.

References center, and radius.

Referenced by Sphere().

Intersection rcrt::Sphere::intersect ( Ray r  )  const [virtual]

Parameters:
The ray that will be tested against.
Returns:
An Intersection that contains the closest intersection that can be determined.

Implements rcrt::Traceable.

Definition at line 36 of file Sphere.cpp.

References rcrt::Ray::atDistance(), center, rcrt::Ray::dir(), rcrt::Ray::org(), radius, rcrt::Intersection::setGNormalL(), and rcrt::Intersection::setSNormalL().

const AABB & rcrt::Sphere::getBoundingBox (  )  const [virtual]

Returns:
The minimum Axis-Aligned Bounding Box of this Traceable.

Implements rcrt::Traceable.

Definition at line 81 of file Sphere.cpp.

References box.

Referenced by clipBox().

const Point3D & rcrt::Sphere::getCentroid (  )  const [virtual]

Returns:
Some kind of central point of this object. This may just be an approximation (e.g. the central point of the AABB).

Implements rcrt::Traceable.

Definition at line 87 of file Sphere.cpp.

References center.

float rcrt::Sphere::getRadius (  )  const

Definition at line 92 of file Sphere.cpp.

References radius.

Vec3D rcrt::Sphere::getSNormal ( float  a,
float  b 
) const [virtual]

Parameters:
a 2D Parameterization of the surface
b 2D Parameterization of the surface
Returns:
The local space shading normal of the parameterized point on the primitive.

Implements rcrt::Primitive.

Definition at line 97 of file Sphere.cpp.

References getGNormal().

Vec3D rcrt::Sphere::getGNormal ( float  a,
float  b 
) const [virtual]

Parameters:
a 2D Parameterization of the surface
b 2D Parameterization of the surface
Returns:
The local space geometry normal of the parameterized point on the primitive.

Implements rcrt::Primitive.

Definition at line 102 of file Sphere.cpp.

References rcrt::Vec3D::normalize().

Referenced by getSNormal().

Point2D rcrt::Sphere::getUV ( float  a,
float  b 
) const [virtual]

Parameters:
a 2D Parameterization of the surface
b 2D Parameterization of the surface
Returns:
UV texture coordinates of this point.

Implements rcrt::Primitive.

Definition at line 111 of file Sphere.cpp.

AABB rcrt::Sphere::clipBox ( AABB cbox  )  const

Definition at line 116 of file Sphere.cpp.

References getBoundingBox().


Member Data Documentation

Point3D rcrt::Sphere::center [private]

Definition at line 18 of file Sphere.h.

Referenced by assign(), getCentroid(), intersect(), and Sphere().

float rcrt::Sphere::radius [private]

Definition at line 19 of file Sphere.h.

Referenced by assign(), getRadius(), intersect(), and Sphere().

AABB rcrt::Sphere::box [private]

Definition at line 20 of file Sphere.h.

Referenced by getBoundingBox(), and Sphere().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:33:10 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3