Module collider_tree

Module collider_tree 

Source
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§

ColliderTree
A Bounding Volume Hierarchy (BVH) for accelerating queries on a set of colliders.
ColliderTreeDiagnostics
Diagnostics for collider trees.
ColliderTreeOptimization
Settings for optimizing each ColliderTree.
ColliderTreePlugin
A plugin that manages collider trees for a collider type C.
ColliderTreeProxy
A proxy representing a collider in the ColliderTree.
ColliderTreeProxyFlags
Flags for a ColliderTreeProxy.
ColliderTreeProxyKey
A key for a proxy in a ColliderTree, encoding both the ProxyId and the ColliderTreeType.
ColliderTreeWorkspace
A workspace for performing operations on a ColliderTree.
ColliderTrees
Trees for accelerating queries on a set of colliders.
MovedProxies
A resource for tracking moved proxies.
ProxyId
A stable identifier for a proxy in a ColliderTree.

Enums§

ColliderTreeSystems
System sets for managing ColliderTrees.
ColliderTreeType
The type of a collider tree, corresponding to the rigid body type.
TreeOptimizationMode
The optimization mode for a ColliderTree.

Traits§

Bvh2Ext
Extension trait for obvhs::bvh2::Bvh2 to add additional traversal methods.

Functions§

update_moved_collider_aabbs
Updates the AABBs of colliders that have been manually moved after the previous physics step.