Skip to content
Snippets Groups Projects
Hit.cpp 503 B
Newer Older
Postea's avatar
Postea committed
#include "Hit.h"
Yoel's avatar
Yoel committed

Postea's avatar
Postea committed
#include <limits>

namespace cam {
Yoel's avatar
Yoel committed
Hit::Hit(const util::Vec3& hit, const util::Vec3& n,
         const std::pair<float, float>& uv, float t,
Yoel's avatar
Yoel committed
         const std::shared_ptr<material::Material>& material)
Yoel's avatar
Yoel committed
    : util::SurfacePoint(hit, n, uv, material), t(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;
}
Yoel's avatar
Yoel committed
}  // namespace cam