Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Provides a Grid object with user defined physical dimensions (in any unit you want) and a fixed number of columns and rows. Whithin each cell, you can store a single generic struct.

For instance, it can be used as a very simple space partitioning system if you give it "Vec<T>" as the cell type. Or it can be used as a tilemap if you just give it integer indices or something like "Option<u8>".

Once the grid is populated, you can use several methods to obtain a single cell at specified physical coordinates, at a specific column and row, or you can even iterate all the cells that overlap a given rectangle.

This last one is particularly useful to only iterate the cells that are visible to a camera, or that overlap a collider, dramatically speeding up things when compared against a flat storage system, although still generally not as fast as a QuadTree system. But It can be preferred over a quadtree if you need regularly spaced cells, like in a tilemap.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages