Uniform Grid

The Uniform Grid class Grid is a subclass of Spatial, and is defined in Grid.h

For simplicity, I put all implementations in Grid.h

The default grid uses a 16x16x16 cell subdivision.

Insert Triangle

It calculates the bounding box of the triangle, and adds the triangle index to all cells covered.

QueryAABB

It just checks every cell covered by the input query box, retrieves its contents (intersections). Collision Detection can be based on this.

Raycast

This is ray intersection testing function. It is based on 3D-DDA

Last updated