Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::GeoSpatialHash

The 3D hash table.

Classes

NameDescription
Geo::GeoSpatialHash::GridCellBlock

The grid index box.

Variables

NameDescription
Geo::s32 m_Capacity

The capacity of the grid.

Geo::s32 * m_CellOffsets

This is the number of items in each cell.

Geo::GeoArray< GeoSpatialHashEntry > m_CellRefs

This is of size n, where n is the number of items.

Geo::v128 m_CellSize

The size of each cell. Divide by this to convert to voxel space.

Geo::s32 m_GridCells[3]

The grid discrete size.

Geo::v128 m_GridExtents

The grid extents.

Geo::v128 m_GridOffset

The grid offset. Add something this to a vector to get it into grid space.

Geo::s32 m_NumCells

This the number of cells.

bool m_Sorted

Has this been prepared?

Functions

NameDescription
~GeoSpatialHash()

Destructor.

AddInBounds(const Geo::GeoBoundingBox &, Geo::s32)

Add an object to an extent.

GeoSpatialHash(const Geo::GeoBoundingBox &, Geo::u32, Geo::u32, Geo::u32, Geo::u32)

Constructor. CellCount is how many cells along each axis there should be.

GetBaseKey(Geo::u32, Geo::u32, Geo::u32)

Get the base key.

GetGridCellBlock(const Geo::GeoBoundingBox &, GridCellBlock &)

Convert a bbox to GridIndexBox.

GetInExtent(const Geo::GeoBoundingBox &, Geo::GeoArray< Geo::s32 > &)

Get the list of objects inside a given bounding box.

GetObjectsInCell(Geo::u32, Geo::GeoArray< Geo::s32 > &)

Get all the objects inside a given cell.

PrepareMap()

Once you've added all the vertices, call this.

QSortComparison(const void *, const void *)

Function used by qsort to compare map entries.

TransformPoint(const Geo::v128 &)

Transform a point into our voxel space.


Anchor
a603e3f9543f953efca2613f8cfbf635e
a603e3f9543f953efca2613f8cfbf635e

Geo::GeoSpatialHash::~GeoSpatialHash

...

public: ~GeoSpatialHash()

...

Destructor.


Anchor
a93a6801749d90a85e139108c1a195c67
a93a6801749d90a85e139108c1a195c67

bool Geo::GeoSpatialHash::AddInBounds

...

public: bool AddInBounds
(
    const Geo::GeoBoundingBox & bbox,
    Geo::s32 vertex
)

...

Add an object to an extent.


Anchor
a4a8983eec3f55042c3f051df1040f524
a4a8983eec3f55042c3f051df1040f524

Geo::GeoSpatialHash::GeoSpatialHash

...

public: GeoSpatialHash
(
    const Geo::GeoBoundingBox & extents,
    Geo::u32 numEntries,
    Geo::u32 xCells,
    Geo::u32 yCells,
    Geo::u32 zCells
)

...

Constructor. CellCount is how many cells along each axis there should be.


Anchor
a4e0664de46c2edadc1f72f603aa4adf0
a4e0664de46c2edadc1f72f603aa4adf0

Geo::u32 Geo::GeoSpatialHash::GetBaseKey

...

protected: Geo::u32 GetBaseKey
(
    Geo::u32 x,
    Geo::u32 y,
    Geo::u32 z
) const

...

Get the base key.


Anchor
a0dcef23b43f13a4a9f63b1955b330272
a0dcef23b43f13a4a9f63b1955b330272

void Geo::GeoSpatialHash::GetGridCellBlock

...

protected: void GetGridCellBlock
(
    const Geo::GeoBoundingBox & bbox,
    GridCellBlock & grid
) const

...

Convert a bbox to GridIndexBox.


Anchor
a66b26a64e8d3bf9b5545d68971ecd31e
a66b26a64e8d3bf9b5545d68971ecd31e

bool Geo::GeoSpatialHash::GetInExtent

...

public: bool GetInExtent
(
    const Geo::GeoBoundingBox & bbox,
    Geo::GeoArray< Geo::s32 > & vertexIDList
) const

...

Get the list of objects inside a given bounding box.


Anchor
aacecb131beb170a62711795079e82a6f
aacecb131beb170a62711795079e82a6f

void Geo::GeoSpatialHash::GetObjectsInCell

...

protected: void GetObjectsInCell
(
    Geo::u32 key,
    Geo::GeoArray< Geo::s32 > & list
) const

...

Get all the objects inside a given cell.


Anchor
ae385c0cc3bfc242b3c5299a882b0f54d
ae385c0cc3bfc242b3c5299a882b0f54d

void Geo::GeoSpatialHash::PrepareMap

...

public: void PrepareMap()

...

Once you've added all the vertices, call this.


Anchor
abea29c9f8f64d19dc84b9f40594820ec
abea29c9f8f64d19dc84b9f40594820ec

static Geo::s32 Geo::GeoSpatialHash::QSortComparison

...

protected: Geo::s32 QSortComparison
(
    const void * arg1,
    const void * arg2
)

...

Function used by qsort to compare map entries.


Anchor
af4d9c4b36c8c55412ea9083b620ab2e1
af4d9c4b36c8c55412ea9083b620ab2e1

Geo::v128 Geo::GeoSpatialHash::TransformPoint

...

protected: Geo::v128 TransformPoint
(
    const Geo::v128 & point
) const

...

Transform a point into our voxel space.