A component that controls the motion of the body in physics simulations.


struct PhysicsMotionComponent


You specify velocities in the coordinate space of the physics simulation defined by physicsOrigin.

The behavior of an entity with a physics motion component depends on the entity’s mode setting:


The physics simulation ignores the velocities. The entity doesn’t move.


The physics simulation moves the body according to the values you set for angularVelocity and linearVelocity.


The physics simulation overwrites the velocity values based on simulation, and ignores any values that you write.


Creating the Motion Component


Creates a physics motion component at rest.

init(linearVelocity: SIMD3<Float>, angularVelocity: SIMD3<Float>)

Creates a physics motion component with the given velocities.

Setting Velocity

var angularVelocity: SIMD3<Float>

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

var linearVelocity: SIMD3<Float>

The linear velocity of the body in the physics simulation.

Registering a Component Type

static func registerComponent()

Registers a new component type.

Comparing Physics Motion Components

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

Indicates whether two physics motion components are equal.

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

Indicates whether two physics motion components are not equal.


Conforms To

See Also

Simulating Movement

var physicsMotion: PhysicsMotionComponent?

The physics motion component used by physics simulations of the model entity.

protocol HasPhysicsMotion

An interface that provides velocity properties for physics simulations.

protocol HasPhysics

An interface that combines the physics body and physics motion interfaces.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software