Trait parry3d::shape::Shape

source ·
pub trait Shape: RayCast + PointQuery + DowncastSync {
Show 16 methods // Required methods fn compute_local_aabb(&self) -> Aabb; fn compute_local_bounding_sphere(&self) -> BoundingSphere; fn clone_box(&self) -> Box<dyn Shape>; fn mass_properties(&self, density: Real) -> MassProperties; fn shape_type(&self) -> ShapeType; fn as_typed_shape(&self) -> TypedShape<'_>; fn ccd_thickness(&self) -> Real; fn ccd_angular_thickness(&self) -> Real; // Provided methods fn compute_aabb(&self, position: &Isometry<Real>) -> Aabb { ... } fn compute_bounding_sphere( &self, position: &Isometry<Real> ) -> BoundingSphere { ... } fn is_convex(&self) -> bool { ... } fn as_support_map(&self) -> Option<&dyn SupportMap> { ... } fn as_composite_shape(&self) -> Option<&dyn SimdCompositeShape> { ... } fn as_polygonal_feature_map( &self ) -> Option<(&dyn PolygonalFeatureMap, Real)> { ... } fn feature_normal_at_point( &self, _feature: FeatureId, _point: &Point<Real> ) -> Option<Unit<Vector<Real>>> { ... } fn compute_swept_aabb( &self, start_pos: &Isometry<Real>, end_pos: &Isometry<Real> ) -> Aabb { ... }
}
Expand description

Trait implemented by shapes usable by Rapier.

Required Methods§

source

fn compute_local_aabb(&self) -> Aabb

Computes the Aabb of this shape.

source

fn compute_local_bounding_sphere(&self) -> BoundingSphere

Computes the bounding-sphere of this shape.

source

fn clone_box(&self) -> Box<dyn Shape>

Clones this shape into a boxed trait-object.

source

fn mass_properties(&self, density: Real) -> MassProperties

Compute the mass-properties of this shape given its uniform density.

source

fn shape_type(&self) -> ShapeType

Gets the type tag of this shape.

source

fn as_typed_shape(&self) -> TypedShape<'_>

Gets the underlying shape as an enum.

source

fn ccd_thickness(&self) -> Real

source

fn ccd_angular_thickness(&self) -> Real

Provided Methods§

source

fn compute_aabb(&self, position: &Isometry<Real>) -> Aabb

Computes the Aabb of this shape with the given position.

source

fn compute_bounding_sphere(&self, position: &Isometry<Real>) -> BoundingSphere

Computes the bounding-sphere of this shape with the given position.

source

fn is_convex(&self) -> bool

Is this shape known to be convex?

If this returns true then self is known to be convex. If this returns false then it is not known whether or not self is convex.

source

fn as_support_map(&self) -> Option<&dyn SupportMap>

Convents this shape into its support mapping, if it has one.

source

fn as_composite_shape(&self) -> Option<&dyn SimdCompositeShape>

source

fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, Real)>

Converts this shape to a polygonal feature-map, if it is one.

source

fn feature_normal_at_point( &self, _feature: FeatureId, _point: &Point<Real> ) -> Option<Unit<Vector<Real>>>

The shape’s normal at the given point located on a specific feature.

source

fn compute_swept_aabb( &self, start_pos: &Isometry<Real>, end_pos: &Isometry<Real> ) -> Aabb

Computes the swept Aabb of this shape, i.e., the space it would occupy by moving from the given start position to the given end position.

Implementations§

source§

impl dyn Shape

source

pub fn is<__T: Shape>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

source

pub fn downcast<__T: Shape>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

source

pub fn downcast_rc<__T: Shape>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

source

pub fn downcast_ref<__T: Shape>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

source

pub fn downcast_mut<__T: Shape>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

source

pub fn downcast_arc<__T: Shape + Any + Send + Sync>( self: Arc<Self> ) -> Result<Arc<__T>, Arc<Self>>

Returns an Arc-ed object from an Arc-ed trait object if the underlying object is of type __T. Returns the original Arc-ed trait if it isn’t.

source§

impl dyn Shape

source

pub fn as_shape<T: Shape>(&self) -> Option<&T>

Converts this abstract shape to the given shape, if it is one.

source

pub fn as_shape_mut<T: Shape>(&mut self) -> Option<&mut T>

Converts this abstract shape to the given mutable shape, if it is one.

source

pub fn as_ball(&self) -> Option<&Ball>

Converts this abstract shape to a ball, if it is one.

source

pub fn as_ball_mut(&mut self) -> Option<&mut Ball>

Converts this abstract shape to a mutable ball, if it is one.

source

pub fn as_cuboid(&self) -> Option<&Cuboid>

Converts this abstract shape to a cuboid, if it is one.

source

pub fn as_cuboid_mut(&mut self) -> Option<&mut Cuboid>

