Skip to content

Commit

Permalink
Removed unnecessary GLM #include's
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikhuber committed Mar 26, 2023
1 parent d6d8685 commit f5d3d3d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 42 deletions.
5 changes: 0 additions & 5 deletions include/eos/fitting/closest_edge_fitting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@

#include "nanoflann.hpp"

#include "glm/common.hpp"
#include "glm/vec3.hpp"
#include "glm/vec4.hpp"
#include "glm/mat4x4.hpp"

#include "Eigen/Core"

#include <vector>
Expand Down
21 changes: 0 additions & 21 deletions include/eos/render/normals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#ifndef EOS_RENDER_NORMALS_HPP
#define EOS_RENDER_NORMALS_HPP

#include "glm/vec3.hpp"
#include "glm/geometric.hpp"

#include "Eigen/Core"

#include <vector>
Expand Down Expand Up @@ -68,24 +65,6 @@ inline Eigen::Vector3f compute_face_normal(const Eigen::Vector4f& v0, const Eige
return n.head<3>().normalized();
};

/**
* Computes the normal of a face (triangle), i.e. the per-face normal. Returned normal will be unit length.
*
* Assumes the triangle is given in CCW order, i.e. vertices in counterclockwise order on the screen are
* front-facing.
*
* @param[in] v0 First vertex.
* @param[in] v1 Second vertex.
* @param[in] v2 Third vertex.
* @return The unit-length normal of the given triangle.
*/
inline glm::vec3 compute_face_normal(const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2)
{
glm::vec3 n = glm::cross(v1 - v0, v2 - v0); // v0-to-v1 x v0-to-v2
n = glm::normalize(n);
return n;
};

/**
* Computes the per-face (per-triangle) normals of all triangles of the given mesh. Returned normals will be unit length.
*
Expand Down
3 changes: 1 addition & 2 deletions include/eos/render/ray_triangle_intersect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

#include "eos/cpp17/optional.hpp"

#include "glm/vec3.hpp"
#include "glm/geometric.hpp"
#include "Eigen/Core"

#include <utility>

Expand Down
7 changes: 1 addition & 6 deletions include/eos/render/texture_extraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
#include "eos/render/ray_triangle_intersect.hpp"
#include "eos/render/detail/utils.hpp" // for detail::divide_by_w()

#include "glm/mat4x4.hpp"
#include "glm/vec2.hpp"
#include "glm/vec3.hpp"
#include "glm/vec4.hpp"

#include <cassert>
#include <cstddef>
#include <vector>
Expand All @@ -59,7 +54,7 @@ namespace render {
* set to true, the angle will be encoded into the alpha channel (0 meaning occluded or facing away 90°,
* 127 meaning facing a 45° angle and 255 meaning front-facing, and all values in between). If set to
* false, the alpha channel will only contain 0 for occluded vertices and 255 for visible vertices.`
* - We perhaps should add another parameter, `glm::vec4 viewport`. We could need to change
* - We perhaps should add another parameter, `Eigen::Vector4 viewport`. We could need to change
* `clip_to_screen_space()` to make use of that.
* - Perhaps add an overload that takes a `vector<bool> visible vertices`, for the case when we already
* computed the visibility? (e.g. from the edge-fitting)
Expand Down
8 changes: 0 additions & 8 deletions include/eos/render/vertex_visibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@

#include "Eigen/Core"

#include "glm/vec3.hpp"
#include "glm/vec4.hpp"
#include "glm/mat4x4.hpp"

#include <array>
#include <vector>
#include <algorithm>
Expand All @@ -47,10 +43,6 @@ namespace render {
* Depending on \p ray_direction_type, the rays are either casted from each vertex along the positive z axis,
* or towards the origin (0, 0, 0).
*
* Note/Todo: We have a bit of an unnecessary conversion between GLM and Eigen going on. Ideally, ...:
* - probe_vertex should rather be an Eigen::Vector3f
* - mesh_vertices should rather be std::vector<Eigen::Vector3f>.
*
* @param[in] probe_vertex A single vertex to compute the visibility for.
* @param[in] mesh_vertices A set of vertices that form a mesh.
* @param[in] mesh_triangle_vertex_indices Triangle indices corresponding to the given mesh.
Expand Down

0 comments on commit f5d3d3d

Please sign in to comment.