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

Background refactor: Does not yet need new method

parent f8bacb2d
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,20 @@ namespace shapes {
Background::Background(const std::shared_ptr<material::Material>& material)
: material(material) {
}
// TODO TEXELS
std::optional<cam::Hit> Background::intersect(const cam::Ray& r) const {
return std::optional<cam::Hit>(
{r(std::numeric_limits<float>::infinity()), util::Vec3(0, 0, 0),
std::numeric_limits<float>::infinity(), material});
return std::optional<cam::Hit>({r(std::numeric_limits<float>::infinity()),
util::Vec3(0, 0, 0),
{0, 0},
std::numeric_limits<float>::infinity(),
material});
}
// Not used
std::pair<float, float> Background::texture_coordinates(
const util::Vec3& pos) const {
return std::pair<float, float>({0, 0});
}
util::AxisAlignedBoundingBox Background::bounds() const {
return util::AxisAlignedBoundingBox();
}
......
......@@ -7,6 +7,8 @@ class Background : public Shape {
public:
Background(const std::shared_ptr<material::Material>& material);
std::optional<cam::Hit> intersect(const cam::Ray& r) const override;
std::pair<float, float> Background::texture_coordinates(
const util::Vec3& pos) const override;
util::AxisAlignedBoundingBox bounds() const override;
private:
......
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