◆ Sphere() [1/2]
Construct a new Sphere object.
This function constructs a new Sphere object with the given center, radius, and material. The sphere is centered at the given center with the given radius and material.
- Parameters
-
center | The center of the sphere. |
radius | The radius of the sphere. |
material | The material of the sphere. |
- Returns
- A new Sphere object.
◆ Sphere() [2/2]
Construct a new Sphere object.
This function constructs a new Sphere object with the given centers, radius, and material. The sphere is centered at the given centers with the given radius and material.
- Parameters
-
one | The first center of the sphere. |
two | The second center of the sphere. |
radius | The radius of the sphere. |
material | The material of the sphere. |
- Returns
- A new Sphere object.
◆ boundingBox()
Get the bounding box of the sphere.
This function returns the bounding box of the sphere.
- Returns
- The bounding box of the sphere.
Implements Raytracer::Interfaces::IHittable.
◆ getSphereUV()
void Raytracer::Shapes::Sphere::getSphereUV |
( |
const Utils::Point3 & | point, |
|
|
double & | u, |
|
|
double & | v ) |
|
static |
Get the UV coordinates of the sphere.
This function returns the UV coordinates of the sphere.
- Parameters
-
point | The point to get the UV coordinates. |
u | The U coordinate of the UV coordinates. |
v | The V coordinate of the UV coordinates. |
◆ hit()
Check if the ray hits the sphere.
This function checks if the ray hits the sphere. The function returns true if the ray hits the sphere. The function returns false if the ray does not hit the sphere. The function updates the payload with the hit information.
- Parameters
-
ray | The ray to check for hits. |
interval | The interval to check for hits. |
payload | The payload to update with the hit information. |
- Returns
- true if the ray hits the sphere, false otherwise.
Implements Raytracer::Interfaces::IHittable.
◆ sphereCenter()
Get the center of the sphere at the given time.
This function returns the center of the sphere at the given time.
- Parameters
-
time | The time to get the center of the sphere. |
- Returns
- The center of the sphere at the given time.
The documentation for this class was generated from the following files:
- /Users/javii/Code/raytracer/include/shapes/Sphere.hpp
- /Users/javii/Code/raytracer/sources/shapes/Sphere.cpp