Expand description
Tree acceleration structures for spatial queries on colliders.
To speed up broad phase collision detection and spatial queries,
Avian maintains a ColliderTree structure for all colliders in the physics world. This is implemented as
a Bounding Volume Hierarchy (BVH), which accelerates querying for AABB
overlaps, ray intersections, and more.
Colliders of dynamic, kinematic, and static bodies are all stored in a separate ColliderTree
to allow efficiently querying for specific subsets of colliders and to optimize tree updates based on body type.
Trees for dynamic and kinematic bodies are rebuilt every physics step, while the static tree is incrementally updated
when static colliders are added, removed, or modified. The trees are stored in the ColliderTrees resource.
§Usage
The collider trees are fairly low-level, and not intended to be used directly.
For spatial queries, consider using the higher-level SpatialQuery API instead,
and for broad phase collision detection, consider using the BvhBroadPhasePlugin.
Structs§
- Collider
Tree - A Bounding Volume Hierarchy (BVH) for accelerating queries on a set of colliders.
- Collider
Tree Diagnostics - Diagnostics for collider trees.
- Collider
Tree Optimization - Settings for optimizing each
ColliderTree. - Collider
Tree Plugin - A plugin that manages collider trees for a collider type
C. - Collider
Tree Proxy - A proxy representing a collider in the
ColliderTree. - Collider
Tree Proxy Flags - Flags for a
ColliderTreeProxy. - Collider
Tree Proxy Key - A key for a proxy in a
ColliderTree, encoding both theProxyIdand theColliderTreeType. - Collider
Tree Workspace - A workspace for performing operations on a
ColliderTree. - Collider
Trees - Trees for accelerating queries on a set of colliders.
- Moved
Proxies - A resource for tracking moved proxies.
- ProxyId
- A stable identifier for a proxy in a
ColliderTree.
Enums§
- Collider
Tree Systems - System sets for managing
ColliderTrees. - Collider
Tree Type - The type of a collider tree, corresponding to the rigid body type.
- Tree
Optimization Mode - The optimization mode for a
ColliderTree.
Traits§
- Bvh2Ext
- Extension trait for
obvhs::bvh2::Bvh2to add additional traversal methods.
Functions§
- update_
moved_ collider_ aabbs - Updates the AABBs of colliders that have been manually moved after the previous physics step.