[][src]Struct rapier2d::geometry::ColliderBuilder

pub struct ColliderBuilder {
    pub shape: Shape,
    pub density: f32,
    pub friction: f32,
    pub restitution: f32,
    pub delta: Isometry<f32>,
    pub is_sensor: bool,
}

A structure responsible for building a new collider.

Fields

shape: Shape

The shape of the collider to be built.

density: f32

The density of the collider to be built.

friction: f32

The friction coefficient of the collider to be built.

restitution: f32

The restitution coefficient of the collider to be built.

delta: Isometry<f32>

The position of this collider relative to the local frame of the rigid-body it is attached to.

is_sensor: bool

Is this collider a sensor?

Implementations

impl ColliderBuilder[src]

pub fn new(shape: Shape) -> Self[src]

Initialize a new collider builder with the given shape.

pub fn ball(radius: f32) -> Self[src]

Initialize a new collider builder with a ball shape defined by its radius.

pub fn cuboid(hx: f32, hy: f32) -> Self[src]

Initialize a new collider builder with a cuboid shape defined by its half-extents.

pub fn capsule_x(half_height: f32, radius: f32) -> Self[src]

Initialize a new collider builder with a capsule shape aligned with the x axis.

pub fn capsule_y(half_height: f32, radius: f32) -> Self[src]

Initialize a new collider builder with a capsule shape aligned with the y axis.

pub fn segment(a: Point<f32>, b: Point<f32>) -> Self[src]

Initializes a collider builder with a segment shape.

A segment shape is modeled by a capsule with a 0 radius.

pub fn triangle(a: Point<f32>, b: Point<f32>, c: Point<f32>) -> Self[src]

Initializes a collider builder with a triangle shape.

pub fn trimesh(vertices: Vec<Point<f32>>, indices: Vec<Point3<u32>>) -> Self[src]

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

pub fn heightfield(heights: DVector<f32>, scale: Vector<f32>) -> Self[src]

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

pub fn default_friction() -> f32[src]

The default friction coefficient used by the collider builder.

pub fn sensor(self, is_sensor: bool) -> Self[src]

Sets whether or not the collider built by this builder is a sensor.

pub fn friction(self, friction: f32) -> Self[src]

Sets the friction coefficient of the collider this builder will build.

pub fn density(self, density: f32) -> Self[src]

Sets the density of the collider this builder will build.

pub fn delta(self, delta: Isometry<f32>) -> Self[src]

Set the position of this collider in the local-space of the rigid-body it is attached to.

pub fn build(&self) -> Collider[src]

Buildes a new collider attached to the given rigid-body.

Trait Implementations

impl Clone for ColliderBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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