Contents

convert(direction:to:)

Converts a direction vector from the local space of the entity on which you called this method to the local space of a reference entity.

Declaration

@MainActor @preconcurrency func convert(direction: SIMD3<Float>, to referenceEntity: Entity?) -> SIMD3<Float>

Parameters

  • direction:

    The direction vector given in the local space of the entity.

  • referenceEntity:

    The entity that defines a frame of reference. Set this to nil to indicate world space.

Return Value

The direction vector specified relative to referenceEntity.

See Also

Converting values between coordinate spaces