Skip to content
Snippets Groups Projects
Commit 779ef151 authored by Yoel's avatar Yoel
Browse files

Changed const members to private and declared and defined getter

parent 1218ed36
No related branches found
No related tags found
No related merge requests found
......@@ -7,9 +7,6 @@ Hit::Hit(const util::Vec3& hit, const util::Vec3& n, float t,
const std::shared_ptr<material::Material>& material)
: hit(hit), n(n), t(t), material(material) {
}
bool Hit::scatter() const {
return material->scatter();
}
Ray Hit::scattered_ray(const Ray& inc_ray) const {
return Ray(hit, material->scattered_d(inc_ray.d, n),
std::numeric_limits<float>::epsilon(), inc_ray.tmax, true);
......@@ -20,4 +17,16 @@ util::Vec3 Hit::albedo() const {
util::Vec3 Hit::emission() const {
return material->emission(0, 0);
}
bool Hit::scatter() const {
return material->scatter();
}
util::Vec3 Hit::hitpoint() const {
return hit;
}
util::Vec3 Hit::normal() const {
return n;
}
float Hit::scalar() const {
return t;
}
} // namespace cam
\ No newline at end of file
......@@ -8,15 +8,20 @@ class Hit {
public:
Hit(const util::Vec3& hit, const util::Vec3& n, float t,
const std::shared_ptr<material::Material>& material);
Ray scattered_ray(const Ray& inc_ray) const;
util::Vec3 albedo() const; // TODO TexelPos
util::Vec3 emission() const; // TODO TexelPos
bool scatter() const;
util::Vec3 hitpoint() const;
util::Vec3 normal() const;
float scalar() const;
// Attributes
// TODO TexelPos
const util::Vec3 hit, n;
const float t;
const std::shared_ptr<material::Material> material;
private:
util::Vec3 hit, n;
float t;
std::shared_ptr<material::Material> material;
};
} // namespace cam
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