Documentation
¶
Overview ¶
Package plane defines 2D spaces (cartesian and torus) plus plane-aware boxes and metrics. It wraps geometry primitives with boundary-aware behaviours, handling clamping/wrapping, fragmentation across edges, translations, and distance calculations reused by higher-level modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AABB ¶
AABB is a box kept canonical within a Space: its corners, its size, and its Overhang — how far it runs past the world's far edges, from which its wrapped pieces follow.
func (*AABB) DeepestOverlapWith ¶
DeepestOverlapWith is the deepest overlap of ab and other, wrapped images included, if any.
func (*AABB) VisitFragments ¶
func (ab *AABB) VisitFragments(fn FragVisitor)
VisitFragments calls fn for each piece the box wraps into, until fn returns false.
type FragPosition ¶
type FragPosition int
FragPosition names a wrapped piece of a box by the edge of the parent it lies past.
const ( FRAG_MAIN FragPosition = iota // FRAG_RIGHT is the fragment that spans the parent's right edge. FRAG_RIGHT // FRAG_BOTTOM is the fragment along the parent's bottom edge. FRAG_BOTTOM // FRAG_BOTTOM_RIGHT is the fragment covering the parent's bottom-right quadrant. FRAG_BOTTOM_RIGHT )
type FragVisitor ¶
type FragVisitor func(pos FragPosition, box geom.AABB) bool
FragVisitor is handed each wrapped piece of a box and says whether to go on to the next.