载入中...
搜索中...
未找到
eve::spatial::SpatialHash3D类 参考

Uniform-grid spatial hash for 3D AABB / sphere queries. 更多...

#include <SpatialHash3D.h>

Public 成员函数

 SpatialHash3D (float cellSize=64.f)
 Creates a 3D spatial hash with the given cell size.
 
 ~SpatialHash3D ()=default
 Releases hash buckets.
 
 SpatialHash3D (const SpatialHash3D &)=delete
 
SpatialHash3D & operator= (const SpatialHash3D &)=delete
 
void clear ()
 Removes all stored entries.
 
void setCellSize (float cellSize)
 Sets cell size and clears existing entries.
 
float getCellSize () const
 Current uniform cell size.
 
bool insert (int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 Inserts an item AABB; false if out of bounds or id already present.
 
bool remove (int id)
 Removes an item by id; false if unknown.
 
bool update (int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 Moves an existing item to a new AABB; false if unknown or out of bounds.
 
bool contains (int id) const
 True if the id is currently stored.
 
int getCount () const
 Number of stored ids.
 
int queryPoint (float x, float y, float z)
 Finds items overlapping a point; fills the result buffer.
 
int queryAABB (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 Finds items overlapping an AABB; fills the result buffer.
 
int querySphere (float cx, float cy, float cz, float radius)
 Finds items overlapping a sphere; fills the result buffer.
 
int getResultCount () const
 Number of hits from the last query*.
 
int getResultId (int index) const
 Hit id at dense index from the last query*, or -1.
 

详细描述

Uniform-grid spatial hash for 3D AABB / sphere queries.

在文件 SpatialHash3D.h 第 15 行定义.

构造及析构函数说明

◆ SpatialHash3D() [1/2]

eve::spatial::SpatialHash3D::SpatialHash3D ( float  cellSize = 64.f)
explicit

Creates a 3D spatial hash with the given cell size.

在文件 SpatialHash3D.cpp 第 10 行定义.

引用了 setCellSize().

◆ ~SpatialHash3D()

eve::spatial::SpatialHash3D::~SpatialHash3D ( )
default

Releases hash buckets.

◆ SpatialHash3D() [2/2]

eve::spatial::SpatialHash3D::SpatialHash3D ( const SpatialHash3D &  )
delete

成员函数说明

◆ clear()

void eve::spatial::SpatialHash3D::clear ( )

Removes all stored entries.

在文件 SpatialHash3D.cpp 第 29 行定义.

引用了 eve::spatial::QueryIds::clear().

被这些函数引用 setCellSize().

◆ contains()

bool eve::spatial::SpatialHash3D::contains ( int  id) const

True if the id is currently stored.

在文件 SpatialHash3D.cpp 第 35 行定义.

被这些函数引用 insert() , 以及 update().

◆ getCellSize()

float eve::spatial::SpatialHash3D::getCellSize ( ) const
inline

Current uniform cell size.

在文件 SpatialHash3D.h 第 30 行定义.

◆ getCount()

int eve::spatial::SpatialHash3D::getCount ( ) const
inline

Number of stored ids.

在文件 SpatialHash3D.h 第 41 行定义.

◆ getResultCount()

int eve::spatial::SpatialHash3D::getResultCount ( ) const
inline

Number of hits from the last query*.

在文件 SpatialHash3D.h 第 51 行定义.

◆ getResultId()

int eve::spatial::SpatialHash3D::getResultId ( int  index) const
inline

Hit id at dense index from the last query*, or -1.

在文件 SpatialHash3D.h 第 53 行定义.

引用了 index.

◆ insert()

bool eve::spatial::SpatialHash3D::insert ( int  id,
float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

Inserts an item AABB; false if out of bounds or id already present.

在文件 SpatialHash3D.cpp 第 75 行定义.

引用了 b, contains(), id, eve::spatial::makeAABB3() , 以及 remove().

被这些函数引用 setCellSize() , 以及 update().

◆ operator=()

SpatialHash3D & eve::spatial::SpatialHash3D::operator= ( const SpatialHash3D &  )
delete

◆ queryAABB()

int eve::spatial::SpatialHash3D::queryAABB ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

Finds items overlapping an AABB; fills the result buffer.

返回
Hit count.

在文件 SpatialHash3D.cpp 第 137 行定义.

引用了 eve::spatial::QueryIds::getCount() , 以及 eve::spatial::makeAABB3().

◆ queryPoint()

int eve::spatial::SpatialHash3D::queryPoint ( float  x,
float  y,
float  z 
)

Finds items overlapping a point; fills the result buffer.

返回
Hit count.

在文件 SpatialHash3D.cpp 第 129 行定义.

引用了 cx, cy, eve::spatial::QueryIds::getCount(), x, y , 以及 z.

◆ querySphere()

int eve::spatial::SpatialHash3D::querySphere ( float  cx,
float  cy,
float  cz,
float  radius 
)

Finds items overlapping a sphere; fills the result buffer.

返回
Hit count.

在文件 SpatialHash3D.cpp 第 146 行定义.

引用了 cx, cy, eve::spatial::QueryIds::getCount(), eve::spatial::makeAABB3() , 以及 radius.

◆ remove()

bool eve::spatial::SpatialHash3D::remove ( int  id)

Removes an item by id; false if unknown.

在文件 SpatialHash3D.cpp 第 85 行定义.

被这些函数引用 insert().

◆ setCellSize()

void eve::spatial::SpatialHash3D::setCellSize ( float  cellSize)

Sets cell size and clears existing entries.

在文件 SpatialHash3D.cpp 第 12 行定义.

引用了 clear() , 以及 insert().

被这些函数引用 SpatialHash3D().

◆ update()

bool eve::spatial::SpatialHash3D::update ( int  id,
float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ 
)

Moves an existing item to a new AABB; false if unknown or out of bounds.

在文件 SpatialHash3D.cpp 第 93 行定义.

引用了 contains() , 以及 insert().


该类的文档由以下文件生成: