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 | |
| 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.
| cpe::sphere::sphere | ( | ) |
empty constructor
| cpe::sphere::sphere | ( | const v3 & | x0, | |
| const double & | r | |||
| ) |
direct constructor (center+radius)
| cpe::sphere::~sphere | ( | ) | [virtual] |
desctructor
| 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(), x0, and cpe::ray::x0().

double cpe::sphere::r [private] |
internal radius of the sphere
v3 cpe::sphere::x0 [private] |
internal center of the sphere
Referenced by intersect().
1.6.3