raytracer
Parallel Ray Tracer written from scratch (no graphics API).
Loading...
Searching...
No Matches
raytracer::raytracer::Floor Class Reference

#include <floor.h>

Inheritance diagram for raytracer::raytracer::Floor:
Collaboration diagram for raytracer::raytracer::Floor:

Public Member Functions

 Floor (std::unique_ptr< const Material > _mat, double _y)
double get_y () 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

Detailed Description

An infinite horizontal plane, facing upwards.

Constructor & Destructor Documentation

◆ Floor()

raytracer::raytracer::Floor::Floor ( std::unique_ptr< const Material > _mat,
double _y )

Creates a floor with the given properties.

Parameters
_matThe material of the floor, owned by the floor.
_yThe height of the floor.
Here is the call graph for this function:

Member Function Documentation

◆ get_normal()

common::Vec3 raytracer::raytracer::Floor::get_normal ( const common::Vec3 & point) const
nodiscardoverridevirtual

Returns the normal to the surface of the object at a given point.

Parameters
pointA point on the surface of the object.
Returns
The normal to the surface at that point.

Implements raytracer::raytracer::Object.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_type()

ObjectType raytracer::raytracer::Floor::get_type ( ) const
inlinenodiscardoverridevirtual

Returns the type of the object, used to identify the concrete class.

Returns
The type of the object.

Implements raytracer::raytracer::Object.

◆ get_y()

double raytracer::raytracer::Floor::get_y ( ) const
nodiscard

Getter for the height of the floor.

Returns
The height of the floor.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ray_intersection()

double raytracer::raytracer::Floor::ray_intersection ( const Ray & r) const
nodiscardoverridevirtual

Computes the distance along a ray at which it first hits the object.

Parameters
rThe ray to intersect with the object.
Returns
The value t such that r.origin + r.direction * t is the intersection point, or a negative value if the ray does not hit the object.

Implements raytracer::raytracer::Object.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: