matrix_float4x4
public extension matrix_float4x4
extension matrix_float4x4: Interpolatable
-
Returns the identity matrix of a
matrix_double4x4
.Declaration
Swift
static var identity: matrix_float4x4 { get }
-
Returns a
matrix_double4x4
with all zeros.Declaration
Swift
static var zero: matrix_float4x4 { get }
-
Initializes a
matrix_double4x4
with a CATransform3D.Declaration
Swift
init(_ transform: CATransform3D)
-
Decomposes this matrix into its specific transform attributes (scale, translation, etc.) and returns a Decomposed struct to alter / recompose it.
Declaration
Swift
func decomposed() -> DecomposedTransform
-
The translation of the transformation matrix.
Declaration
Swift
var translation: simd_float3 { get set }
-
Returns a copy by translating the current transformation matrix by the given translation amount.
Declaration
Swift
func translated(by translation: simd_float3) -> simd_float4x4
-
Translates the current transformation matrix by the given translation amount.
Declaration
Swift
mutating func translate(by t: simd_float3)
-
The scale of the transformation matrix.
Declaration
Swift
var scale: simd_float3 { get set }
-
Returns a copy by scaling the current transformation matrix by the given scale.
Declaration
Swift
func scaled(by scale: simd_float3) -> simd_float4x4
-
Scales the current transformation matrix by the given scale.
Declaration
Swift
mutating func scale(by s: simd_float3)
-
The rotation of the transformation matrix (expressed as a quaternion).
Declaration
Swift
var rotation: simd_quatf { get set }
-
Returns a copy by applying a rotation transform (expressed as a quaternion) to the current transformation matrix.
Declaration
Swift
func rotated(by quaternion: simd_quatf) -> simd_float4x4
-
Rotates the current rotation by applying a rotation transform (expressed as a quaternion) to the current transformation matrix.
Declaration
Swift
mutating func rotate(by q: simd_quatf)
-
The rotation of the transformation matrix (expressed as euler angles, expressed in radians).
Declaration
Swift
var eulerAngles: simd_float3 { get set }
-
Returns a copy by applying a rotation transform (expressed as euler angles, expressed in radians) to the current transformation matrix.
Declaration
Swift
func rotated(by eulerAngles: simd_float3) -> simd_float4x4
-
Rotates the current rotation by applying a rotation transform (expressed as euler angles, expressed in radians) to the current transformation matrix.
Declaration
Swift
mutating func rotate(by eulerAngles: simd_float3)
-
The skew of the transformation matrix.
Declaration
Swift
var skew: simd_float3 { get set }
-
Returns a copy by skewing the current transformation matrix by a given skew.
Declaration
Swift
func skewed(by skew: simd_float3) -> simd_float4x4
-
Skews the current transformation matrix by the given skew.
Declaration
Swift
mutating func skew(by s: simd_float3)
-
The perspective of the transformation matrix.
Declaration
Swift
var perspective: simd_float4 { get set }
-
Returns a copy by changing the perspective of the current transformation matrix.
Declaration
Swift
func applyingPerspective(_ p: simd_float4) -> simd_float4x4
-
Sets the perspective of the current transformation matrix.
Declaration
Swift
mutating func applyPerspective(_ p: simd_float4)
-
A type to break down a
matrix_float4x4
into its specific transformation attributes / properties (i.e. scale, translation, etc.).Instantiate this using:
matrix_float4x4.decomposed()
.Note
Under the hood this does a conversion to represent its contents asmatrix_double4x4
which could be expensive when done frequently.Declaration
-
Declaration
Swift
public func lerp(to: `Self`, fraction: Float) -> simd_float4x4