载入中...
搜索中...
未找到
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)
 创建覆盖 [minX..maxX]×[minY..maxY]×[minZ..maxZ] 的八叉树。
 
 ~Octree ()=default
 
 Octree (const Octree &)=delete
 
Octreeoperator= (const Octree &)=delete
 
void clear ()
 清空全部对象。
 
bool insert (int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 插入一个 AABB 对象;false 表示越界或已存在。
 
bool remove (int id)
 移除 / 更新一个对象。
 
bool update (int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 
bool contains (int id) const
 对象是否存在。
 
int getCount () const
 
int queryPoint (float x, float y, float z)
 查询:点 / AABB / 球体,命中写入结果缓冲区。
 
int queryAABB (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 
int querySphere (float cx, float cy, float cz, float radius)
 
int getResultCount () const
 最近一次查询的结果。
 
int getResultId (int index) const
 
float getMinX () const
 根包围盒与分裂参数。
 
float getMinY () const
 
float getMinZ () const
 
float getMaxX () const
 
float getMaxY () const
 
float getMaxZ () const
 
int getMaxDepth () const
 
int getMaxPerNode () const
 

详细描述

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

在文件 Octree.h16 行定义.

构造及析构函数说明

◆ 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 
)

创建覆盖 [minX..maxX]×[minY..maxY]×[minZ..maxZ] 的八叉树。

在文件 Octree.cpp7 行定义.

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

◆ ~Octree()

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

◆ Octree() [2/2]

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

成员函数说明

◆ clear()

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

清空全部对象。

在文件 Octree.cpp28 行定义.

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

◆ contains()

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

对象是否存在。

在文件 Octree.cpp35 行定义.

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

◆ getCount()

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

在文件 Octree.h35 行定义.

◆ getMaxDepth()

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

在文件 Octree.h53 行定义.

◆ getMaxPerNode()

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

在文件 Octree.h54 行定义.

◆ getMaxX()

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

在文件 Octree.h50 行定义.

引用了 eve::spatial::AABB3::maxX.

◆ getMaxY()

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

在文件 Octree.h51 行定义.

引用了 eve::spatial::AABB3::maxY.

◆ getMaxZ()

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

在文件 Octree.h52 行定义.

引用了 eve::spatial::AABB3::maxZ.

◆ getMinX()

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

根包围盒与分裂参数。

在文件 Octree.h47 行定义.

引用了 eve::spatial::AABB3::minX.

◆ getMinY()

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

在文件 Octree.h48 行定义.

引用了 eve::spatial::AABB3::minY.

◆ getMinZ()

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

在文件 Octree.h49 行定义.

引用了 eve::spatial::AABB3::minZ.

◆ getResultCount()

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

最近一次查询的结果。

在文件 Octree.h43 行定义.

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

◆ getResultId()

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

在文件 Octree.h44 行定义.

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

◆ insert()

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

插入一个 AABB 对象;false 表示越界或已存在。

在文件 Octree.cpp37 行定义.

引用了 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 
)

◆ queryPoint()

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

查询:点 / AABB / 球体,命中写入结果缓冲区。

在文件 Octree.cpp161 行定义.

引用了 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 
)

◆ remove()

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

移除 / 更新一个对象。

在文件 Octree.cpp49 行定义.

引用了 contains().

被这些函数引用 insert().

◆ update()

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

在文件 Octree.cpp56 行定义.

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


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