A component that controls localized physics simulations.
Simulate local physics by adding a ``PhysicsSimulationComponent`` to an entity.
The component gives your app the ability to customize the physics simulation
by configuring its properties, such as ``gravity`` and ``collisionOptions``.
- Important: Each physics simulation component uses meters as its unit of distance,
which can be important to other types in the physics simulation, such as
``ShapeResource`` instances.
Obtains the entity containing the physics simulation origin.
The simulation origin is the nearest parent object where a ``PhysicsSimulationComponent``
exists, or the root entity (normally the anchor) where the default simulation is embedded.
- Parameters:
- entity: The entity to find the physics simulation origin for.
- Returns:The entity containing the physics simulation origin or `nil` if the entity doesn't have a parent object in the scene.
get · iOS 18.0+
collisionOptions
TypeScript
get collisionOptions(): PhysicsSimulationComponent_CollisionOptions
Swift declaration
var collisionOptions: PhysicsSimulationComponent.CollisionOptions
Options for kinematic collision reporting.
set · iOS 18.0+
collisionOptions
TypeScript
set collisionOptions(value: PhysicsSimulationComponent_CollisionOptions)
Swift declaration
var collisionOptions: PhysicsSimulationComponent.CollisionOptions
Options for kinematic collision reporting.
get · iOS 18.0+
solverIterations
TypeScript
get solverIterations(): PhysicsSimulationComponent_SolverIterations
Swift declaration
var solverIterations: PhysicsSimulationComponent.SolverIterations
The parameters that control the accuracy of solving physics simulations.
set · iOS 18.0+
solverIterations
TypeScript
set solverIterations(value: PhysicsSimulationComponent_SolverIterations)
Swift declaration
var solverIterations: PhysicsSimulationComponent.SolverIterations
The parameters that control the accuracy of solving physics simulations.
get · iOS 18.0+
clock
TypeScript
get clock(): unknown
Swift declaration
var clock: CMClockOrTimebase { get set }
A custom clock which drives the physics simulation, defaults to the engine clock.
set · iOS 18.0+
clock
TypeScript
set clock(value: unknown)
Swift declaration
var clock: CMClockOrTimebase { get set }
A custom clock which drives the physics simulation, defaults to the engine clock.
get · iOS 18.0+
gravity
TypeScript
get gravity(): SDKHandle
Swift declaration
var gravity: SIMD3<Float>
The gravity for the simulation relative to the simulation entity.
The value stored in this property is the gravitational acceleration applied to dynamic physics body entities every frame along the negative world y-axis.
The default value is `-9.81` meters per second squared.
set · iOS 18.0+
gravity
TypeScript
set gravity(value: SDKHandle)
Swift declaration
var gravity: SIMD3<Float>
The gravity for the simulation relative to the simulation entity.
The value stored in this property is the gravitational acceleration applied to dynamic physics body entities every frame along the negative world y-axis.
The default value is `-9.81` meters per second squared.