diff --git a/src/HitRecord.h b/src/HitRecord.h index 599db5a..7c13aa1 100644 --- a/src/HitRecord.h +++ b/src/HitRecord.h @@ -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; diff --git a/src/Ray.h b/src/Ray.h index a344e5d..252952f 100644 --- a/src/Ray.h +++ b/src/Ray.h @@ -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: