pub struct Shape(/* private fields */);

Implementations§

source§

impl Shape

source

pub fn compound(shapes: Vec<(Transform, Shape)>) -> Self

Initialize a compound shape defined by its subshapes.

source

pub fn circle(radius: Real) -> Self

Initialize a circle shape defined by its radius.

source

pub fn square(hx: Real, hy: Real) -> Self

Initialize a cuboid shape defined by its half-extents.

source

pub fn rounded_square(hx: Real, hy: Real, border_radius: Real) -> Self

Initialize a round cuboid shape defined by its half-extents and border radius.

source

pub fn capsule(a: Vec2, b: Vec2, radius: Real) -> Self

Initialize a capsule shape from its endpoints and radius.

source

pub fn capsule_x(half_height: Real, radius: Real) -> Self

Initialize a capsule shape aligned with the x axis.

source

pub fn capsule_y(half_height: Real, radius: Real) -> Self

Initialize a capsule shape aligned with the y axis.

source

pub fn segment(a: Vec2, b: Vec2) -> Self

Initialize a segment shape from its endpoints.

source

pub fn triangle(a: Vec2, b: Vec2, c: Vec2) -> Self

Initializes a triangle shape.

source

pub fn round_triangle(a: Vec2, b: Vec2, c: Vec2, radius: Real) -> Self

Initializes a triangle shape with round corners.

source

pub fn polyline(vertices: Vec<Vec2>, indices: Option<Vec<[u32; 2]>>) -> Self

Initializes a polyline shape defined by its vertex and index buffers.

If no index buffer is provided, the polyline is assumed to describe a line strip.

source

pub fn trimesh(data: Data) -> Self

Initializes a triangle mesh shape defined by its vertex and index buffers.

source

pub fn convex_decomposition(vertices: &[Vec2], indices: &[[u32; 2]]) -> Self

Initializes a compound shape obtained from the decomposition of the given polyline into convex parts.

source

pub fn round_convex_decomposition( vertices: &[Vec2], indices: &[[u32; 2]], radius: Real ) -> Self

Initializes a compound shape obtained from the decomposition of the given polyline into convex parts dilated with round corners.

source

pub fn convex_decomposition_with_params( vertices: &[Vec2], indices: &[[u32; 2]], params: &VHACDParameters ) -> Self

Initializes a compound shape obtained from the decomposition of the given polyline into convex parts.

source

pub fn round_convex_decomposition_with_params( vertices: &[Vec2], indices: &[[u32; 2]], params: &VHACDParameters, radius: Real ) -> Self

Initializes a compound shape obtained from the decomposition of the given polyline into convex parts dilated with round corners.

source

pub fn convex_hull(points: &[Vec2]) -> Option<Self>

Creates a new shared shape that is the convex-hull of the given points.

source

pub fn round_convex_hull(points: &[Vec2], border_radius: Real) -> Option<Self>

Creates a new shared shape with rounded corners that is the convex-hull of the given points, dilated by border_radius.

source

pub fn convex_polyline(points: &[Vec2]) -> Option<Self>

Creates a new shared shape that is a convex polygon formed by the given set of points assumed to form a convex polyline (no convex-hull will be automatically computed).

source

pub fn round_convex_polyline( points: Vec<Vec2>, border_radius: Real ) -> Option<Self>

Creates a new collider builder that is a round convex polygon formed by the given polyline assumed to be convex (no convex-hull will be automatically computed). The polygon shape is dilated by a sphere of radius border_radius.

source

pub fn heightfield(heights: Vec<Real>, scale: Vec2) -> Self

Initializes an heightfield shape defined by its set of height and a scale factor along each coordinate axis.

source

pub fn from_shared_shape(shape: SharedShape) -> Self

Initializes a let engine shape from a Rapier shared shape.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Shape

§

impl Send for Shape

§

impl Sync for Shape

§

impl Unpin for Shape

§

impl !UnwindSafe for Shape

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,