pub struct Shape {
    pub hollow: Option<bool>,
    pub mass: Option<f32>,
    pub density: Option<f32>,
    pub physics_material: Option<Box<DefInstance<PhysicsMaterial>>>,
    pub geom: ShapeGeom,
    pub transform: Vec<RigidTransform>,
    pub extra: Vec<Extra>,
}
Expand description

Describes components of a RigidBody.

Fields

hollow: Option<bool>

If true, the mass is distributed along the surface of the shape.

mass: Option<f32>

The mass of the shape. If not provided, it is derived from density x shape volume.

density: Option<f32>

The density of the shape. If not provided, it is derived from mass/shape volume.

physics_material: Option<Box<DefInstance<PhysicsMaterial>>>

The PhysicsMaterial used for this shape.

geom: ShapeGeom

The geometry of the shape (Plane, Sphere, Mesh, etc.).

transform: Vec<RigidTransform>

Transformation for the shape. Any combination of these elements in any order. See Node for additional information.

extra: Vec<Extra>

Provides arbitrary additional information about this element.

Implementations

Construct a new Shape.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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

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