From 77e0d3870a43705b6a9398986484a676c8d7a9c7 Mon Sep 17 00:00:00 2001
From: Yoel <s73017@beuth-hochschule.de>
Date: Sun, 22 Nov 2020 14:10:45 +0100
Subject: [PATCH] Refactored with the interfaces light and shape

---
 RayTracer/shape/Sphere.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/RayTracer/shape/Sphere.h b/RayTracer/shape/Sphere.h
index 91961a4..73edcc2 100644
--- a/RayTracer/shape/Sphere.h
+++ b/RayTracer/shape/Sphere.h
@@ -1,14 +1,17 @@
 #pragma once
 
-#include "LightShape.h"
+#include "Light.h"
+#include "Shape.h"
 
 namespace shapes {
-class Sphere : public LightShape {
+class Sphere : public Light, public Shape {
    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;
 	util::SurfacePoint sampleLight() const override;
+	util::Vec3 calculateLightEmission(const util::SurfacePoint& p,
+	                                  const util::Vec3& d) const override;
 
    private:
 	std::shared_ptr<material::Material> material;
-- 
GitLab