Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Last active April 7, 2017 02:29
Show Gist options
  • Save dustinlacewell/5bd54110f611b93f387a5f1aaf53558a to your computer and use it in GitHub Desktop.
Save dustinlacewell/5bd54110f611b93f387a5f1aaf53558a to your computer and use it in GitHub Desktop.
type
NodeKind = enum
HSplit, VSplit, Leaf
BSPNode[T] = ref object
parent: BSPNode
case kind: NodeKind
of HSplit:
hPos: float
left: BSPNode
right: BSPNode
of VSplit:
vPos: float
top: BSPNode
bottom: BSP
of Leaf
content: T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment