use PrismTop in draw order decision
This commit is contained in:
parent
a5083b4eac
commit
7c16de018d
1 changed files with 16 additions and 6 deletions
|
@ -170,11 +170,16 @@ func (p *Prism) DrawAfter(x Drawer) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// The hexagon special
|
// The prism special
|
||||||
if pb.Min.Z+8 <= xb.Min.Z { // x is in front of the front half of p
|
split := p.m.topext[geom.North].X
|
||||||
|
threshold := p.m.topext[geom.East].Y
|
||||||
|
if xb.Min.X > split {
|
||||||
|
threshold = p.m.topext[geom.West].Y
|
||||||
|
}
|
||||||
|
if pb.Min.Z+threshold <= xb.Min.Z { // x is in front of the front half of p
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if pb.Min.Z+8 >= xb.Max.Z { // x is behind the front half of p
|
if pb.Min.Z+threshold >= xb.Max.Z { // x is behind the front half of p
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,11 +213,16 @@ func (p *Prism) DrawBefore(x Drawer) bool {
|
||||||
if pb.Min.Y >= xb.Max.Y { // p is below x
|
if pb.Min.Y >= xb.Max.Y { // p is below x
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// The hexagon special
|
// The prism special
|
||||||
if pb.Min.Z+8 >= xb.Max.Z { // x is behind the front half of p
|
split := p.m.topext[geom.North].X
|
||||||
|
threshold := p.m.topext[geom.East].Y
|
||||||
|
if xb.Min.X > split {
|
||||||
|
threshold = p.m.topext[geom.West].Y
|
||||||
|
}
|
||||||
|
if pb.Min.Z+threshold >= xb.Max.Z { // x is behind the front half of p
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if pb.Min.Z+8 <= xb.Min.Z { // x is in front of the front half of p
|
if pb.Min.Z+threshold <= xb.Min.Z { // x is in front of the front half of p
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case zpositioner:
|
case zpositioner:
|
||||||
|
|
Loading…
Reference in a new issue