# Packages
Package ray holds utilities for performing iterative collision checks or raycasts.
# Functions
Add adds a set of spaces to the rtree.
Attach attaches v to the given space with optional x,y offsets.
CallOnHits will send a signal to the passed in channel when it has completed all collision functions in the hitmap.
Clear resets the default tree's contents.
Detach removes the attachSpaceEnter binding from an entity composed with AttachSpace.
FirstLabel returns the first space that has a label in the input, or nothing.
HitLabel acts like hits, but reutrns the first space within hits that matches one of the input labels.
Hits returns the set of spaces which are colliding with the passed in space.
NewCustomTree returns a new collision Tree with custom node sizes.
NewFullSpace returns a space with both a label and a caller id.
NewLabeledSpace returns a space with an associated integer label.
NewPoint creates a new point.
NewReactiveSpace creates a reactive space on the default collision tree.
NewRect is a wrapper around rtreego.NewRect, casting the given x,y to an rtreego.Point.
NewRect2Space returns a space with an associated caller id from a rect2.
NewRectSpace creates a colliison space with the specified 3D rectangle.
NewSpace returns a space with an associated caller id.
NewTree returns a new collision Tree.
NewUnassignedSpace returns a space that just has a rectangle.
OnIDs converts a function on two CIDs to an OnHit.
PhaseCollision binds to the entity behind the space's CID so that it will receive CollisionStart and CollisionStop events, appropriately when entities begin to collide or stop colliding with the space.
PhaseCollisionWithBus allows for a non-default bus in a phase collision binding.
Remove removes a space from the rtree.
ShiftSpace adds x and y to a space and updates its position in the collision rtree that should not be a package global.
UpdateSpace resets a space's location to a given rect.
With will filter spaces so that only those returning true from the input keepFn will be in the output.
WithLabels will only return spaces with a label in the input.
Without will filter spaces so that no spaces returning true from the input tossFn will be in the output.
WithoutCIDs will return no spaces with a CID in the input.
WithoutLabels will return no spaces with a label in the input.
# Variables
DefaultTree is a collision tree intended to be used by default if no other is instantiated.
ErrNotExist is returned by methods on spaces when the space to update or act on did not exist.
CollisionStart/Stop: when a PhaseCollision entity starts/stops touching some label.
CollisionStart/Stop: when a PhaseCollision entity starts/stops touching some label.
# Structs
An AttachSpace is a composable struct that provides attachment functionality for entities.
A Phase is a struct that other structs who want to use PhaseCollision should be composed of.
A Point is a specific point where collision occurred and a zone to identify what was collided with.
ReactiveSpace is a space that keeps track of a map of collision events.
Rtree represents an R-tree, a balanced search tree for storing and querying Space objects.
A Space is a rectangle with a couple of ways of identifying an underlying object.
A Tree provides a space for managing collisions between rectangles.