From c6c0d8005880d73b8560bcb10c34a6e8b2da703e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 23 Mar 2024 18:04:57 +0000 Subject: Extract vector_normal helper into lib --- game/geoData.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'game/geoData.cpp') 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 triangleStrip) std::vector extrusionExtents; std::for_each(boundary.begin(), boundary.end(), [this, &extrusionExtents](const auto boundaryHeh) { - const auto vectorNormal = [](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) { -- cgit v1.2.3