Contents

nearestSimulationEntity(for:)

Obtains the entity containing the physics simulation origin.

Declaration

static func nearestSimulationEntity(for entity: Entity) -> Entity?

Parameters

  • entity:

    The entity to find the physics simulation origin for.

Return Value

The entity containing the physics simulation origin or nil if the entity doesn’t have a parent object in the scene.

Discussion

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.