One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicsMotionComponent

struct · iOS 13.0+ · SDK 27.1

struct PhysicsMotionComponent

A component that controls the motion of the body in physics simulations. You specify velocities in the coordinate space of the physics simulation defined by ``PhysicsSimulationComponent/nearestSimulationEntity(for:)``. The behavior of an entity with a physics motion component depends on the entity’s ``PhysicsBodyComponent/mode`` setting: - term ``PhysicsBodyMode/static``: The physics simulation ignores the velocities. The entity doesn’t move. - term ``PhysicsBodyMode/kinematic``: The physics simulation moves the body according to the values you set for ``PhysicsMotionComponent/angularVelocity`` and ``PhysicsMotionComponent/linearVelocity``. - term ``PhysicsBodyMode/dynamic``: The physics simulation overwrites the velocity values based on simulation, and ignores any values that you write.

Members (6)

init · iOS 13.0+

init

TypeScript
static initLinearVelocityAngularVelocity(linearVelocity?: SDKHandle, angularVelocity?: SDKHandle): PhysicsMotionComponent
Swift declaration
init(linearVelocity: SIMD3<Float> = .zero, angularVelocity: SIMD3<Float> = .zero)

Creates a physics motion component with the given velocities.

get · iOS 13.0+

linearVelocity

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

The linear velocity of the body in the physics simulation.

set · iOS 13.0+

linearVelocity

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

The linear velocity of the body in the physics simulation.

get · iOS 13.0+

angularVelocity

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

The angular velocity of the body around the center of mass.

set · iOS 13.0+

angularVelocity

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

The angular velocity of the body around the center of mass.

init · iOS 13.0+

init

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

Creates a physics motion component at rest.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →