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 | |
| Octree & | operator= (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() [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.cpp 第 7 行定义.
引用了 eve::spatial::AABB3::depth(), eve::spatial::AABB3::height(), eve::spatial::AABB3::valid() , 以及 eve::spatial::AABB3::width().
◆ ~Octree()
|
default |
◆ Octree() [2/2]
|
delete |
成员函数说明
◆ clear()
| void eve::spatial::Octree::clear | ( | ) |
◆ contains()
| bool eve::spatial::Octree::contains | ( | int | id | ) | const |
◆ getCount()
◆ getMaxDepth()
◆ getMaxPerNode()
◆ getMaxX()
|
inline |
◆ getMaxY()
|
inline |
◆ getMaxZ()
|
inline |
◆ getMinX()
|
inline |
◆ getMinY()
|
inline |
◆ getMinZ()
|
inline |
◆ getResultCount()
|
inline |
◆ getResultId()
|
inline |
◆ insert()
| bool eve::spatial::Octree::insert | ( | int | id, |
| float | minX, | ||
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ | ||
| ) |
插入一个 AABB 对象;false 表示越界或已存在。
在文件 Octree.cpp 第 37 行定义.
引用了 b, contains(), id, eve::spatial::makeAABB3() , 以及 remove().
被这些函数引用 eve::scene::Scene::syncSpatialIndexAt() , 以及 update().
◆ operator=()
◆ queryAABB()
| int eve::spatial::Octree::queryAABB | ( | float | minX, |
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ | ||
| ) |
在文件 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 | ||
| ) |
查询:点 / AABB / 球体,命中写入结果缓冲区。
在文件 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 | ||
| ) |
在文件 Octree.cpp 第 174 行定义.
引用了 eve::spatial::QueryIds::clear(), cx, cy , 以及 eve::spatial::QueryIds::getCount().
◆ remove()
| bool eve::spatial::Octree::remove | ( | int | id | ) |
◆ update()
| bool eve::spatial::Octree::update | ( | int | id, |
| float | minX, | ||
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ | ||
| ) |
在文件 Octree.cpp 第 56 行定义.
引用了 contains() , 以及 insert().
该类的文档由以下文件生成:
- src/modules/spatial/Octree.h
- src/modules/spatial/Octree.cpp