pub struct ColliderBuilder {
Show 15 fields pub shape: SharedShape, pub density: Option<Real>, pub mass_properties: Option<MassProperties>, pub friction: Real, pub friction_combine_rule: CoefficientCombineRule, pub restitution: Real, pub restitution_combine_rule: CoefficientCombineRule, pub position: Isometry<Real>, pub is_sensor: bool, pub active_collision_types: ActiveCollisionTypes, pub active_hooks: ActiveHooks, pub active_events: ActiveEvents, pub user_data: u128, pub collision_groups: InteractionGroups, pub solver_groups: InteractionGroups,
}
Expand description

A structure responsible for building a new collider.

Fields

shape: SharedShape

The shape of the collider to be built.

density: Option<Real>

The uniform density of the collider to be built.

mass_properties: Option<MassProperties>

Overrides automatic computation of MassProperties. If None, it will be computed based on shape and density.

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.

position: Isometry<Real>

The position of this collider.

is_sensor: bool

Is this collider a sensor?

active_collision_types: ActiveCollisionTypes

Contact pairs enabled for this collider.

active_hooks: ActiveHooks

Physics hooks enabled for this collider.

active_events: ActiveEvents

Events enabled for 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

Initialize a new collider builder with the given shape.

Initialize a new collider builder with a compound shape.

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

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

Initialize a new collider builder with a cylindrical shape defined by its half-height (along along the y axis) and its radius.

Initialize a new collider builder with a rounded cylindrical shape defined by its half-height (along along the y axis), its radius, and its roundedness (the radius of the sphere used for dilating the cylinder).

Initialize a new collider builder with a cone shape defined by its half-height (along along the y axis) and its basis radius.

Initialize a new collider builder with a rounded cone shape defined by its half-height (along along the y axis), its radius, and its roundedness (the radius of the sphere used for dilating the cylinder).

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

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

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

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

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

Initializes a collider builder with a segment shape.

Initializes a collider builder with a triangle shape.

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

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

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

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.

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.

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.

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.

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

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.

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

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

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

The default friction coefficient used by the collider builder.

The default density used by the collider builder.

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

Sets the collision groups used by this collider.

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

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.

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.

The set of physics hooks enabled for this collider.

The set of events enabled for this collider.

The set of active collision types for this collider.

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

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

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

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

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.

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.

Sets the initial translation of the collider to be created.

If the collider will be attached to a rigid-body, this sets the translation relative to the rigid-body it will be attached to.

Sets the initial orientation of the collider to be created.

If the collider will be attached to a rigid-body, this sets the orientation relative to the rigid-body it will be attached to.

Sets the initial position (translation and orientation) of the collider to be created.

If the collider will be attached to a rigid-body, this sets the position relative to the rigid-body it will be attached to.

👎 Deprecated:

Use .position instead.

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

👎 Deprecated:

Use .position instead.

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

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

Builds all the components required by a collider.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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. Read more

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

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

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

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

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

Should always be Self

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

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

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

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.