pub struct B2Shape {
    pub m_type: B2ShapeType,
    pub m_radius: f32,
}
Expand description

A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in B2world are created automatically when a B2fixture is created. Shapes may encapsulate a one or more child shapes.

Fields

m_type: B2ShapeTypem_radius: f32

Radius of a shape. For polygonal shapes this must be B2_POLYGON_RADIUS. There is no support for making rounded polygons.

Implementations

Get the type of this shape. You can use this to down cast to the concrete shape.

@return the shape type.

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

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

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.