Skip to content

Commit

Permalink
Fix no-std build
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcrozet committed Oct 2, 2022
1 parent 36b9cde commit 70e04f3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 39 deletions.
63 changes: 32 additions & 31 deletions src/query/default_query_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::query::{
contact_manifolds::ContactManifoldsWorkspace, query_dispatcher::PersistentQueryDispatcher,
ContactManifold,
};
use crate::shape::{HalfSpace, HeightField, Segment, Shape, ShapeType};
use crate::shape::{HalfSpace, Segment, Shape, ShapeType};

/// A dispatcher that exposes built-in queries
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -306,38 +306,39 @@ impl QueryDispatcher for DefaultQueryDispatcher {
max_toi,
stop_at_penetration,
))
} else if let Some(heightfield1) = shape1.as_shape::<HeightField>() {
query::details::time_of_impact_heightfield_shape(
self,
pos12,
local_vel12,
heightfield1,
shape2,
max_toi,
stop_at_penetration,
)
} else if let Some(heightfield2) = shape1.as_shape::<HeightField>() {
query::details::time_of_impact_shape_heightfield(
self,
pos12,
local_vel12,
shape1,
heightfield2,
max_toi,
stop_at_penetration,
)
} else if let (Some(s1), Some(s2)) = (shape1.as_support_map(), shape2.as_support_map()) {
Ok(query::details::time_of_impact_support_map_support_map(
pos12,
local_vel12,
s1,
s2,
max_toi,
stop_at_penetration,
))
} else {
#[cfg(feature = "std")]
if let Some(c1) = shape1.as_composite_shape() {
if let Some(heightfield1) = shape1.as_heightfield() {
return query::details::time_of_impact_heightfield_shape(
self,
pos12,
local_vel12,
heightfield1,
shape2,
max_toi,
stop_at_penetration,
);
} else if let Some(heightfield2) = shape1.as_heightfield() {
return query::details::time_of_impact_shape_heightfield(
self,
pos12,
local_vel12,
shape1,
heightfield2,
max_toi,
stop_at_penetration,
);
} else if let (Some(s1), Some(s2)) = (shape1.as_support_map(), shape2.as_support_map())
{
return Ok(query::details::time_of_impact_support_map_support_map(
pos12,
local_vel12,
s1,
s2,
max_toi,
stop_at_penetration,
));
} else if let Some(c1) = shape1.as_composite_shape() {
return Ok(query::details::time_of_impact_composite_shape_shape(
self,
pos12,
Expand Down
20 changes: 12 additions & 8 deletions src/query/time_of_impact/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
pub use self::time_of_impact::{time_of_impact, TOIStatus, TOI};
pub use self::time_of_impact_ball_ball::time_of_impact_ball_ball;
#[cfg(feature = "std")]
pub use self::time_of_impact_composite_shape_shape::{
time_of_impact_composite_shape_shape, time_of_impact_shape_composite_shape,
TOICompositeShapeShapeBestFirstVisitor,
};
pub use self::time_of_impact_halfspace_support_map::{
time_of_impact_halfspace_support_map, time_of_impact_support_map_halfspace,
};
pub use self::time_of_impact_heightfield_shape::{
time_of_impact_heightfield_shape, time_of_impact_shape_heightfield,
#[cfg(feature = "std")]
pub use self::{
time_of_impact_composite_shape_shape::{
time_of_impact_composite_shape_shape, time_of_impact_shape_composite_shape,
TOICompositeShapeShapeBestFirstVisitor,
},
time_of_impact_heightfield_shape::{
time_of_impact_heightfield_shape, time_of_impact_shape_heightfield,
},
time_of_impact_support_map_support_map::time_of_impact_support_map_support_map,
};
pub use self::time_of_impact_support_map_support_map::time_of_impact_support_map_support_map;

mod time_of_impact;
mod time_of_impact_ball_ball;
#[cfg(feature = "std")]
mod time_of_impact_composite_shape_shape;
mod time_of_impact_halfspace_support_map;
#[cfg(feature = "std")]
mod time_of_impact_heightfield_shape;
#[cfg(feature = "std")]
mod time_of_impact_support_map_support_map;

0 comments on commit 70e04f3

Please sign in to comment.