From 737ff51893174cc5091e48d6dbfc4f194431fbd3 Mon Sep 17 00:00:00 2001 From: EvilSpirit Date: Fri, 24 Jun 2016 13:10:19 +0600 Subject: [PATCH] Skip edges with equal L/R normals when calculating outlines. --- src/mesh.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 36632a2..b03c990 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1040,7 +1040,13 @@ void SKdNode::MakeOutlinesInto(SOutlineList *sol) const if(CheckAndAddTrianglePair(&edgeTris, tr, info.tr)) continue; - sol->AddEdge(a, b, tr->Normal(), info.tr->Normal()); + Vector nl = tr->Normal().WithMagnitude(1.0); + Vector nr = info.tr->Normal().WithMagnitude(1.0); + + // We don't add edges with the same left and right + // normals because they can't produce outlines. + if(nl.Equals(nr)) continue; + sol->AddEdge(a, b, nl, nr); } } }