|
raytracer
Parallel Ray Tracer written from scratch (no graphics API).
|
#include <sphere.h>


Public Member Functions | |
| Sphere (std::unique_ptr< const Material > _mat, const common::Vec3 &_center, double _radius) | |
| common::Vec3 | get_center () const |
| double | get_radius () const |
| double | ray_intersection (const Ray &r) const override |
| common::Vec3 | get_normal (const common::Vec3 &point) const override |
| ObjectType | get_type () const override |
| Public Member Functions inherited from raytracer::raytracer::Object | |
| virtual | ~Object ()=default |
| Object (std::unique_ptr< const Material > _mat) | |
| const Material * | get_material () const |
A sphere, defined by its center and radius.
| raytracer::raytracer::Sphere::Sphere | ( | std::unique_ptr< const Material > | _mat, |
| const common::Vec3 & | _center, | ||
| double | _radius ) |
Creates a sphere with the given properties.
| _mat | The material of the sphere, owned by the sphere. |
| _center | The position of the center of the sphere. |
| _radius | The radius of the sphere. |

|
nodiscard |
Getter for the center of the sphere.


|
nodiscardoverridevirtual |
Returns the normal to the surface of the object at a given point.
| point | A point on the surface of the object. |
Implements raytracer::raytracer::Object.


|
nodiscard |
Getter for the radius of the sphere.


|
inlinenodiscardoverridevirtual |
Returns the type of the object, used to identify the concrete class.
Implements raytracer::raytracer::Object.
|
nodiscardoverridevirtual |
Computes the distance along a ray at which it first hits the object.
| r | The ray to intersect with the object. |
Implements raytracer::raytracer::Object.

