An octree storing entities.
More...
#include <entityoctree.h>
|
| EntityOctree (Entity &entity, float x, float y, float z) |
| Constructor; for more functionality use EntityOctreeContainer. More...
|
|
| EntityOctree (EntityOctree &subtree, float x, float y, float z) |
| Constructor; for more functionality use EntityOctreeContainer. More...
|
|
bool | insert (Entity &entity, float &x) |
| Insert an entity into this octree. More...
|
|
void | knnSearch (Entity **found, float *distances, unsigned char k, Entity &to, float &xP) |
| This method inserts all entities in the tree into the given list of neighbours. More...
|
|
An octree storing entities.
EntityOctree::EntityOctree |
( |
Entity & |
entity, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Constructor; for more functionality use EntityOctreeContainer.
- Parameters
-
entity | The entity that the octree shall contain; do not modify or delete the entity after it has been passed. |
x | The x coordinate of the subtree center. |
y | The y coordinate of the subtree center. |
z | The z coordinate of the subtree center. |
EntityOctree::EntityOctree |
( |
EntityOctree & |
subtree, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Constructor; for more functionality use EntityOctreeContainer.
- Parameters
-
subtree | |
x | The x coordinate of the subtree center. |
y | The y coordinate of the subtree center. |
z | The z coordinate of the subtree center. |
bool EntityOctree::insert |
( |
Entity & |
entity, |
|
|
float & |
x |
|
) |
| |
Insert an entity into this octree.
Do not modify or delete the entity after it has been passed.
- Parameters
-
entity | The entity to insert. |
x | The x coordinate of the center of the parent element. |
void EntityOctree::knnSearch |
( |
Entity ** |
found, |
|
|
float * |
distances, |
|
|
unsigned char |
k, |
|
|
Entity & |
to, |
|
|
float & |
xP |
|
) |
| |
This method inserts all entities in the tree into the given list of neighbours.
- Parameters
-
found | A list of pointers to the k nearest entities. The entities are stored in increasing distance to the reference entity. Empty slots (nullpointer) are sorted to the end of the list. |
distances | A list of the distances between each entry of the neighbour list and the reference entity. Empty slots in the neighbour list are at distance infinity. |
k | The length of the neighbour list - 1. |
to | The reference point. |
xP | The x coordinate of the center of the parent element. |
The documentation for this class was generated from the following files: