src/spacy

    Dark Mode
Search:
Group by:
  Source   Edit

Types

BruteSpace = ref object
  list*: seq[Entry]
Brute-force space just compares every entry vs every other entry. Supposed to be good for very small number or large ranges.   Source   Edit
Entry = object
  id*: uint32
  pos*: Vec2
  Source   Edit
HashSpace = ref object
  hash*: TableRef[(int32, int32), seq[Entry]]
  resolution*: float
Divides space into little tiles that objects are hashed too. Supposed to be good for very uniform filled space.   Source   Edit
KdNode = ref object
  things*: seq[Entry]
  nodes*: seq[KdNode]
  bounds*: Rect
  level*: int
  Source   Edit
KdSpace = ref object
  root*: KdNode
  maxThings*: int
KD-Tree, each cell is divided vertically or horizontally. Supposed to be good for large amount of entries.   Source   Edit
QuadNode = ref object
  things*: seq[Entry]
  nodes*: seq[QuadNode]
  bounds*: Rect
  level*: int
  Source   Edit
QuadSpace = ref object
  root*: QuadNode
  maxThings*: int
  maxLevels*: int
QuadTree, divide each node down if there is many elements. Supposed to be for large amount of entries.   Source   Edit
SortSpace = ref object
  list*: seq[Entry]
Sort space sorts all entires on one axis X. Supposed to be good for very small ranges.   Source   Edit

Procs

proc clear(bs: BruteSpace) {.inline, ...raises: [], tags: [].}
Clears the spaces and makes it ready to be used again.   Source   Edit
proc clear(hs: HashSpace) {.inline, ...raises: [], tags: [].}
Clears the spaces and makes it ready to be used again.   Source   Edit
proc clear(ks: KdSpace) {.inline, ...raises: [], tags: [].}
Clears the spaces and makes it ready to be used again.   Source   Edit
proc clear(qs: QuadSpace) {.inline, ...raises: [], tags: [].}
Clears the spaces and makes it ready to be used again.   Source   Edit
proc clear(ss: SortSpace) {.inline, ...raises: [], tags: [].}
Clears the spaces and makes it ready to be used again.   Source   Edit
proc finalize(bs: BruteSpace) {.inline, ...raises: [], tags: [].}
Finishes the space and makes it ready for use.   Source   Edit
proc finalize(hs: HashSpace) {.inline, ...raises: [], tags: [].}
Finishes the space and makes it ready for use.   Source   Edit
proc finalize(ks: KdSpace) {....raises: [], tags: [].}
Finishes the space and makes it ready for use.   Source   Edit
proc finalize(qs: QuadSpace) {.inline, ...raises: [], tags: [].}
Finishes the space and makes it ready for use.   Source   Edit
proc finalize(ss: SortSpace) {.inline, ...raises: [], tags: [].}
Finishes the space and makes it ready for use.   Source   Edit
proc insert(bs: BruteSpace; e: Entry) {.inline, ...raises: [], tags: [].}
Adds entry to the space.   Source   Edit
proc insert(hs: HashSpace; e: Entry) {....raises: [KeyError], tags: [].}
Adds entry to the space.   Source   Edit
proc insert(ks: KdSpace; e: Entry) {.inline, ...raises: [], tags: [].}
Adds entry to the space.   Source   Edit
proc insert(qs: QuadSpace; e: Entry) {....raises: [Exception], tags: [RootEffect].}
Adds entry to the space.   Source   Edit
proc insert(qs: QuadSpace; qn: var QuadNode; e: Entry) {....raises: [Exception],
    tags: [RootEffect].}
  Source   Edit
proc insert(ss: SortSpace; e: Entry) {.inline, ...raises: [], tags: [].}
Adds entry to the space.   Source   Edit
proc len(bs: BruteSpace): int {.inline, ...raises: [], tags: [].}
Number of entries inserted   Source   Edit
proc len(hs: HashSpace): int {.inline, ...raises: [], tags: [].}
Number of entries inserted   Source   Edit
proc len(ks: KdSpace): int {....raises: [], tags: [].}
Number of entries inserted.   Source   Edit
proc len(qs: QuadSpace): int {.inline, ...raises: [], tags: [].}
Number of entries inserted.   Source   Edit
proc len(ss: SortSpace): int {.inline, ...raises: [], tags: [].}
Number of entries inserted.   Source   Edit
proc newBruteSpace(): BruteSpace {....raises: [], tags: [].}
Creates a new brute-force space.   Source   Edit
proc newHashSpace(resolution: float): HashSpace {....raises: [], tags: [].}
Creates a hash table space.   Source   Edit
proc newKdSpace(bounds: Rect; maxThings = 10; maxLevels = 10): KdSpace {.
    ...raises: [], tags: [].}
Creates a new space based on kd-tree.   Source   Edit
proc newQuadSpace(bounds: Rect; maxThings = 10; maxLevels = 10): QuadSpace {.
    ...raises: [], tags: [].}
Creates a new quad-tree space.   Source   Edit
proc newSortSpace(): SortSpace {....raises: [], tags: [].}
Creates a new sorted space.   Source   Edit

Iterators

iterator all(bs: BruteSpace): Entry {....raises: [], tags: [].}
Iterates all entries in a space.   Source   Edit
iterator all(hs: HashSpace): Entry {....raises: [], tags: [].}
Iterates all entries in a space.   Source   Edit
iterator all(ks: KdSpace): Entry {....raises: [], tags: [].}
Iterates all entries in a space.   Source   Edit
iterator all(qs: QuadSpace): Entry {....raises: [], tags: [].}
Iterates all entries in a space.   Source   Edit
iterator all(ss: SortSpace): Entry {....raises: [], tags: [].}
Iterates all entries in a space.   Source   Edit
iterator findInRange(bs: BruteSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry.   Source   Edit
iterator findInRange(hs: HashSpace; e: Entry; radius: float): Entry {.
    ...raises: [KeyError], tags: [].}
Iterates all entries in range of an entry.   Source   Edit
iterator findInRange(ks: KdSpace; e: Entry; radius: float): Entry {....raises: [],
    tags: [].}
Iterates all entries in range of an entry.   Source   Edit
iterator findInRange(qs: QuadSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry.   Source   Edit
iterator findInRange(ss: SortSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry.   Source   Edit
iterator findInRangeApprox(bs: BruteSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry but does not cull them. Useful if you need distance anyways and will compute other computations.   Source   Edit
iterator findInRangeApprox(hs: HashSpace; e: Entry; radius: float): Entry {.
    ...raises: [KeyError], tags: [].}
Iterates all entries in range of an entry but does not cull them. Useful if you need distance anyways and will compute other computations.   Source   Edit
iterator findInRangeApprox(ks: KdSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry but does not cull them. Useful if you need distance anyways and will compute other computations.   Source   Edit
iterator findInRangeApprox(qs: QuadSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry but does not cull them. Useful if you need distance anyways and will compute other computations.   Source   Edit
iterator findInRangeApprox(ss: SortSpace; e: Entry; radius: float): Entry {.
    ...raises: [], tags: [].}
Iterates all entries in range of an entry but does not cull them. Useful if you need distance anyways and will compute other computations.   Source   Edit