From c3b9561fe888c5e59cf3bf9a39e81cd3a592db03 Mon Sep 17 00:00:00 2001 From: Lukas Werner <lks.werner@fau.de> Date: Fri, 26 Jan 2018 11:19:24 +0100 Subject: [PATCH] Fixed inlining --- src/pe/raytracing/Raytracer.cpp | 19 ------------------- src/pe/raytracing/Raytracer.h | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/pe/raytracing/Raytracer.cpp b/src/pe/raytracing/Raytracer.cpp index 33b40ab8f..146e8fa54 100644 --- a/src/pe/raytracing/Raytracer.cpp +++ b/src/pe/raytracing/Raytracer.cpp @@ -172,25 +172,6 @@ void Raytracer::writeTBufferToFile(const std::vector<real_t>& tBuffer, const std ofs.close(); } -/*!\brief Checks if a plane should get rendered. - * \param plane Plane to check for visibility. - * \param ray Ray which is intersected with plane. - * - * Checks if a plane should get rendered by comparing the planes normal and the ray direction. - * If the rays direction vectors projection on the planes normal is positive, the plane is considered invisible. - */ -inline bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { - return plane->getNormal() * ray.getDirection() < 0; -} - -/*!\brief Converts a coordinate to an array index. - * \param x X component of the coordinate. - * \param y Y component of the coordinate. - * \return Array index. - */ -inline size_t Raytracer::coordinateToArrayIndex(size_t x, size_t y) const { - return y*pixelsHorizontal_ + x; -} } } } diff --git a/src/pe/raytracing/Raytracer.h b/src/pe/raytracing/Raytracer.h index 49b3c3521..eb0b799ba 100644 --- a/src/pe/raytracing/Raytracer.h +++ b/src/pe/raytracing/Raytracer.h @@ -218,6 +218,26 @@ inline void Raytracer::setTBufferOutputDirectory(const std::string& path) { tBufferOutputDirectory_ = path; } + +/*!\brief Checks if a plane should get rendered. + * \param plane Plane to check for visibility. + * \param ray Ray which is intersected with plane. + * + * Checks if a plane should get rendered by comparing the planes normal and the ray direction. + * If the rays direction vectors projection on the planes normal is positive, the plane is considered invisible. + */ +inline bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { + return plane->getNormal() * ray.getDirection() < 0; +} + +/*!\brief Converts a coordinate to an array index. + * \param x X component of the coordinate. + * \param y Y component of the coordinate. + * \return Array index. + */ +inline size_t Raytracer::coordinateToArrayIndex(size_t x, size_t y) const { + return y*pixelsHorizontal_ + x; +} /*!\brief Does one raytracing step. * @@ -359,7 +379,7 @@ void Raytracer::rayTrace(const size_t timestep) { } } } - + } } } -- GitLab