Skip to content
Snippets Groups Projects
Commit 8ef6d036 authored by Yoel's avatar Yoel
Browse files

Group refactor: Texels working

parent cbe1993b
No related branches found
No related tags found
No related merge requests found
......@@ -40,11 +40,16 @@ std::optional<cam::Hit> Group::intersect(const cam::Ray& r) const {
if (result) {
result = std::optional<cam::Hit>(
{transform.toWorld.transformPoint(result->point()),
transform.toWorldN.transformDir(result->normal()),
transform.toWorldN.transformDir(result->normal()), result->texel(),
result->scalar(), result->material});
}
return result;
}
// Not used
std::pair<float, float> Group::texture_coordinates(
const util::Vec3& pos) const {
return std::pair<float, float>({0, 0});
}
util::AxisAlignedBoundingBox Group::bounds() const {
return boundingVolume;
}
......
......@@ -14,6 +14,8 @@ class Group : public Shape {
Group(const util::Mat4& matrix, bool rebuildBB = true);
std::optional<cam::Hit> intersect(const cam::Ray& r) const override;
virtual std::pair<float, float> texture_coordinates(
const util::Vec3& pos) const override;
util::AxisAlignedBoundingBox bounds() const override;
void setBounds(const util::AxisAlignedBoundingBox& bb);
void add(const Group& group);
......
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