[][src]Trait oxygengine_physics_2d::prelude::Shape

pub trait Shape<N>: ShapeClone<N> + Send + Sync + Downcast where
    N: RealField
{ fn aabb(&self, m: &Isometry<N, U2, Unit<Complex<N>>>) -> AABB<N>;
fn tangent_cone_contains_dir(
        &self,
        _feature: FeatureId,
        _m: &Isometry<N, U2, Unit<Complex<N>>>,
        _deformations: Option<&[N]>,
        _dir: &Unit<Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>>
    ) -> bool; fn local_aabb(&self) -> AABB<N> { ... }
fn bounding_sphere(
        &self,
        m: &Isometry<N, U2, Unit<Complex<N>>>
    ) -> BoundingSphere<N> { ... }
fn local_bounding_sphere(&self) -> BoundingSphere<N> { ... }
fn subshape_containing_feature(&self, _i: FeatureId) -> usize { ... }
fn as_ray_cast(&self) -> Option<&dyn RayCast<N>> { ... }
fn as_point_query(&self) -> Option<&dyn PointQuery<N>> { ... }
fn as_convex_polyhedron(&self) -> Option<&dyn ConvexPolyhedron<N>> { ... }
fn as_support_map(&self) -> Option<&dyn SupportMap<N>> { ... }
fn as_composite_shape(&self) -> Option<&dyn CompositeShape<N>> { ... }
fn as_deformable_shape(&self) -> Option<&dyn DeformableShape<N>> { ... }
fn as_deformable_shape_mut(&mut self) -> Option<&mut dyn DeformableShape<N>> { ... }
fn is_convex_polyhedron(&self) -> bool { ... }
fn is_support_map(&self) -> bool { ... }
fn is_composite_shape(&self) -> bool { ... }
fn is_deformable_shape(&self) -> bool { ... } }

Trait implemented by all shapes supported by ncollide.

This allows dynamic inspection of the shape capabilities.

Required methods

fn aabb(&self, m: &Isometry<N, U2, Unit<Complex<N>>>) -> AABB<N>

The AABB of self transformed by m.

fn tangent_cone_contains_dir(
    &self,
    _feature: FeatureId,
    _m: &Isometry<N, U2, Unit<Complex<N>>>,
    _deformations: Option<&[N]>,
    _dir: &Unit<Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>>
) -> bool

Check if if the feature _feature of the i-th subshape of self transformed by m has a tangent cone that contains dir at the point pt.

Loading content...

Provided methods

fn local_aabb(&self) -> AABB<N>

The AABB of self.

fn bounding_sphere(
    &self,
    m: &Isometry<N, U2, Unit<Complex<N>>>
) -> BoundingSphere<N>

The bounding sphere of self transformed by m.

fn local_bounding_sphere(&self) -> BoundingSphere<N>

The bounding sphere of self.

fn subshape_containing_feature(&self, _i: FeatureId) -> usize

Returns the id of the subshape containing the specified feature.

If several subshape contains the same feature, any one is returned.

fn as_ray_cast(&self) -> Option<&dyn RayCast<N>>

The RayCast implementation of self.

fn as_point_query(&self) -> Option<&dyn PointQuery<N>>

The PointQuery implementation of self.

fn as_convex_polyhedron(&self) -> Option<&dyn ConvexPolyhedron<N>>

The convex polyhedron representation of self if applicable.

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

The support mapping of self if applicable.

fn as_composite_shape(&self) -> Option<&dyn CompositeShape<N>>

The composite shape representation of self if applicable.

fn as_deformable_shape(&self) -> Option<&dyn DeformableShape<N>>

The deformable shape representation of self if applicable.

fn as_deformable_shape_mut(&mut self) -> Option<&mut dyn DeformableShape<N>>

The mutable deformable shape representation of self if applicable.

fn is_convex_polyhedron(&self) -> bool

Whether self uses a convex polyhedron representation.

fn is_support_map(&self) -> bool

Whether self uses a support-mapping based representation.

fn is_composite_shape(&self) -> bool

Whether self uses a composite shape-based representation.

fn is_deformable_shape(&self) -> bool

Whether self uses a composite shape-based representation.

Loading content...

Implementations

impl<N> dyn Shape<N> + 'static where
    N: RealField
[src]

Trait for casting shapes to its exact represetation.

pub fn is_shape<T>(&self) -> bool where
    T: Shape<N>, 
[src]

Tests if this shape has a specific type T.

pub fn as_shape<T>(&self) -> Option<&T> where
    T: Shape<N>, 
[src]

Performs the cast.

impl<N> dyn Shape<N> + 'static where
    N: Any + 'static + RealField

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

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

pub fn downcast<__T>(
    self: Box<dyn Shape<N> + 'static>
) -> Result<Box<__T>, Box<dyn Shape<N> + 'static>> where
    __T: Shape<N>, 

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<N> + 'static>
) -> Result<Rc<__T>, Rc<dyn Shape<N> + 'static>> where
    __T: Shape<N>, 

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<N>, 

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<N>, 

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

Trait Implementations

impl<N> AsRef<dyn Shape<N> + 'static> for ShapeHandle<N> where
    N: RealField
[src]

impl<N> HasBoundingVolume<N, AABB<N>> for dyn Shape<N> + 'static where
    N: RealField
[src]

impl<N> HasBoundingVolume<N, BoundingSphere<N>> for dyn Shape<N> + 'static where
    N: RealField
[src]

impl<N> PointQuery<N> for dyn Shape<N> + 'static where
    N: RealField
[src]

impl<N> RayCast<N> for dyn Shape<N> + 'static where
    N: RealField
[src]

impl<N> Volumetric<N> for dyn Shape<N> + 'static where
    N: RealField
[src]

Implementors

impl<N> Shape<N> for Ball<N> where
    N: RealField
[src]

impl<N> Shape<N> for Capsule<N> where
    N: RealField
[src]

impl<N> Shape<N> for Compound<N> where
    N: RealField
[src]

impl<N> Shape<N> for ConvexPolygon<N> where
    N: RealField
[src]

impl<N> Shape<N> for Cuboid<N> where
    N: RealField
[src]

impl<N> Shape<N> for HeightField<N> where
    N: RealField
[src]

impl<N> Shape<N> for Plane<N> where
    N: RealField
[src]

impl<N> Shape<N> for Polyline<N> where
    N: RealField
[src]

impl<N> Shape<N> for Segment<N> where
    N: RealField
[src]

Loading content...