aboutsummaryrefslogtreecommitdiff
path: root/src/pipeline
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-10-02 19:08:07 +0200
committerGitHub <noreply@github.com>2022-10-02 19:08:07 +0200
commitc755109ec963116f246abf02041735c8c4320ceb (patch)
tree09bc63fe9ef31990f43feb3fcac36864f1665595 /src/pipeline
parenta1802323285622e0626cd69c7ea3b3ca60638b2e (diff)
parentf7bec3c49cf6ca24d2878a9dcd20656d26de5cc7 (diff)
downloadrapier-c755109ec963116f246abf02041735c8c4320ceb.tar.gz
rapier-c755109ec963116f246abf02041735c8c4320ceb.tar.bz2
rapier-c755109ec963116f246abf02041735c8c4320ceb.zip
Merge pull request #394 from dimforge/character-controller
Add a character controller implementation
Diffstat (limited to 'src/pipeline')
-rw-r--r--src/pipeline/query_pipeline.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pipeline/query_pipeline.rs b/src/pipeline/query_pipeline.rs
index 86fa7b6..e2ea05f 100644
--- a/src/pipeline/query_pipeline.rs
+++ b/src/pipeline/query_pipeline.rs
@@ -168,7 +168,7 @@ impl<'a> QueryFilter<'a> {
}
/// Exclude from the query any collider attached to a kinematic rigid-body.
- pub fn exclude_dynamic(self) -> Self {
+ pub fn exclude_dynamic() -> Self {
QueryFilterFlags::EXCLUDE_DYNAMIC.into()
}
@@ -696,6 +696,9 @@ impl QueryPipeline {
/// * `shape` - The shape to cast.
/// * `max_toi` - The maximum time-of-impact that can be reported by this cast. This effectively
/// limits the distance traveled by the shape to `shapeVel.norm() * maxToi`.
+ /// * `stop_at_penetration` - If set to `false`, the linear shape-cast won’t immediately stop if
+ /// the shape is penetrating another shape at its starting point **and** its trajectory is such
+ /// that it’s on a path to exist that penetration state.
/// * `filter`: set of rules used to determine which collider is taken into account by this scene query.
pub fn cast_shape<'a>(
&self,
@@ -705,6 +708,7 @@ impl QueryPipeline {
shape_vel: &Vector<Real>,
shape: &dyn Shape,
max_toi: Real,
+ stop_at_penetration: bool,
filter: QueryFilter,
) -> Option<(ColliderHandle, TOI)> {
let pipeline_shape = self.as_composite_shape(bodies, colliders, filter);
@@ -715,6 +719,7 @@ impl QueryPipeline {
&pipeline_shape,
shape,
max_toi,
+ stop_at_penetration,
);
self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1)
}