Skip edges with equal L/R normals when calculating outlines.

This commit is contained in:
EvilSpirit 2016-06-24 13:10:19 +06:00 committed by whitequark
parent 5a2eb9fb50
commit 737ff51893

View File

@ -1040,7 +1040,13 @@ void SKdNode::MakeOutlinesInto(SOutlineList *sol) const
if(CheckAndAddTrianglePair(&edgeTris, tr, info.tr)) if(CheckAndAddTrianglePair(&edgeTris, tr, info.tr))
continue; 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);
} }
} }
} }