Converts this abstract shape to a mutable cuboid, if it is one.

source

pub fn as_halfspace(&self) -> Option<&HalfSpace>

Converts this abstract shape to a halfspace, if it is one.

source

pub fn as_halfspace_mut(&mut self) -> Option<&mut HalfSpace>

Converts this abstract shape to a halfspace, if it is one.

source

pub fn as_segment(&self) -> Option<&Segment>

Converts this abstract shape to a segment, if it is one.

source

pub fn as_segment_mut(&mut self) -> Option<&mut Segment>

Converts this abstract shape to a mutable segment, if it is one.

source

pub fn as_capsule(&self) -> Option<&Capsule>

Converts this abstract shape to a capsule, if it is one.

source

pub fn as_capsule_mut(&mut self) -> Option<&mut Capsule>

Converts this abstract shape to a mutable capsule, if it is one.

source

pub fn as_triangle(&self) -> Option<&Triangle>

Converts this abstract shape to a triangle, if it is one.

source

pub fn as_triangle_mut(&mut self) -> Option<&mut Triangle>

Converts this abstract shape to a mutable triangle, if it is one.

source

pub fn as_compound(&self) -> Option<&Compound>

Converts this abstract shape to a compound shape, if it is one.

source

pub fn as_compound_mut(&mut self) -> Option<&mut Compound>

Converts this abstract shape to a mutable compound shape, if it is one.

source

pub fn as_trimesh(&self) -> Option<&TriMesh>

Converts this abstract shape to a triangle mesh, if it is one.

source

pub fn as_trimesh_mut(&mut self) -> Option<&mut TriMesh>

Converts this abstract shape to a mutable triangle mesh, if it is one.

source

pub fn as_polyline(&self) -> Option<&Polyline>

Converts this abstract shape to a polyline, if it is one.

source

pub fn as_polyline_mut(&mut self) -> Option<&mut Polyline>

Converts this abstract shape to a mutable polyline, if it is one.

source

pub fn as_heightfield(&self) -> Option<&HeightField>

Converts this abstract shape to a heightfield, if it is one.

source

pub fn as_heightfield_mut(&mut self) -> Option<&mut HeightField>

Converts this abstract shape to a mutable heightfield, if it is one.

source

pub fn as_round_cuboid(&self) -> Option<&RoundCuboid>

Converts this abstract shape to a round cuboid, if it is one.

source

pub fn as_round_cuboid_mut(&mut self) -> Option<&mut RoundCuboid>

Converts this abstract shape to a mutable round cuboid, if it is one.

source

pub fn as_round_triangle(&self) -> Option<&RoundTriangle>

Converts this abstract shape to a round triangle, if it is one.

source

pub fn as_round_triangle_mut(&mut self) -> Option<&mut RoundTriangle>

Converts this abstract shape to a round triangle, if it is one.

source

pub fn as_convex_polyhedron(&self) -> Option<&ConvexPolyhedron>

source

pub fn as_convex_polyhedron_mut(&mut self) -> Option<&mut ConvexPolyhedron>

source

pub fn as_cylinder(&self) -> Option<&Cylinder>

Converts this abstract shape to a cylinder, if it is one.

source

pub fn as_cylinder_mut(&mut self) -> Option<&mut Cylinder>

Converts this abstract shape to a mutable cylinder, if it is one.

source

pub fn as_cone(&self) -> Option<&Cone>

Converts this abstract shape to a cone, if it is one.

source

pub fn as_cone_mut(&mut self) -> Option<&mut Cone>

Converts this abstract shape to a mutable cone, if it is one.

source

pub fn as_round_cylinder(&self) -> Option<&RoundCylinder>

Converts this abstract shape to a round cylinder, if it is one.

source

pub fn as_round_cylinder_mut(&mut self) -> Option<&mut RoundCylinder>

Converts this abstract shape to a mutable round cylinder, if it is one.

source

pub fn as_round_cone(&self) -> Option<&RoundCone>

Converts this abstract shape to a round cone, if it is one.

source

pub fn as_round_cone_mut(&mut self) -> Option<&mut RoundCone>

Converts this abstract shape to a mutable round cone, if it is one.

source

pub fn as_round_convex_polyhedron(&self) -> Option<&RoundConvexPolyhedron>

Converts this abstract shape to a round convex polyhedron, if it is one.

source

pub fn as_round_convex_polyhedron_mut( &mut self ) -> Option<&mut RoundConvexPolyhedron>

Converts this abstract shape to a mutable round convex polyhedron, if it is one.

Trait Implementations§

source§

impl AsRef<dyn Shape> for SharedShape

source§

fn as_ref(&self) -> &dyn Shape

Converts this type into a shared reference of the (usually inferred) input type.

Implementors§