Files
ncollide2d
bounding_volume
aabb.rsaabb_ball.rsaabb_compound.rsaabb_convex_polygon.rsaabb_cuboid.rsaabb_heightfield.rsaabb_plane.rsaabb_polyline.rsaabb_shape.rsaabb_support_map.rsaabb_utils.rsbounding_sphere.rsbounding_sphere_ball.rsbounding_sphere_capsule.rsbounding_sphere_compound.rsbounding_sphere_convex_polygon.rsbounding_sphere_cuboid.rsbounding_sphere_heightfield.rsbounding_sphere_plane.rsbounding_sphere_polyline.rsbounding_sphere_segment.rsbounding_sphere_shape.rsbounding_sphere_utils.rsbounding_volume.rscircular_cone.rsmod.rsspatialized_normal_cone.rs
interpolation
partitioning
pipeline
broad_phase
glue
narrow_phase
contact_generator
ball_ball_manifold_generator.rsball_convex_polyhedron_manifold_generator.rscapsule_capsule_manifold_generator.rscapsule_shape_manifold_generator.rscomposite_shape_composite_shape_manifold_generator.rscomposite_shape_shape_manifold_generator.rscontact_manifold_generator.rsconvex_polyhedron_convex_polyhedron_manifold_generator.rsdefault_contact_dispatcher.rsheightfield_shape_manifold_generator.rsmod.rsplane_ball_manifold_generator.rsplane_convex_polyhedron_manifold_generator.rs
proximity_detector
object
procedural
query
algorithms
closest_points
contact
distance
nonlinear_time_of_impact
point
proximity
ray
time_of_impact
visitors
shape
transformation
to_polyline
utils
ncollide3d
bounding_volume
aabb.rsaabb_ball.rsaabb_compound.rsaabb_convex.rsaabb_cuboid.rsaabb_heightfield.rsaabb_plane.rsaabb_polyline.rsaabb_shape.rsaabb_support_map.rsaabb_triangle.rsaabb_trimesh.rsaabb_utils.rsbounding_sphere.rsbounding_sphere_ball.rsbounding_sphere_capsule.rsbounding_sphere_compound.rsbounding_sphere_cone.rsbounding_sphere_convex.rsbounding_sphere_cuboid.rsbounding_sphere_cylinder.rsbounding_sphere_heightfield.rsbounding_sphere_plane.rsbounding_sphere_polyline.rsbounding_sphere_segment.rsbounding_sphere_shape.rsbounding_sphere_triangle.rsbounding_sphere_trimesh.rsbounding_sphere_utils.rsbounding_volume.rscircular_cone.rsmod.rsspatialized_normal_cone.rs
interpolation
partitioning
pipeline
broad_phase
glue
narrow_phase
contact_generator
ball_ball_manifold_generator.rsball_convex_polyhedron_manifold_generator.rscapsule_capsule_manifold_generator.rscapsule_shape_manifold_generator.rscomposite_shape_composite_shape_manifold_generator.rscomposite_shape_shape_manifold_generator.rscontact_manifold_generator.rsconvex_polyhedron_convex_polyhedron_manifold_generator.rsdefault_contact_dispatcher.rsheightfield_shape_manifold_generator.rsmod.rsplane_ball_manifold_generator.rsplane_convex_polyhedron_manifold_generator.rstrimesh_trimesh_manifold_generator.rs
proximity_detector
object
procedural
query
algorithms
closest_points
contact
distance
nonlinear_time_of_impact
point
proximity
ray
time_of_impact
visitors
shape
transformation
to_trimesh
utils
>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
use na::{RealField, Unit}; use crate::math::{Isometry, Point, Vector}; use crate::shape::SupportMap; /// A support mapping that is always equal to the origin, independently from its transform. pub struct ConstantOrigin; impl<N: RealField> SupportMap<N> for ConstantOrigin { #[inline] fn support_point(&self, _: &Isometry<N>, _: &Vector<N>) -> Point<N> { Point::origin() } #[inline] fn support_point_toward(&self, _: &Isometry<N>, _: &Unit<Vector<N>>) -> Point<N> { Point::origin() } } /// The Minkowski sum of a shape and a ball. pub struct DilatedShape<'a, N: RealField, S: ?Sized + SupportMap<N>> { /// The shape involved in the Minkowski sum. pub shape: &'a S, /// The radius of the ball involved in the Minkoski sum. pub radius: N, } impl<'a, N: RealField, S: ?Sized + SupportMap<N>> SupportMap<N> for DilatedShape<'a, N, S> { #[inline] fn support_point(&self, m: &Isometry<N>, dir: &Vector<N>) -> Point<N> { self.support_point_toward(m, &Unit::new_normalize(*dir)) } #[inline] fn support_point_toward(&self, m: &Isometry<N>, dir: &Unit<Vector<N>>) -> Point<N> { self.shape.support_point_toward(m, dir) + **dir * self.radius } }