aboutsummaryrefslogtreecommitdiff
path: root/src/pipeline
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-10-30 17:23:49 +0100
committerGitHub <noreply@github.com>2022-10-30 17:23:49 +0100
commit6b9762694673d42671d58d9e2178b9c94fc39053 (patch)
tree12bd8ca98467a5f1113670c1bc17ed20f2e69c80 /src/pipeline
parent2bf61c3bae542e2f17e7d25f602090bb3c117dbf (diff)
parent34b7ae32fd03803048b920c1429e026e06bff948 (diff)
downloadrapier-6b9762694673d42671d58d9e2178b9c94fc39053.tar.gz
rapier-6b9762694673d42671d58d9e2178b9c94fc39053.tar.bz2
rapier-6b9762694673d42671d58d9e2178b9c94fc39053.zip
Merge pull request #410 from dimforge/parry_up
Update to parry 0.11
Diffstat (limited to 'src/pipeline')
-rw-r--r--src/pipeline/debug_render_pipeline/debug_render_pipeline.rs2
-rw-r--r--src/pipeline/debug_render_pipeline/debug_render_style.rs2
-rw-r--r--src/pipeline/query_pipeline.rs20
3 files changed, 13 insertions, 11 deletions
diff --git a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
index fd93d6c..bb9fd78 100644
--- a/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
+++ b/src/pipeline/debug_render_pipeline/debug_render_pipeline.rs
@@ -30,7 +30,7 @@ bitflags::bitflags! {
const SOLVER_CONTACTS = 1 << 4;
/// If this flag is set, the geometric contacts will be rendered.
const CONTACTS = 1 << 5;
- /// If this flag is set, the AABBs of colliders will be rendered.
+ /// If this flag is set, the Aabbs of colliders will be rendered.
const COLLIDER_AABBS = 1 << 6;
}
}
diff --git a/src/pipeline/debug_render_pipeline/debug_render_style.rs b/src/pipeline/debug_render_pipeline/debug_render_style.rs
index 987d95d..33630aa 100644
--- a/src/pipeline/debug_render_pipeline/debug_render_style.rs
+++ b/src/pipeline/debug_render_pipeline/debug_render_style.rs
@@ -44,7 +44,7 @@ pub struct DebugRenderStyle {
pub contact_normal_color: DebugColor,
/// The length of the contact normals.
pub contact_normal_length: Real,
- /// The color of the colliders AABBs.
+ /// The color of the colliders Aabbs.
pub collider_aabb_color: DebugColor,
}
diff --git a/src/pipeline/query_pipeline.rs b/src/pipeline/query_pipeline.rs
index e2ea05f..00825e2 100644
--- a/src/pipeline/query_pipeline.rs
+++ b/src/pipeline/query_pipeline.rs
@@ -1,10 +1,10 @@
use crate::dynamics::{IslandManager, RigidBodyHandle};
use crate::geometry::{
- Collider, ColliderHandle, InteractionGroups, PointProjection, Ray, RayIntersection, AABB, QBVH,
+ Aabb, Collider, ColliderHandle, InteractionGroups, PointProjection, Qbvh, Ray, RayIntersection,
};
use crate::math::{Isometry, Point, Real, Vector};
use crate::{dynamics::RigidBodySet, geometry::ColliderSet};
-use parry::partitioning::QBVHDataGenerator;
+use parry::partitioning::QbvhDataGenerator;
use parry::query::details::{
IntersectionCompositeShapeShapeBestFirstVisitor,
NonlinearTOICompositeShapeShapeBestFirstVisitor, PointCompositeShapeProjBestFirstVisitor,
@@ -17,6 +17,7 @@ use parry::query::visitors::{
};
use parry::query::{DefaultQueryDispatcher, NonlinearRigidMotion, QueryDispatcher, TOI};
use parry::shape::{FeatureId, Shape, TypedSimdCompositeShape};
+use parry::utils::DefaultStorage;
use std::sync::Arc;
/// A pipeline for performing queries on all the colliders of a scene.
@@ -28,7 +29,7 @@ pub struct QueryPipeline {
serde(skip, default = "crate::geometry::default_query_dispatcher")
)]
query_dispatcher: Arc<dyn QueryDispatcher>,
- qbvh: QBVH<ColliderHandle>,
+ qbvh: Qbvh<ColliderHandle>,
tree_built: bool,
dilation_factor: Real,
}
@@ -245,6 +246,7 @@ pub enum QueryPipelineMode {
impl<'a> TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'a> {
type PartShape = dyn Shape;
type PartId = ColliderHandle;
+ type QbvhStorage = DefaultStorage;
fn map_typed_part_at(
&self,
@@ -266,7 +268,7 @@ impl<'a> TypedSimdCompositeShape for QueryPipelineAsCompositeShape<'a> {
self.map_typed_part_at(shape_id, f);
}
- fn typed_qbvh(&self) -> &QBVH<ColliderHandle> {
+ fn typed_qbvh(&self) -> &Qbvh<ColliderHandle> {
&self.query_pipeline.qbvh
}
}
@@ -307,7 +309,7 @@ impl QueryPipeline {
{
Self {
query_dispatcher: Arc::new(d),
- qbvh: QBVH::new(),
+ qbvh: Qbvh::new(),
tree_built: false,
dilation_factor: 0.01,
}
@@ -347,13 +349,13 @@ impl QueryPipeline {
mode: QueryPipelineMode,
}
- impl<'a> QBVHDataGenerator<ColliderHandle> for DataGenerator<'a> {
+ impl<'a> QbvhDataGenerator<ColliderHandle> for DataGenerator<'a> {
fn size_hint(&self) -> usize {
self.colliders.len()
}
#[inline(always)]
- fn for_each(&mut self, mut f: impl FnMut(ColliderHandle, AABB)) {
+ fn for_each(&mut self, mut f: impl FnMut(ColliderHandle, Aabb)) {
match self.mode {
QueryPipelineMode::CurrentPosition => {
for (h, co) in self.colliders.iter() {
@@ -673,10 +675,10 @@ impl QueryPipeline {
.map(|h| (h.1 .1 .0, h.1 .0, h.1 .1 .1))
}
- /// Finds all handles of all the colliders with an AABB intersecting the given AABB.
+ /// Finds all handles of all the colliders with an Aabb intersecting the given Aabb.
pub fn colliders_with_aabb_intersecting_aabb(
&self,
- aabb: &AABB,
+ aabb: &Aabb,
mut callback: impl FnMut(&ColliderHandle) -> bool,
) {
let mut visitor = BoundingVolumeIntersectionsVisitor::new(aabb, &mut callback);