pub struct BroadPhase {
pub trees: [DynamicTree; 3],
pub moved_proxies: [BitSet; 3],
pub move_array: Vec<i32>,
pub pair_set: HashSet,
}Expand description
The broad-phase is used for computing pairs and performing volume queries and ray casts. It does not persist pairs; it reports potentially new pairs. It is up to the client to consume the new pairs and to track subsequent overlap. (b2BroadPhase)
Fields§
§trees: [DynamicTree; 3]§moved_proxies: [BitSet; 3]Per body-type bit sets indexed by proxyId, marking proxies moved this step. Paired with move_array which preserves deterministic insertion order for pair queries.
move_array: Vec<i32>§pair_set: HashSetTracks shape pairs that have a Contact.
Implementations§
Source§impl BroadPhase
impl BroadPhase
Sourcepub fn new(capacity: &Capacity) -> BroadPhase
pub fn new(capacity: &Capacity) -> BroadPhase
(b2CreateBroadPhase)
Sourcepub fn buffer_move(&mut self, query_proxy: i32)
pub fn buffer_move(&mut self, query_proxy: i32)
This triggers new contact pairs to be created. Must be called in deterministic order. (static inline b2BufferMove)
Sourcepub fn create_proxy(
&mut self,
proxy_type_: BodyType,
aabb: Aabb,
category_bits: u64,
shape_index: i32,
force_pair_creation: bool,
) -> i32
pub fn create_proxy( &mut self, proxy_type_: BodyType, aabb: Aabb, category_bits: u64, shape_index: i32, force_pair_creation: bool, ) -> i32
(b2BroadPhase_CreateProxy)
Sourcepub fn destroy_proxy(&mut self, proxy_key: i32)
pub fn destroy_proxy(&mut self, proxy_key: i32)
(b2BroadPhase_DestroyProxy)
Sourcepub fn move_proxy(&mut self, proxy_key: i32, aabb: Aabb)
pub fn move_proxy(&mut self, proxy_key: i32, aabb: Aabb)
(b2BroadPhase_MoveProxy)
Sourcepub fn enlarge_proxy(&mut self, proxy_key: i32, aabb: Aabb)
pub fn enlarge_proxy(&mut self, proxy_key: i32, aabb: Aabb)
(b2BroadPhase_EnlargeProxy)
Sourcepub fn shape_index(&self, proxy_key: i32) -> i32
pub fn shape_index(&self, proxy_key: i32) -> i32
(b2BroadPhase_GetShapeIndex)
Sourcepub fn test_overlap(&self, proxy_key_a: i32, proxy_key_b: i32) -> bool
pub fn test_overlap(&self, proxy_key_a: i32, proxy_key_b: i32) -> bool
(b2BroadPhase_TestOverlap)
Sourcepub fn validate_no_enlarged(&self)
pub fn validate_no_enlarged(&self)
(b2ValidateNoEnlarged — C compiles the body under B2_ENABLE_VALIDATION; here the check runs in debug builds only)
Sourcepub fn validate_moved_proxies(&self)
pub fn validate_moved_proxies(&self)
(b2ValidateMovedProxies — C compiles the body under B2_ENABLE_VALIDATION; here the whole check runs in debug builds only)