Struct let_engine::objects::physics::Shape
source · pub struct Shape(/* private fields */);
Implementations§
source§impl Shape
impl Shape
sourcepub fn compound(shapes: Vec<(Transform, Shape)>) -> Self
pub fn compound(shapes: Vec<(Transform, Shape)>) -> Self
Initialize a compound shape defined by its subshapes.
sourcepub fn square(hx: Real, hy: Real) -> Self
pub fn square(hx: Real, hy: Real) -> Self
Initialize a cuboid shape defined by its half-extents.
sourcepub fn rounded_square(hx: Real, hy: Real, border_radius: Real) -> Self
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.
sourcepub fn capsule(a: Vec2, b: Vec2, radius: Real) -> Self
pub fn capsule(a: Vec2, b: Vec2, radius: Real) -> Self
Initialize a capsule shape from its endpoints and radius.
sourcepub fn capsule_x(half_height: Real, radius: Real) -> Self
pub fn capsule_x(half_height: Real, radius: Real) -> Self
Initialize a capsule shape aligned with the x
axis.
sourcepub fn capsule_y(half_height: Real, radius: Real) -> Self
pub fn capsule_y(half_height: Real, radius: Real) -> Self
Initialize a capsule shape aligned with the y
axis.
sourcepub fn round_triangle(a: Vec2, b: Vec2, c: Vec2, radius: Real) -> Self
pub fn round_triangle(a: Vec2, b: Vec2, c: Vec2, radius: Real) -> Self
Initializes a triangle shape with round corners.
sourcepub fn polyline(vertices: Vec<Vec2>, indices: Option<Vec<[u32; 2]>>) -> Self
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.
sourcepub fn trimesh(data: Data) -> Self
pub fn trimesh(data: Data) -> Self
Initializes a triangle mesh shape defined by its vertex and index buffers.
sourcepub fn convex_decomposition(vertices: &[Vec2], indices: &[[u32; 2]]) -> Self
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.
sourcepub fn round_convex_decomposition(
vertices: &[Vec2],
indices: &[[u32; 2]],
radius: Real
) -> Self
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.
sourcepub fn convex_decomposition_with_params(
vertices: &[Vec2],
indices: &[[u32; 2]],
params: &VHACDParameters
) -> Self
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.
sourcepub fn round_convex_decomposition_with_params(
vertices: &[Vec2],
indices: &[[u32; 2]],
params: &VHACDParameters,
radius: Real
) -> Self
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.
sourcepub fn convex_hull(points: &[Vec2]) -> Option<Self>
pub fn convex_hull(points: &[Vec2]) -> Option<Self>
Creates a new shared shape that is the convex-hull of the given points.
sourcepub fn round_convex_hull(points: &[Vec2], border_radius: Real) -> Option<Self>
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
.
sourcepub fn convex_polyline(points: &[Vec2]) -> Option<Self>
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).
sourcepub fn round_convex_polyline(
points: Vec<Vec2>,
border_radius: Real
) -> Option<Self>
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
.
sourcepub fn heightfield(heights: Vec<Real>, scale: Vec2) -> Self
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.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.