CollisionDetection.boxesoverlapMethod

Predicate used for iteration over an Octree. Returns true if two boxes specified by their centers and halfsizes overlap. More carefull investigation of the objects within is required to assess collision. False positives are possible.

boxesoverlap(c1, hs1, c2, hs2)
CollisionDetection.childsectorMethod
childsector(point, center) -> sector

Computes the sector w.r.t. center that contains point. Sector is an Int that encodes the position of point along each axis in its bit representation

CollisionDetection.findMethod
find(octree, pos, tolerance=sqrt(eps(eltype(pos))))

Return an array containing the indices of values at pos (up to a tolerance)

CollisionDetection.fitsinboxMethod
fitsinbox(pos, radius, center, halfsize) -> true/fasle

Finds out if the object with position (pos) and (raduis) fits inside the box. It uses the box dimension (centre, and halfsize(w/2)) to do the comparsion

CollisionDetection.fitsinboxMethod

itsinbox(Opjc, Objrad, boxc, boxhf, ratio) -> true/fasle

Finds out if the object with center position (Opjc) and (Objrad) fits inside the box. It uses the box dimension (boxc, and boxhf(w/2)) to do the comparsion ratio is relative to box half width, so if you want to be just within the box then ratio =1, if the boundaries of the object is slightly bigger and you still want to include them make ratio bigger ex:1.2

CollisionDetection.insert!Method

insert!(tree, box, center, halfsize, point, radius, id)

tree: the tree in which to insert box: the box in which to try insertion center: center of the box halfsize: 0.5 times the length of the box side point: the point at which to insert radius: the radius of the item to insert id: a unique id that identifies the inserted item uniquely

CollisionDetection.searchtreeMethod
searchtree(pred, tree, bb)

Return an iterator that returns indices stores in tree that correspond to objects for which the supplied predicate holds.

pred takes an integer an returns true is the corresponding object stores in tree collides with the target object. bb is a bounding box containing the target. This bounding box is used for effiently excluding entire branches of the tree.