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

Region octree for 3D AABB broad-phase / scene culling. Same storage rules as QuadTree (smallest fully-containing node). 更多...

#include <Octree.h>

Public 成员函数

 Octree (float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int maxDepth=8, int maxPerNode=8)
 Creates an octree covering the given 3D bounds.
 
 ~Octree ()=default
 Releases tree nodes.
 
 Octree (const Octree &)=delete
 
Octree & operator= (const Octree &)=delete
 
void clear ()
 Removes all stored entries.
 
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.
 
float getMinX () const
 Root/world minimum X.
 
float getMinY () const
 Root/world minimum Y.
 
float getMinZ () const
 Root/world minimum Z.
 
float getMaxX () const
 Root/world maximum X.
 
float getMaxY () const
 Root/world maximum Y.
 
float getMaxZ () const
 Root/world maximum Z.
 
int getMaxDepth () const
 Maximum subdivision depth.
 
int getMaxPerNode () const
 Item capacity before a node splits.
 

详细描述

Region octree for 3D AABB broad-phase / scene culling. Same storage rules as QuadTree (smallest fully-containing node).

在文件 Octree.h 第 18 行定义.

构造及析构函数说明

◆ Octree() [1/2]

eve::spatial::Octree::Octree ( float  minX,
float  minY,
float  minZ,
float  maxX,
float  maxY,
float  maxZ,
int  maxDepth = 8,
int  maxPerNode = 8 
)

Creates an octree covering the given 3D bounds.

在文件 Octree.cpp 第 7 行定义.

引用了 eve::spatial::AABB3::depth(), eve::spatial::AABB3::height(), eve::spatial::AABB3::valid() , 以及 eve::spatial::AABB3::width().

◆ ~Octree()

eve::spatial::Octree::~Octree ( )
default

Releases tree nodes.

◆ Octree() [2/2]

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

成员函数说明

◆ clear()

void eve::spatial::Octree::clear ( )

Removes all stored entries.

在文件 Octree.cpp 第 28 行定义.

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

◆ contains()

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

True if the id is currently stored.

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

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

◆ getCount()

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

Number of stored ids.

在文件 Octree.h 第 40 行定义.

◆ getMaxDepth()

int eve::spatial::Octree::getMaxDepth ( ) const
inline

Maximum subdivision depth.

在文件 Octree.h 第 67 行定义.

◆ getMaxPerNode()

int eve::spatial::Octree::getMaxPerNode ( ) const
inline

Item capacity before a node splits.

在文件 Octree.h 第 69 行定义.

◆ getMaxX()

float eve::spatial::Octree::getMaxX ( ) const
inline

Root/world maximum X.

在文件 Octree.h 第 61 行定义.

◆ getMaxY()

float eve::spatial::Octree::getMaxY ( ) const
inline

Root/world maximum Y.

在文件 Octree.h 第 63 行定义.

◆ getMaxZ()

float eve::spatial::Octree::getMaxZ ( ) const
inline

Root/world maximum Z.

在文件 Octree.h 第 65 行定义.

◆ getMinX()

float eve::spatial::Octree::getMinX ( ) const
inline

Root/world minimum X.

在文件 Octree.h 第 55 行定义.

◆ getMinY()

float eve::spatial::Octree::getMinY ( ) const
inline

Root/world minimum Y.

在文件 Octree.h 第 57 行定义.

◆ getMinZ()

float eve::spatial::Octree::getMinZ ( ) const
inline

Root/world minimum Z.

在文件 Octree.h 第 59 行定义.

◆ getResultCount()

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

Number of hits from the last query*.

在文件 Octree.h 第 50 行定义.

◆ getResultId()

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

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

在文件 Octree.h 第 52 行定义.

引用了 index.

◆ insert()

bool eve::spatial::Octree::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.

在文件 Octree.cpp 第 37 行定义.

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

被这些函数引用 eve::scene::Scene::syncSpatialIndexAt() , 以及 update().

◆ operator=()

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

◆ queryAABB()

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

Finds items overlapping an AABB; fills the result buffer.

返回
Hit count.

在文件 Octree.cpp 第 167 行定义.

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

◆ queryPoint()

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

Finds items overlapping a point; fills the result buffer.

返回
Hit count.

在文件 Octree.cpp 第 161 行定义.

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

◆ querySphere()

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

Finds items overlapping a sphere; fills the result buffer.

返回
Hit count.

在文件 Octree.cpp 第 174 行定义.

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

◆ remove()

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

Removes an item by id; false if unknown.

在文件 Octree.cpp 第 49 行定义.

引用了 contains().

被这些函数引用 insert().

◆ update()

bool eve::spatial::Octree::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.

在文件 Octree.cpp 第 56 行定义.

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


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