mirror of
https://github.com/vonhyou/ray-tracer-comp371.git
synced 2025-06-08 07:22:01 +00:00
add default constructors for Optional
This commit is contained in:
parent
a62e5eadc5
commit
bb70580274
2 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,8 @@ using Eigen::Vector3f;
|
||||||
|
|
||||||
class HitRecord {
|
class HitRecord {
|
||||||
public:
|
public:
|
||||||
|
HitRecord()
|
||||||
|
: t(0), ray_(Ray()), normal_(Vector3f::Zero()), geometry_(nullptr) {}
|
||||||
HitRecord(float t, const Ray &r, Geometry *g) : t(t), ray_(r), geometry_(g) {}
|
HitRecord(float t, const Ray &r, Geometry *g) : t(t), ray_(r), geometry_(g) {}
|
||||||
bool operator<(const HitRecord &) const;
|
bool operator<(const HitRecord &) const;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Eigen::Vector3f;
|
||||||
|
|
||||||
class Ray {
|
class Ray {
|
||||||
public:
|
public:
|
||||||
|
Ray() : origin_(Vector3f::Zero()), direction_(Vector3f::Zero()) {}
|
||||||
Ray(const Vector3f &o, const Vector3f &d) : origin_(o), direction_(d) {}
|
Ray(const Vector3f &o, const Vector3f &d) : origin_(o), direction_(d) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue