One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicsMassProperties

struct · iOS 13.0+ · SDK 27.1

struct PhysicsMassProperties

Mass properties of a physics body.

Members (11)

get · iOS 13.0+

centerOfMass

TypeScript
get centerOfMass(): { "position": SDKHandle; "orientation": SDKHandle }
Swift declaration
var centerOfMass: (position: SIMD3<Float>, orientation: simd_quatf)

The position of the center of mass and the orientation of the principal axes. The `position` defines the center of mass with a default value of `(0, 0, 0)`, which means that the local origin of the model is the center of mass. The `orientation` defines the principal axes, such the inertia matrix is a diagonal.

set · iOS 13.0+

centerOfMass

TypeScript
set centerOfMass(value: { "position": SDKHandle; "orientation": SDKHandle })
Swift declaration
var centerOfMass: (position: SIMD3<Float>, orientation: simd_quatf)

The position of the center of mass and the orientation of the principal axes. The `position` defines the center of mass with a default value of `(0, 0, 0)`, which means that the local origin of the model is the center of mass. The `orientation` defines the principal axes, such the inertia matrix is a diagonal.

init · iOS 13.0+

init

TypeScript
static initMassInertiaCenterOfMass(mass: number, inertia?: SDKHandle, centerOfMass?: { "position": SDKHandle; "orientation": SDKHandle }): PhysicsMassProperties
Swift declaration
init(mass: Float, inertia: SIMD3<Float> = SIMD3<Float>(x: 0.1, y: 0.1, z: 0.1), centerOfMass: (position: SIMD3<Float>, orientation: simd_quatf) = (SIMD3<Float>(x: 0, y: 0, z: 0), simd_quatf(ix: 0, iy: 0, iz: 0, r: 1)))

Creates a mass properties instance with the given settings. - Parameters: - mass: The mass in kilograms. If you use a mass of `0` or infinity, the simulation treats the object as ``PhysicsBodyMode/kinematic``. That is, the object doesn’t respond to forces. - inertia: The inertia in kilograms per square meter. The vector contains the diagonal elements of the diagonalized inertia matrix. - centerOfMass: The center of mass and the orientation of the principal axes, defined in the local space of the rigid body. The `position` defines the center of mass with a default value of `(0, 0, 0)`, which means that the local origin of the model is the center of mass. The `orientation` defines the principal axes, such the inertia matrix is a diagonal.

get · iOS 13.0+

mass

TypeScript
get mass(): number
Swift declaration
var mass: Float

The mass in kilograms. For a mass of `0` or infinity, the simulation treats the object as ``PhysicsBodyMode/kinematic``. That is, the object doesn’t respond to forces.

set · iOS 13.0+

mass

TypeScript
set mass(value: number)
Swift declaration
var mass: Float

The mass in kilograms. For a mass of `0` or infinity, the simulation treats the object as ``PhysicsBodyMode/kinematic``. That is, the object doesn’t respond to forces.

init · iOS 13.0+

init

TypeScript
static initShapeMass(shape: ShapeResource, mass: number): Promise<PhysicsMassProperties>
Swift declaration
@MainActor @preconcurrency init(shape: ShapeResource, mass: Float)

Creates the mass properties for a solid shape with the specified mass. - Parameters: - shape: The shape for which to calculate the mass frame. - mass: The mass of the object in kilograms.

init · iOS 13.0+

init

TypeScript
static initShapeDensity(shape: ShapeResource, density: number): Promise<PhysicsMassProperties>
Swift declaration
@MainActor @preconcurrency init(shape: ShapeResource, density: Float)

Creates the mass properties for a solid shape with the specified density. - Parameters: - shape: The shape for which to calculate the mass frame. - density: The density of the object in kilograms per cubic meter.

get · iOS 13.0+

default

TypeScript
static get default(): PhysicsMassProperties
Swift declaration
static let `default`: PhysicsMassProperties

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

get · iOS 13.0+

inertia

TypeScript
get inertia(): SDKHandle
Swift declaration
var inertia: SIMD3<Float>

The inertia in kilograms per square meter. The vector contains the diagonal elements of the diagonalized inertia matrix.

set · iOS 13.0+

inertia

TypeScript
set inertia(value: SDKHandle)
Swift declaration
var inertia: SIMD3<Float>

The inertia in kilograms per square meter. The vector contains the diagonal elements of the diagonalized inertia matrix.

init · iOS 13.0+

init

TypeScript
static init(): PhysicsMassProperties
Swift declaration
init()

Creates a mass properties instance with default settings.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →