From 865ce8a8e5301b23ca474adaaffe8b43e725803e Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Tue, 20 Oct 2020 11:55:33 +0200 Subject: Collider shape: use a trait-object instead of an enum. --- src/pipeline/query_pipeline.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/pipeline') diff --git a/src/pipeline/query_pipeline.rs b/src/pipeline/query_pipeline.rs index 32f59fc..03103be 100644 --- a/src/pipeline/query_pipeline.rs +++ b/src/pipeline/query_pipeline.rs @@ -69,7 +69,11 @@ impl QueryPipeline { for handle in inter { let collider = &colliders[handle]; - if let Some(inter) = collider.shape().cast_ray(collider.position(), ray, max_toi) { + if let Some(inter) = + collider + .shape() + .toi_and_normal_with_ray(collider.position(), ray, max_toi, true) + { if inter.toi < best { best = inter.toi; result = Some((handle, collider, inter)); @@ -103,7 +107,11 @@ impl QueryPipeline { for handle in inter { let collider = &colliders[handle]; - if let Some(inter) = collider.shape().cast_ray(collider.position(), ray, max_toi) { + if let Some(inter) = + collider + .shape() + .toi_and_normal_with_ray(collider.position(), ray, max_toi, true) + { if !callback(handle, collider, inter) { return; } -- cgit