From 70efd9cbea6719a08ef8428fe5b9e4a71e721d46 Mon Sep 17 00:00:00 2001 From: Yoel <s73017@beuth-hochschule.de> Date: Tue, 6 Oct 2020 17:27:32 +0200 Subject: [PATCH] Sphere is now a light which its defined functions --- RayTracer/shape/Sphere.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RayTracer/shape/Sphere.h b/RayTracer/shape/Sphere.h index 32e5b5e..32016d0 100644 --- a/RayTracer/shape/Sphere.h +++ b/RayTracer/shape/Sphere.h @@ -1,13 +1,15 @@ #pragma once +#include "Light.h" #include "Shape.h" namespace shapes { -class Sphere : public Shape { +class Sphere : public Shape, public Light { public: Sphere(float radius, const std::shared_ptr<material::Material>& material); std::optional<cam::Hit> intersect(const cam::Ray& r) const override; util::AxisAlignedBoundingBox bounds() const override; + cam::Hit sampleLight() const override; private: std::shared_ptr<material::Material> material; -- GitLab