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