#include <Sphere.h>
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 AABB & | getBoundingBox () const |
virtual const Point3D & | getCentroid () 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 |
TODO UV mapping
Definition at line 15 of file Sphere.h.
rcrt::Sphere::Sphere | ( | const Point3D & | c, | |
float | r, | |||
SolidObject * | parent = 0 | |||
) |
rcrt::Sphere::Sphere | ( | const Sphere & | s, | |
SolidObject * | parent = 0 | |||
) |
rcrt::Sphere::~Sphere | ( | ) | [virtual] |
Definition at line 25 of file Sphere.cpp.
void rcrt::Sphere::assign | ( | const Sphere & | s | ) | [private] |
Intersection rcrt::Sphere::intersect | ( | Ray & | r | ) | const [virtual] |
The | ray that will be tested against. |
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] |
Implements rcrt::Traceable.
Definition at line 81 of file Sphere.cpp.
References box.
Referenced by clipBox().
const Point3D & rcrt::Sphere::getCentroid | ( | ) | const [virtual] |
Implements rcrt::Traceable.
Definition at line 87 of file Sphere.cpp.
References center.
float rcrt::Sphere::getRadius | ( | ) | const |
Vec3D rcrt::Sphere::getSNormal | ( | float | a, | |
float | b | |||
) | const [virtual] |
a | 2D Parameterization of the surface | |
b | 2D Parameterization of the surface |
Implements rcrt::Primitive.
Definition at line 97 of file Sphere.cpp.
References getGNormal().
Vec3D rcrt::Sphere::getGNormal | ( | float | a, | |
float | b | |||
) | const [virtual] |
a | 2D Parameterization of the surface | |
b | 2D Parameterization of the surface |
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] |
a | 2D Parameterization of the surface | |
b | 2D Parameterization of the surface |
Implements rcrt::Primitive.
Definition at line 111 of file Sphere.cpp.
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] |