add default constructors for Optional

This commit is contained in:
Shuo Feng 2024-03-19 23:59:11 -04:00
parent a62e5eadc5
commit bb70580274
Signed by: sfeng
GPG key ID: 1E83AE6CD1C037B1
2 changed files with 3 additions and 0 deletions

View file

@ -9,6 +9,8 @@ using Eigen::Vector3f;
class HitRecord {
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) {}
bool operator<(const HitRecord &) const;

View file

@ -7,6 +7,7 @@ using Eigen::Vector3f;
class Ray {
public:
Ray() : origin_(Vector3f::Zero()), direction_(Vector3f::Zero()) {}
Ray(const Vector3f &o, const Vector3f &d) : origin_(o), direction_(d) {}
private: