Factor in SOutlineList::FillOutlineTags.
parent
20d87d93c5
commit
e2916e3e4a
|
@ -481,9 +481,8 @@ void ssglDrawOutlines(SOutlineList *sol, Vector projDir, hStyle hs)
|
||||||
ssglLineWidth((float)lineWidth);
|
ssglLineWidth((float)lineWidth);
|
||||||
ssglColorRGB(Style::Color(hs));
|
ssglColorRGB(Style::Color(hs));
|
||||||
|
|
||||||
sol->FillOutlineTags(projDir);
|
|
||||||
for(SOutline *so = sol->l.First(); so; so = sol->l.NextAfter(so)) {
|
for(SOutline *so = sol->l.First(); so; so = sol->l.NextAfter(so)) {
|
||||||
if(!so->tag) continue;
|
if(!so->IsVisible(projDir)) continue;
|
||||||
ssglStippledLine(so->a, so->b, lineWidth, stippleType, stippleScale,
|
ssglStippledLine(so->a, so->b, lineWidth, stippleType, stippleScale,
|
||||||
/*maybeFat=*/true);
|
/*maybeFat=*/true);
|
||||||
}
|
}
|
||||||
|
|
10
src/mesh.cpp
10
src/mesh.cpp
|
@ -1047,6 +1047,10 @@ void SKdNode::MakeOutlinesInto(SOutlineList *sol) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SOutline::IsVisible(Vector projDir) const {
|
||||||
|
return (nl.Dot(projDir) > 0.0) != (nr.Dot(projDir) > 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
void SOutlineList::Clear() {
|
void SOutlineList::Clear() {
|
||||||
l.Clear();
|
l.Clear();
|
||||||
}
|
}
|
||||||
|
@ -1060,12 +1064,6 @@ void SOutlineList::AddEdge(Vector a, Vector b, Vector nl, Vector nr) {
|
||||||
l.Add(&so);
|
l.Add(&so);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SOutlineList::FillOutlineTags(Vector projDir) {
|
|
||||||
for(SOutline *so = l.First(); so; so = l.NextAfter(so)) {
|
|
||||||
so->tag = ((so->nl.Dot(projDir) > 0.0) != (so->nr.Dot(projDir) > 0.0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SOutlineList::MakeFromCopyOf(SOutlineList *sol) {
|
void SOutlineList::MakeFromCopyOf(SOutlineList *sol) {
|
||||||
for(SOutline *so = sol->l.First(); so; so = sol->l.NextAfter(so)) {
|
for(SOutline *so = sol->l.First(); so; so = sol->l.NextAfter(so)) {
|
||||||
l.Add(so);
|
l.Add(so);
|
||||||
|
|
|
@ -274,6 +274,8 @@ class SOutline {
|
||||||
public:
|
public:
|
||||||
int tag;
|
int tag;
|
||||||
Vector a, b, nl, nr;
|
Vector a, b, nl, nr;
|
||||||
|
|
||||||
|
bool IsVisible(Vector projDir) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SOutlineList {
|
class SOutlineList {
|
||||||
|
@ -284,8 +286,6 @@ public:
|
||||||
void AddEdge(Vector a, Vector b, Vector nl, Vector nr);
|
void AddEdge(Vector a, Vector b, Vector nl, Vector nr);
|
||||||
|
|
||||||
void MakeFromCopyOf(SOutlineList *ol);
|
void MakeFromCopyOf(SOutlineList *ol);
|
||||||
|
|
||||||
void FillOutlineTags(Vector projDir);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class SKdNode {
|
class SKdNode {
|
||||||
|
|
Loading…
Reference in New Issue