#include <raytracing.hpp>
Public Member Functions | |
Sphere (Vector3f center=Vector3f{0.0f, 0.0f, 0.0f}, float radius=1.0f) | |
Constructor. | |
const Vector3f & | center (void) const |
Return origin point. | |
bool | set_center (Vector3f center) |
Update center point. | |
float | radius (void) const |
Return radius vector. | |
bool | set_radius (float radius) |
Update radius. | |
bool | intersect (const Ray &ray, Intersection &intersection) |
Perform intersection between a ray and the current object. |
Constructor.
center | Center of sphere |
radius | Radius of sphere |
bool raytracing::Sphere::intersect | ( | const Ray & | ray, |
Intersection & | intersection | ||
) | [virtual] |
Perform intersection between a ray and the current object.
ray | Ray to intersect with (input) |
intersection | Intersection point (output) |
Implements raytracing::Object.