One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

Transform

struct · iOS 13.0+ · SDK 27.1

@frozen struct Transform

A component that defines the scale, rotation, and translation of an entity. An entity acquires a ``Transform`` component, as well as a set of methods for manipulating the transform, by adopting the ``HasTransform`` protocol. This is true for all entities, because the ``Entity`` base class adopts the protocol.

Members (17)

init · iOS 26.0+

init

TypeScript
static initProjectiveTransform(projectiveTransform: _Spatial_ProjectiveTransform3D): Transform
Swift declaration
init(projectiveTransform: ProjectiveTransform3D)

A convenience initializer for the Transform Component that takes a `ProjectiveTransform3D`

init · iOS 26.0+

init

TypeScript
static initProjectiveTransform30286(projectiveTransform: _Spatial_ProjectiveTransform3DFloat): Transform
Swift declaration
init(projectiveTransform: ProjectiveTransform3DFloat)

A convenience initializer for the Transform Component that takes a `ProjectiveTransform3DFloat`

get · iOS 13.0+

translation

TypeScript
get translation(): SDKHandle
Swift declaration
var translation: SIMD3<Float>

The position of the entity along the x, y, and z axes.

set · iOS 13.0+

translation

TypeScript
set translation(value: SDKHandle)
Swift declaration
var translation: SIMD3<Float>

The position of the entity along the x, y, and z axes.

init · iOS 13.0+

init

TypeScript
static initPitchYawRoll(x?: number, y?: number, z?: number): Transform
Swift declaration
init(pitch x: Float = 0, yaw y: Float = 0, roll z: Float = 0)

Creates a new transform from the specified Euler angles. The rotation order using intrinsic rotation order is defined as: 1. Rotate around y-axis (yaw). 2. Rotate around the body-fixed x-axis (pitch). 3. Rotate around the body-fixed z-axis (roll). The rotation order using extrinsic rotation order is defined as: 1. Rotate around the z-axis (roll). 2. Rotate around the world space x-axis (pitch). 3. Rotate around the world space y-axis (yaw). - Parameters: - x: The rotation around the x-axis in radians. - y: The rotation around the y-axis in radians. - z: The rotation around the z-axis in radians.

init · iOS 13.0+

init

TypeScript
static initScaleRotationTranslation(scale?: SDKHandle, rotation?: SDKHandle, translation?: SDKHandle): Transform
Swift declaration
init(scale: SIMD3<Float> = SIMD3<Float>(x: 1, y: 1, z: 1), rotation: simd_quatf = simd_quaternion(0, 0, 0, 1), translation: SIMD3<Float> = SIMD3<Float>(x: 0, y: 0, z: 0))

Creates a new transformation using the given values. - Parameters: - scale: A scale factor. - rotation: The rotation given as a unit quaternion. - translation: The translation, or position along the x, y, and z axes.

get · iOS 13.0+

scale

TypeScript
get scale(): SDKHandle
Swift declaration
var scale: SIMD3<Float>

The scaling factor applied to the entity.

set · iOS 13.0+

scale

TypeScript
set scale(value: SDKHandle)
Swift declaration
var scale: SIMD3<Float>

The scaling factor applied to the entity.

init · iOS 13.0+

init

TypeScript
static initMatrix(matrix: SDKHandle): Transform
Swift declaration
init(matrix: float4x4)

Creates a new transform represented as a 4x4 matrix. A ``RealityKit/Transform`` component can’t represent every transform that a general 4x4 matrix can . Using a 4x4 matrix during initialization might result in certain transformations, such as shear, being lost. - Parameters: - matrix: A transformation matrix.

get · iOS 13.0+

matrix

TypeScript
get matrix(): SDKHandle
Swift declaration
var matrix: float4x4 { get set }

The transform represented as a 4x4 matrix. The ``Transform`` component can’t represent all transforms that a general 4x4 matrix can represent. Using a 4x4 matrix to set the transform is therefore a lossy event that might result in certain transformations, like shear, being dropped.

set · iOS 13.0+

matrix

TypeScript
set matrix(value: SDKHandle)
Swift declaration
var matrix: float4x4 { get set }

The transform represented as a 4x4 matrix. The ``Transform`` component can’t represent all transforms that a general 4x4 matrix can represent. Using a 4x4 matrix to set the transform is therefore a lossy event that might result in certain transformations, like shear, being dropped.

method · iOS 26.0+

applying

TypeScript
applying(transform: _Spatial_ProjectiveTransform3DFloat): Transform
Swift declaration
func applying(_ transform: ProjectiveTransform3DFloat) -> Transform

Returns a transformed copy of the value. - Parameter transform: A transform the function applies to the value.

get · iOS 13.0+

identity

TypeScript
static get identity(): Transform
Swift declaration
static let identity: Transform

The identity transform. The identity transform is defined as `scale = (1, 1, 1)`, `rotation = (0, 0, 0, 1)`, and `translation = (0, 0, 0)`.

get · iOS 13.0+

rotation

TypeScript
get rotation(): SDKHandle
Swift declaration
var rotation: simd_quatf

The rotation of the entity specified as a unit quaternion.

set · iOS 13.0+

rotation

TypeScript
set rotation(value: SDKHandle)
Swift declaration
var rotation: simd_quatf

The rotation of the entity specified as a unit quaternion.

init · iOS 13.0+

init

TypeScript
static init(): Transform
Swift declaration
init()

Creates a transform with the values of the identity transform.

init · iOS 18.0+

init

TypeScript
static init58499(transform: _Spatial_AffineTransform3D): Transform
Swift declaration
init(_ transform: AffineTransform3D)

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →