diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-03-23 18:04:57 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-03-23 18:04:57 +0000 |
commit | c6c0d8005880d73b8560bcb10c34a6e8b2da703e (patch) | |
tree | 6e33f8f41154c2731435222856378d2c020893a9 /game | |
parent | Add helper constructors to Arc (diff) | |
download | ilt-c6c0d8005880d73b8560bcb10c34a6e8b2da703e.tar.bz2 ilt-c6c0d8005880d73b8560bcb10c34a6e8b2da703e.tar.xz ilt-c6c0d8005880d73b8560bcb10c34a6e8b2da703e.zip |
Extract vector_normal helper into lib
Diffstat (limited to 'game')
-rw-r--r-- | game/geoData.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp index aaa2548..4273be6 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -417,17 +417,13 @@ GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip) std::vector<Extrusion> extrusionExtents; std::for_each(boundary.begin(), boundary.end(), [this, &extrusionExtents](const auto boundaryHeh) { - const auto vectorNormal = []<typename T, glm::qualifier Q>(const glm::vec<2, T, Q> & v) -> glm::vec<2, T, Q> { - return {-v.y, v.x}; - }; - const auto boundaryVertex = from_vertex_handle(boundaryHeh); const auto nextBoundaryVertex = to_vertex_handle(boundaryHeh); const auto p0 = point(from_vertex_handle(prev_halfedge_handle(boundaryHeh))); const auto p1 = point(boundaryVertex); const auto p2 = point(nextBoundaryVertex); - const auto e0 = glm::normalize(vectorNormal(RelativePosition2D(p1 - p0))); - const auto e1 = glm::normalize(vectorNormal(RelativePosition2D(p2 - p1))); + const auto e0 = glm::normalize(vector_normal(RelativePosition2D(p1 - p0))); + const auto e1 = glm::normalize(vector_normal(RelativePosition2D(p2 - p1))); const auto doExtrusion = [this](VertexHandle & extrusionVertex, Direction2D direction, GlobalPosition3D boundaryVertex, RelativeDistance vert) { |