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() [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()
|
default |
Releases tree nodes.
◆ Octree() [2/2]
|
delete |
成员函数说明
◆ clear()
| void eve::spatial::Octree::clear | ( | ) |
◆ contains()
| bool eve::spatial::Octree::contains | ( | int | id | ) | const |
True if the id is currently stored.
在文件 Octree.cpp 第 35 行定义.
◆ getCount()
◆ getMaxDepth()
|
inline |
◆ getMaxPerNode()
|
inline |
◆ getMaxX()
◆ getMaxY()
◆ getMaxZ()
◆ getMinX()
◆ getMinY()
◆ getMinZ()
◆ getResultCount()
|
inline |
◆ getResultId()
|
inline |
◆ 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=()
◆ 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 | ) |
◆ 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().
该类的文档由以下文件生成:
- src/modules/spatial/Octree.h
- src/modules/spatial/Octree.cpp