Skip to content
Snippets Groups Projects
Commit eec591b8 authored by Lukas Werner's avatar Lukas Werner
Browse files

Inlined isPlaneVisible and coordinateToArrayIndex

parent 491091af
No related merge requests found
...@@ -179,7 +179,7 @@ void Raytracer::writeTBufferToFile(const std::vector<real_t>& tBuffer, const std ...@@ -179,7 +179,7 @@ void Raytracer::writeTBufferToFile(const std::vector<real_t>& tBuffer, const std
* Checks if a plane should get rendered by comparing the planes normal and the ray direction. * 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. * If the rays direction vectors projection on the planes normal is positive, the plane is considered invisible.
*/ */
bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { inline bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const {
return plane->getNormal() * ray.getDirection() < 0; return plane->getNormal() * ray.getDirection() < 0;
} }
...@@ -188,7 +188,7 @@ bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const { ...@@ -188,7 +188,7 @@ bool Raytracer::isPlaneVisible(const PlaneID plane, const Ray& ray) const {
* \param y Y component of the coordinate. * \param y Y component of the coordinate.
* \return Array index. * \return Array index.
*/ */
size_t Raytracer::coordinateToArrayIndex(size_t x, size_t y) const { inline size_t Raytracer::coordinateToArrayIndex(size_t x, size_t y) const {
return y*pixelsHorizontal_ + x; return y*pixelsHorizontal_ + x;
} }
} }
......
...@@ -124,8 +124,8 @@ public: ...@@ -124,8 +124,8 @@ public:
private: private:
void writeTBufferToFile(const std::vector<real_t>& tBuffer, size_t timestep, bool isGlobalImage = false) const; void writeTBufferToFile(const std::vector<real_t>& tBuffer, size_t timestep, bool isGlobalImage = false) const;
void writeTBufferToFile(const std::vector<real_t>& tBuffer, const std::string& fileName) const; void writeTBufferToFile(const std::vector<real_t>& tBuffer, const std::string& fileName) const;
bool isPlaneVisible(const PlaneID plane, const Ray& ray) const; inline bool isPlaneVisible(const PlaneID plane, const Ray& ray) const;
size_t coordinateToArrayIndex(size_t x, size_t y) const; inline size_t coordinateToArrayIndex(size_t x, size_t y) const;
//@} //@}
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment