Skip to content
Snippets Groups Projects
Commit 5f8a2780 authored by Yoel's avatar Yoel
Browse files

Added ostream-operator to Hit class

parent 43a7e942
No related branches found
No related tags found
No related merge requests found
......@@ -11,4 +11,9 @@ Hit::Hit(const util::Vec3& hit, const util::Vec3& n, float t,
float Hit::scalar() const {
return t;
}
std::ostream& operator<<(std::ostream& os, const cam::Hit& rhs) {
os << "(" << rhs.point() << " " << rhs.normal() << " " << rhs.scalar()
<< ")";
return os;
}
} // namespace cam
\ No newline at end of file
......@@ -11,6 +11,8 @@ class Hit : public util::SurfacePoint {
const std::shared_ptr<material::Material>& material);
float scalar() const;
// Operator
friend std::ostream& operator<<(std::ostream& os, const cam::Hit& rhs);
private:
float t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment