Create a SpatialHashGrid
object using a fixed sized grid.
The min/max the grid will operate on. I.e. if the world goes from -1000, -1000
to 1000, 1000
, then this should be [-1000, -1000], [1000, 1000]
.
How many cells along each dimensional axis. I.e. if the world is 100 units wide and we have 5 cells, then each cell will span 100/5=20 units
.
Readonly
clientsClients in the grid.
Readonly
groupAdd the group to the scene if you want to display debug information.
Add a Model3D
to the spatial has grid.
Private
calculatePrivate
debugCreate a THREE.GridHelper | GridHelper to display the grid.
The min/max the grid will operate on. I.e. if the world goes from -1000, -1000
to 1000, 1000
, then this should be [-1000, -1000], [1000, 1000]
.
Protected
findProtected
newProtected
removeRemove client from the grid.
Update client.
Generated using TypeDoc
A spatial hash is a 2 or 3 dimensional extension of the hash table. The basic idea of a hash table is that you take a piece of data (the 'key'), run it through some function (the 'hash function') to produce a new value (the 'hash'), and then use the hash as an index into a set of slots ('cells').
Author
André Wisén
Copyright
MIT