use bounding_volume::{self, BoundingSphere, AABB}; use query::{PointQuery, RayCast}; use shape::{Ball, CompositeShape, Compound, Cone, ConvexHull, Cuboid, Cylinder, Plane, Polyline, Segment, Shape, SupportMap, TriMesh, Triangle}; use math::{Isometry, Point}; macro_rules! impl_as_support_map( () => { #[inline] fn as_support_map(&self) -> Option<&SupportMap> { Some(self) } #[inline] fn is_support_map(&self) -> bool { true } } ); macro_rules! impl_as_composite_shape( () => { #[inline] fn as_composite_shape(&self) -> Option<&CompositeShape> { Some(self) } #[inline] fn is_composite_shape(&self) -> bool { true } } ); macro_rules! impl_shape_common( () => { #[inline] fn aabb(&self, m: &M) -> AABB

{ bounding_volume::aabb(self, m) } #[inline] fn bounding_sphere(&self, m: &M) -> BoundingSphere

{ bounding_volume::bounding_sphere(self, m) } #[inline] fn as_ray_cast(&self) -> Option<&RayCast> { Some(self) } #[inline] fn as_point_query(&self) -> Option<&PointQuery> { Some(self) } } ); impl> Shape for Triangle

{ impl_shape_common!(); impl_as_support_map!(); } impl> Shape for Segment

{ impl_shape_common!(); impl_as_support_map!(); } impl> Shape for Ball { impl_shape_common!(); impl_as_support_map!(); } impl> Shape for Cuboid { impl_shape_common!(); impl_as_support_map!(); } impl> Shape for Cylinder { impl_shape_common!(); impl_as_support_map!(); } impl> Shape for Cone { impl_shape_common!(); impl_as_support_map!(); } impl> Shape for ConvexHull

{ impl_shape_common!(); impl_as_support_map!(); } impl> Shape for Compound { impl_shape_common!(); impl_as_composite_shape!(); } impl> Shape for TriMesh

{ impl_shape_common!(); impl_as_composite_shape!(); } impl> Shape for Polyline

{ impl_shape_common!(); impl_as_composite_shape!(); } impl> Shape for Plane { impl_shape_common!(); }