Structure

PhysicsMassProperties

Mass properties of a physics body.

Declaration

struct PhysicsMassProperties

Topics

Using Default Mass Properties

static let `default`: PhysicsMassProperties

The default mass properties, equivalent to a unit sphere with a mass of 1 kilogram.

Creating Custom Mass Properties

init()

Creates a mass properties instance with default settings.

init(shape: ShapeResource, density: Float)

Creates the mass properties for a solid shape with the specified density.

init(shape: ShapeResource, mass: Float)

Creates the mass properties for a solid shape with the specified mass.

Getting Mass Properties

var mass: Float

The mass in kilograms.

var inertia: SIMD3<Float>

The inertia in kilograms per square meter.

var centerOfMass: (position: SIMD3<Float>, orientation: simd_quatf)

The position of the center of mass and the orientation of the principal axes.

Comparing Mass Properties

static func == (PhysicsMassProperties, PhysicsMassProperties) -> Bool

Indicates whether two physics mass properties are equal.

static func != (PhysicsMassProperties, PhysicsMassProperties) -> Bool

Indicates whether two physics mass properties are not equal.

Relationships

Conforms To

See Also

Setting Mass Properties

var massProperties: PhysicsMassProperties

The physics body’s mass properties, like inertia and center of mass.