Object3d of type Sphere (center+radius). Analytically compute intersection with a ray. More...
Public Member Functions | |
sphere () | |
empty constructor | |
sphere (const v3 &x0, const double &r) | |
direct constructor (center+radius) | |
virtual | ~sphere () |
desctructor | |
const double & | radius () const |
get radius | |
const v3 & | center () const |
get center | |
virtual std::vector < intersection_data > | intersect (const ray &seg) const |
Analytic intersection between a ray and the sphere. | |
Private Attributes | |
v3 | x0 |
internal center of the sphere | |
double | r |
internal radius of the sphere |
Object3d of type Sphere (center+radius). Analytically compute intersection with a ray.
empty constructor
cpe::sphere::sphere | ( | const v3 & | x0, |
const double & | r | ||
) |
direct constructor (center+radius)
cpe::sphere::~sphere | ( | ) | [virtual] |
desctructor
const v3 & cpe::sphere::center | ( | ) | const |
get center
References x0.
std::vector< intersection_data > cpe::sphere::intersect | ( | const ray & | seg | ) | const [virtual] |
Analytic intersection between a ray and the sphere.
Implements cpe::object3d.
References cpe::v3::dot(), cpe::ray::u(), cpe::ray::x0(), and x0.
const double & cpe::sphere::radius | ( | ) | const |
get radius
References r.
double cpe::sphere::r [private] |
internal radius of the sphere
Referenced by radius().
v3 cpe::sphere::x0 [private] |
internal center of the sphere
Referenced by center(), and intersect().