Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # no explicit storage of information
- # tree structure implicitly stores information
- VoxelNode* = object
- case kind*: NodeKind
- of leaf:
- nil
- of node:
- children*: array[8, ref VoxelNode]
- proc hash(x: VoxelNode): THash =
- var h: THash = 0
- case x.kind:
- of leaf:
- h = h !& 1
- of node:
- # hash each child node
- for idx in x.children:
- h = h !& hash(child)
- result = !$h
- lib/system.nim(1825, 2) Error: parallel 'fields' iterator does not work for 'case' objects
Advertisement
Add Comment
Please, Sign In to add comment