From d945526fb0a481fb120118c2a3de5f3656caf4d1 Mon Sep 17 00:00:00 2001 From: Yoel <s73017@beuth-hochschule.de> Date: Sat, 17 Oct 2020 18:29:48 +0200 Subject: [PATCH] calculateLightEmission does not need to transform --- RayTracer/shape/LightSingleGroup.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RayTracer/shape/LightSingleGroup.cpp b/RayTracer/shape/LightSingleGroup.cpp index ecff3f4..b2bbe7d 100644 --- a/RayTracer/shape/LightSingleGroup.cpp +++ b/RayTracer/shape/LightSingleGroup.cpp @@ -15,14 +15,14 @@ LightSingleGroup::LightSingleGroup(const util::Mat4& matrix, util::SurfacePoint LightSingleGroup::sampleLight() const { auto sample = light->sampleLight(); - return util::SurfacePoint(transform.toWorld.transformPoint(sample.point()), - transform.toWorldN.transformDir(sample.normal()), - sample.material); + auto result = util::SurfacePoint( + transform.toWorld.transformPoint(sample.point()), + transform.toWorldN.transformDir(sample.normal()), sample.material); + return result; } util::Vec3 LightSingleGroup::calculateLightEmission(const util::SurfacePoint& p, const util::Vec3& d) const { - return light->calculateLightEmission(p, - transform.fromWorld.transformDir(d)); + return light->calculateLightEmission(p, d); } } // namespace shapes \ No newline at end of file -- GitLab