Trait heron::rapier_plugin::rapier::geometry::Shape [−]
Trait implemented by shapes usable by Rapier.
Required methods
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
Computes the AABB of this shape.
pub fn mass_properties(&self, density: f32) -> MassProperties
Compute the mass-properties of this shape given its uniform density.
pub fn shape_type(&self) -> ShapeType
Gets the type tag of this shape.
Provided methods
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
Converts this shape to a polygonal feature-map, if it is one.
Implementations
impl dyn Shape + 'static
pub fn as_ball(&self) -> Option<&Ball<f32>>
Converts this abstract shape to a ball, if it is one.
pub fn as_cuboid(&self) -> Option<&Cuboid<f32>>
Converts this abstract shape to a cuboid, if it is one.
pub fn as_capsule(&self) -> Option<&Capsule>
Converts this abstract shape to a capsule, if it is one.
pub fn as_triangle(&self) -> Option<&Triangle<f32>>
Converts this abstract shape to a triangle, if it is one.
pub fn as_trimesh(&self) -> Option<&Trimesh>
Converts this abstract shape to a triangle mesh, if it is one.
pub fn as_heightfield(&self) -> Option<&HeightField<f32>>
Converts this abstract shape to a heightfield, if it is one.
pub fn as_cylinder(&self) -> Option<&Cylinder<f32>>
Converts this abstract shape to a cylinder, if it is one.
pub fn as_cone(&self) -> Option<&Cone<f32>>
Converts this abstract shape to a cone, if it is one.
pub fn as_round_cylinder(&self) -> Option<&RoundCylinder>
Converts this abstract shape to a cone, if it is one.
impl dyn Shape + 'static
pub fn is<__T>(&self) -> bool where
__T: Shape,
__T: Shape,
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T>(
self: Box<dyn Shape + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn Shape + 'static, Global>> where
__T: Shape,
self: Box<dyn Shape + 'static, Global>
) -> Result<Box<__T, Global>, Box<dyn Shape + 'static, Global>> where
__T: Shape,
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.
pub fn downcast_rc<__T>(
self: Rc<dyn Shape + 'static>
) -> Result<Rc<__T>, Rc<dyn Shape + 'static>> where
__T: Shape,
self: Rc<dyn Shape + 'static>
) -> Result<Rc<__T>, Rc<dyn Shape + 'static>> where
__T: Shape,
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.
pub fn downcast_ref<__T>(&self) -> Option<&__T> where
__T: Shape,
__T: Shape,
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn't.
pub fn downcast_mut<__T>(&mut self) -> Option<&mut __T> where
__T: Shape,
__T: Shape,
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn't.
pub fn downcast_arc<__T>(
self: Arc<dyn Shape + 'static>
) -> Result<Arc<__T>, Arc<dyn Shape + 'static>> where
__T: Shape + Any + Send + Sync,
self: Arc<dyn Shape + 'static>
) -> Result<Arc<__T>, Arc<dyn Shape + 'static>> where
__T: Shape + Any + Send + Sync,
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.
Implementors
impl Shape for Capsule
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
impl Shape for RoundCylinder
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
impl Shape for Trimesh
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, _density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
impl Shape for Ball<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
impl Shape for Cone<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
impl Shape for Cuboid<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
impl Shape for Cylinder<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
impl Shape for HeightField<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, _density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
impl Shape for Segment<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, _density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
impl Shape for Triangle<f32>
pub fn compute_aabb(
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
&self,
position: &Isometry<f32, U3, Unit<Quaternion<f32>>>
) -> AABB<f32>
pub fn mass_properties(&self, _density: f32) -> MassProperties
pub fn shape_type(&self) -> ShapeType
pub fn as_polygonal_feature_map(
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>
&self
) -> Option<(&dyn PolygonalFeatureMap, f32)>