Initializer

init(shapes:density:material:mode:)

Creates a physics body component deriving mass properties from shape and density.

Declaration

init(shapes: [ShapeResource], density: Float, material: PhysicsMaterialResource? = nil, mode: PhysicsBodyMode = .dynamic)

Parameters

shapes

The shape for which to estimate the mass, rotational inertia, and center of mass.

density

The density of the object in kilograms per cubic meter.

material

The material properties, like friction.

mode

The simulation mode that indicates how a body responds to forces.

See Also

Creating a Physics Body Component

init()

Creates a physics body component with default settings.

init(massProperties: PhysicsMassProperties, material: PhysicsMaterialResource?, mode: PhysicsBodyMode)

Creates a physics body component with the given mass properties, material, and mode.

init(shapes: [ShapeResource], mass: Float, material: PhysicsMaterialResource?, mode: PhysicsBodyMode)

Creates a physics body component deriving mass properties from shape and mass.