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

pub struct ColliderBuilder {
    pub shape: SharedShape,
    pub friction: Real,
    pub friction_combine_rule: CoefficientCombineRule,
    pub restitution: Real,
    pub restitution_combine_rule: CoefficientCombineRule,
    pub delta: Isometry<Real>,
    pub is_sensor: bool,
    pub modify_solver_contacts: bool,
    pub user_data: u128,
    pub collision_groups: InteractionGroups,
    pub solver_groups: InteractionGroups,
    // some fields omitted
}

A structure responsible for building a new collider.

Fields

shape: SharedShape

The shape of the collider to be built.

friction: Real

The friction coefficient of the collider to be built.

friction_combine_rule: CoefficientCombineRule

The rule used to combine two friction coefficients.

restitution: Real

The restitution coefficient of the collider to be built.

restitution_combine_rule: CoefficientCombineRule

The rule used to combine two restitution coefficients.

delta: Isometry<Real>

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?

modify_solver_contacts: bool

Do we have to always call the contact modifier on this collider?

user_data: u128

The user-data of the collider being built.

collision_groups: InteractionGroups

The collision groups for the collider being built.

solver_groups: InteractionGroups

The solver groups for the collider being built.

Implementations

impl ColliderBuilder[src]

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

Initialize a new collider builder with the given shape.

pub fn compound(shapes: Vec<(Isometry<Real>, SharedShape)>) -> Self[src]

Initialize a new collider builder with a compound shape.

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

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

pub fn halfspace(outward_normal: Unit<Vector<Real>>) -> Self[src]

Initialize a new collider build with a half-space shape defined by the outward normal of its planar boundary.

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

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

pub fn round_cuboid(hx: Real, hy: Real, border_radius: Real) -> Self[src]

Initialize a new collider builder with a round cuboid shape defined by its half-extents and border radius.

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

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

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

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

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

Initializes a collider builder with a segment shape.

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

Initializes a collider builder with a triangle shape.

pub fn round_triangle(
    a: Point<Real>,
    b: Point<Real>,
    c: Point<Real>,
    border_radius: Real
) -> Self
[src]

Initializes a collider builder with a triangle shape with round corners.

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

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

pub fn trimesh(vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>) -> Self[src]

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

pub fn convex_decomposition(
    vertices: &[Point<Real>],
    indices: &[[u32; 2]]
) -> Self
[src]

Initializes a collider builder with a compound shape obtained from the decomposition of the given trimesh (in 3D) or polyline (in 2D) into convex parts.

pub fn round_convex_decomposition(
    vertices: &[Point<Real>],
    indices: &[[u32; 2]],
    border_radius: Real
) -> Self
[src]

Initializes a collider builder with a compound shape obtained from the decomposition of the given trimesh (in 3D) or polyline (in 2D) into convex parts dilated with round corners.

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

Initializes a collider builder with a compound shape obtained from the decomposition of the given trimesh (in 3D) or polyline (in 2D) into convex parts.

pub fn round_convex_decomposition_with_params(
    vertices: &[Point<Real>],
    indices: &[[u32; 2]],
    params: &VHACDParameters,
    border_radius: Real
) -> Self
[src]

Initializes a collider builder with a compound shape obtained from the decomposition of the given trimesh (in 3D) or polyline (in 2D) into convex parts dilated with round corners.

pub fn convex_hull(points: &[Point<Real>]) -> Option<Self>[src]

Initializes a new collider builder with a 2D convex polygon or 3D convex polyhedron obtained after computing the convex-hull of the given points.

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

Initializes a new collider builder with a round 2D convex polygon or 3D convex polyhedron obtained after computing the convex-hull of the given points. The shape is dilated by a sphere of radius border_radius.

pub fn convex_polyline(points: Vec<Point<Real>>) -> Option<Self>[src]

Creates a new collider builder that is a convex polygon formed by the given polyline assumed to be convex (no convex-hull will be automatically computed).

pub fn round_convex_polyline(
    points: Vec<Point<Real>>,
    border_radius: Real
) -> Option<Self>
[src]

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.

pub fn heightfield(heights: DVector<Real>, scale: Vector<Real>) -> 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() -> Real[src]

The default friction coefficient used by the collider builder.

pub fn user_data(self, data: u128) -> Self[src]

Sets an arbitrary user-defined 128-bit integer associated to the colliders built by this builder.

pub fn collision_groups(self, groups: InteractionGroups) -> Self[src]

Sets the collision groups used by this collider.

Two colliders will interact iff. their collision groups are compatible. See InteractionGroups::test for details.

pub fn solver_groups(self, groups: InteractionGroups) -> Self[src]

Sets the solver groups used by this collider.

Forces between two colliders in contact will be computed iff their solver groups are compatible. See InteractionGroups::test for details.

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

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

Sensors will have a default density of zero, but if you call Self::mass_properties you can assign a mass to a sensor.

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

If set to true then the physics hooks will always run to modify contacts involving this collider.

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

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

pub fn friction_combine_rule(self, rule: CoefficientCombineRule) -> Self[src]

Sets the rule to be used to combine two friction coefficients in a contact.

pub fn restitution(self, restitution: Real) -> Self[src]

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

pub fn restitution_combine_rule(self, rule: CoefficientCombineRule) -> Self[src]

Sets the rule to be used to combine two restitution coefficients in a contact.

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

Sets the uniform density of the collider this builder will build.

This will be overridden by a call to Self::mass_properties so it only makes sense to call either Self::density or Self::mass_properties.

pub fn mass_properties(self, mass_properties: MassProperties) -> Self[src]

Sets the mass properties of the collider this builder will build.

If this is set, Self::density will be ignored, so it only makes sense to call either Self::density or Self::mass_properties.

pub fn translation(self, x: Real, y: Real) -> Self[src]

Sets the initial translation of the collider to be created, relative to the rigid-body it is attached to.

pub fn rotation(self, angle: AngVector<Real>) -> Self[src]

Sets the initial orientation of the collider to be created, relative to the rigid-body it is attached to.

pub fn position_wrt_parent(self, pos: Isometry<Real>) -> Self[src]

Sets the initial position (translation and orientation) of the collider to be created, relative to the rigid-body it is attached to.

pub fn position(self, pos: Isometry<Real>) -> Self[src]

👎 Deprecated:

Use .position_wrt_parent instead.

Sets the initial position (translation and orientation) of the collider to be created, relative to the rigid-body it is attached to.

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

👎 Deprecated:

Use .position instead.

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

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

Builds 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
[src]

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

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.