-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsphere.hh
32 lines (26 loc) · 849 Bytes
/
sphere.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <cmath>
#include "hitable.hh"
// #include "material.hxx"
namespace partou
{
class Sphere : public Hitable
{
public:
Sphere() = delete;
Sphere(const math::Point3f& center,
math::Float r,
std::shared_ptr<Material> matp); // fix the material raw ptr
auto hit(const Ray& r, math::Float t_min, math::Float t_max, hit_info& info) const
-> bool final override;
auto transformModel(const math::spatial::Transform& tModel) -> void final override;
auto pdf_value(const math::Point3f& origin, const math::Vec3f& dir) const
-> math::Float final override;
auto random(const math::Point3f& origin) const -> math::Vec3f final override;
math::Point3f center;
math::Float radius;
std::shared_ptr<Material> mat_ptr;
protected:
auto computeBoundingBox() -> void;
};
} // namespace partou