Liking cljdoc? Tell your friends :D

quadtree-cljc.core


->boundsclj/s

(->bounds x y width height)

Returns a map representing a bounding box

Returns a map representing a bounding box
raw docstring

->quadtreeclj/s

(->quadtree bounds max-objects max-levels level objects nodes)

Returns a map representing a quadtree

Returns a map representing a quadtree
raw docstring

get-quadrantclj/s

(get-quadrant quadtree bounds-obj)

Determine the quadrant bounds-obj belongs to in quadtree

Determine the quadrant `bounds-obj` belongs to in `quadtree`
raw docstring

insertclj/s

(insert quadtree bounds-obj)

Insert bounds-obj into the node, returning a freshly grown quadtree. If the node exceeds the capacity, it will split and add all objects to their corresponding subnodes.

Insert `bounds-obj` into the node, returning a freshly grown quadtree.
If the node exceeds the capacity, it will split and add all objects to
their corresponding subnodes.
raw docstring

insert-allclj/s

(insert-all quadtree bounds-objs)

Takes a quadtree and inserts all bounds objects from the bounds-objs vector.

Takes a `quadtree` and inserts all bounds objects from the
bounds-objs vector.
raw docstring

intersects?clj/s

(intersects? obj-a obj-b)

Takes two object bounds and returns true if they intersect.

Takes two object bounds and returns true if they
intersect. 
raw docstring

point?clj/s

(point? {:keys [x y width height]})

Returns true if this object is a point in space as in it has no width or height

Returns true if this object is a point in space
as in it has no width or height
raw docstring

retrieveclj/s

(retrieve quadtree bounds-obj)

Retrieves a vector of all the bounds objects that could collide with bounds-obj in quadtree.

Retrieves a vector of all the bounds objects that could collide with
`bounds-obj` in `quadtree`.
raw docstring

retrieve-intersectionsclj/s

(retrieve-intersections quadtree bounds-obj)

Returns all a vector of all the objects that collide/intersect with bounds-obj in the quadtree.

Returns all a vector of all the objects that collide/intersect
with `bounds-obj` in the `quadtree`.
raw docstring

retrieve-pointsclj/s

(retrieve-points quadtree bounds-obj)

Returns a vector of all the points that collide/intersect with bounds-obj in the quadtree.

Returns a vector of all the points that collide/intersect
with `bounds-obj` in the `quadtree`.
raw docstring

splitclj/s

(split quadtree)

Splits a quadtree created with ->quadtree into 4 sub-nodes returns quadtree if this quadtree already has four nodes. Returns nil if you passed the wrong type or doesn't have the required keywords.

Splits a `quadtree` created with `->quadtree` into
4 sub-nodes returns `quadtree` if this quadtree already
has four nodes. Returns nil if you passed the wrong type
or doesn't have the required keywords.
raw docstring

total-nodesclj/s

(total-nodes quadtree)

Returns the total number of sub-trees in quadtree. Valid sub-trees have a vector as their value to the parent's :nodes keyword.

Returns the total number of sub-trees in `quadtree`. Valid
sub-trees have a vector as their value to the parent's :nodes
keyword.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close