TinyRaytracer 0.1
A simple C++ raytracer
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Sphere Class Reference

Class sphere, with one center point and a radius, together with a rgb color value. More...

#include <object.hpp>

Inheritance diagram for Sphere:
Object

Public Member Functions

 Sphere ()
 Construct a new Sphere object with no inputs.
 
 Sphere (double x, double y, double z, double r, RGB rgb)
 Construct a new Sphere object, with color inputs.
 
 Sphere (double x, double y, double z, double r, std::string text)
 Construct a new Sphere object, with texture inputs.
 
ObjectInfo checkObject (Ray &ray) override
 
AABB getBox () override
 Get the Axis-aligned bounding box. More...
 
std::tuple< double, double > sphereUV (const point3 &point) const
 
RGB getColor (const point3 &point)
 
void setProperties (RGB shine, RGB tran, double ior, double roughness) override
 Set the Material properties. More...
 
virtual ObjectInfo checkObject (Ray &ray)=0
 
virtual void setProperties (RGB, RGB, double, double)
 
virtual AABB getBox ()=0
 

Public Attributes

point3 c
 Center point of the sphere.
 
double r
 Radius of the sphere.
 
Materials mat
 Material properties.
 
Image texture
 The texture, as a image.
 
- Public Attributes inherited from Object
AABB bbox
 Axis-aligned bounding box for the Object class. For BVH traversal.
 

Detailed Description

Class sphere, with one center point and a radius, together with a rgb color value.

Member Function Documentation

◆ checkObject()

ObjectInfo Sphere::checkObject ( Ray ray)
overridevirtual

Implements Object.

◆ getBox()

AABB Sphere::getBox ( )
inlineoverridevirtual

Get the Axis-aligned bounding box.

Returns
AABB Axis-aligned bounding box

Implements Object.

◆ setProperties()

void Sphere::setProperties ( RGB  shine,
RGB  tran,
double  ior,
double  roughness 
)
inlineoverridevirtual

Set the Material properties.

Reimplemented from Object.


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