|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <DynamicAABBTree.hpp>
Public Member Functions | |
| DynamicAABBTree () | |
| ~DynamicAABBTree ()=default | |
| const AABB & | GetFatAABB (int proxyId) const |
| void * | GetUserData (int proxyId) const |
| int | Insert (const AABB &aabb, void *userData) |
| Adds a new proxy with a fattened AABB and returns its id. | |
| bool | MoveProxy (int proxyId, const AABB &newAABB, const Vector3D &displacement) |
| Refits a proxy's fat AABB to newAABB, re-inserting it only if it moved outside the fat margin. | |
| void | Query (const AABB &queryAABB, const std::function< bool(int)> &callback) const |
| Visits every leaf whose fat AABB overlaps queryAABB; stop early by returning false from callback. | |
| void | RayCast (const Vector3D &origin, const Vector3D &direction, float maxDist, const std::function< bool(int)> &callback) const |
| Walks the tree along a ray, visiting candidate leaves within maxDist. | |
| void | Remove (int proxyId) |
| Removes a proxy and rebalances the tree around it. | |
Broadphase AABB tree; PhysicsWorld inserts colliders as proxies and queries overlaps against it.
Definition at line 29 of file DynamicAABBTree.hpp.
| Sleak::Physics::DynamicAABBTree::DynamicAABBTree | ( | ) |
Definition at line 9 of file DynamicAABBTree.cpp.
|
default |
|
inline |
Definition at line 47 of file DynamicAABBTree.hpp.
|
inline |
Definition at line 48 of file DynamicAABBTree.hpp.
| int Sleak::Physics::DynamicAABBTree::Insert | ( | const AABB & | aabb, |
| void * | userData ) |
Adds a new proxy with a fattened AABB and returns its id.
Definition at line 58 of file DynamicAABBTree.cpp.
| bool Sleak::Physics::DynamicAABBTree::MoveProxy | ( | int | proxyId, |
| const AABB & | newAABB, | ||
| const Vector3D & | displacement ) |
Refits a proxy's fat AABB to newAABB, re-inserting it only if it moved outside the fat margin.
Definition at line 73 of file DynamicAABBTree.cpp.
| void Sleak::Physics::DynamicAABBTree::Query | ( | const AABB & | queryAABB, |
| const std::function< bool(int)> & | callback ) const |
Visits every leaf whose fat AABB overlaps queryAABB; stop early by returning false from callback.
Definition at line 327 of file DynamicAABBTree.cpp.
| void Sleak::Physics::DynamicAABBTree::RayCast | ( | const Vector3D & | origin, |
| const Vector3D & | direction, | ||
| float | maxDist, | ||
| const std::function< bool(int)> & | callback ) const |
Walks the tree along a ray, visiting candidate leaves within maxDist.
Definition at line 351 of file DynamicAABBTree.cpp.
| void Sleak::Physics::DynamicAABBTree::Remove | ( | int | proxyId | ) |
Removes a proxy and rebalances the tree around it.
Definition at line 68 of file DynamicAABBTree.cpp.