Don't let the PubSub internal offsets overflow + fix some warnings.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::data::pubsub::PubSubCursor;
|
||||
use crate::data::pubsub::Subscription;
|
||||
use crate::dynamics::RigidBodySet;
|
||||
use crate::geometry::{Collider, ColliderHandle, ColliderSet, RemovedCollider};
|
||||
use crate::geometry::{ColliderHandle, ColliderSet, RemovedCollider};
|
||||
use crate::math::{Point, Vector, DIM};
|
||||
#[cfg(feature = "enhanced-determinism")]
|
||||
use crate::utils::FxHashMap32 as HashMap;
|
||||
@@ -417,7 +417,7 @@ impl SAPRegion {
|
||||
pub struct BroadPhase {
|
||||
proxies: Proxies,
|
||||
regions: HashMap<Point<i32>, SAPRegion>,
|
||||
removed_colliders: Option<PubSubCursor<RemovedCollider>>,
|
||||
removed_colliders: Option<Subscription<RemovedCollider>>,
|
||||
deleted_any: bool,
|
||||
// We could think serializing this workspace is useless.
|
||||
// It turns out is is important to serialize at least its capacity
|
||||
|
||||
@@ -83,7 +83,7 @@ impl ColliderSet {
|
||||
/*
|
||||
* Delete the collider from its parent body.
|
||||
*/
|
||||
if let Some(mut parent) = bodies.get_mut_internal(collider.parent) {
|
||||
if let Some(parent) = bodies.get_mut_internal(collider.parent) {
|
||||
parent.remove_collider_internal(handle, &collider);
|
||||
bodies.wake_up(collider.parent, true);
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ use crate::geometry::proximity_detector::{
|
||||
// proximity_detector::ProximityDetectionContextSimd, WBall,
|
||||
//};
|
||||
use crate::geometry::{
|
||||
BroadPhasePairEvent, Collider, ColliderGraphIndex, ColliderHandle, ContactEvent,
|
||||
ProximityEvent, ProximityPair, RemovedCollider,
|
||||
BroadPhasePairEvent, ColliderGraphIndex, ColliderHandle, ContactEvent, ProximityEvent,
|
||||
ProximityPair, RemovedCollider,
|
||||
};
|
||||
use crate::geometry::{ColliderSet, ContactManifold, ContactPair, InteractionGraph};
|
||||
//#[cfg(feature = "simd-is-enabled")]
|
||||
//use crate::math::{SimdFloat, SIMD_WIDTH};
|
||||
use crate::data::pubsub::PubSubCursor;
|
||||
use crate::data::pubsub::Subscription;
|
||||
use crate::ncollide::query::Proximity;
|
||||
use crate::pipeline::EventHandler;
|
||||
use std::collections::HashMap;
|
||||
@@ -31,7 +31,7 @@ use std::collections::HashMap;
|
||||
pub struct NarrowPhase {
|
||||
contact_graph: InteractionGraph<ContactPair>,
|
||||
proximity_graph: InteractionGraph<ProximityPair>,
|
||||
removed_colliders: Option<PubSubCursor<RemovedCollider>>,
|
||||
removed_colliders: Option<Subscription<RemovedCollider>>,
|
||||
// ball_ball: Vec<usize>, // Workspace: Vec<*mut ContactPair>,
|
||||
// shape_shape: Vec<usize>, // Workspace: Vec<*mut ContactPair>,
|
||||
// ball_ball_prox: Vec<usize>, // Workspace: Vec<*mut ProximityPair>,
|
||||
|
||||
@@ -93,10 +93,6 @@ impl<'de> serde::Deserialize<'de> for WAABB {
|
||||
}
|
||||
|
||||
impl WAABB {
|
||||
pub fn new(mins: Point<SimdFloat>, maxs: Point<SimdFloat>) -> Self {
|
||||
Self { mins, maxs }
|
||||
}
|
||||
|
||||
pub fn new_invalid() -> Self {
|
||||
Self::splat(AABB::new_invalid())
|
||||
}
|
||||
@@ -132,7 +128,7 @@ impl WAABB {
|
||||
for i in 0usize..DIM {
|
||||
let is_not_zero = ray.dir[i].simd_ne(_0);
|
||||
let is_zero_test =
|
||||
(ray.origin[i].simd_ge(self.mins[i]) & ray.origin[i].simd_le(self.maxs[i]));
|
||||
ray.origin[i].simd_ge(self.mins[i]) & ray.origin[i].simd_le(self.maxs[i]);
|
||||
let is_not_zero_test = {
|
||||
let denom = _1 / ray.dir[i];
|
||||
let mut inter_with_near_plane =
|
||||
|
||||
@@ -379,11 +379,13 @@ impl<T: IndexedData> WQuadtree<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
struct WQuadtreeIncrementalBuilderStep {
|
||||
range: Range<usize>,
|
||||
parent: NodeIndex,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
struct WQuadtreeIncrementalBuilder<T> {
|
||||
quadtree: WQuadtree<T>,
|
||||
to_insert: Vec<WQuadtreeIncrementalBuilderStep>,
|
||||
@@ -391,6 +393,7 @@ struct WQuadtreeIncrementalBuilder<T> {
|
||||
indices: Vec<usize>,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl<T: IndexedData> WQuadtreeIncrementalBuilder<T> {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user