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.
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.
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.