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