Matrix4Base

public struct Matrix4Base<MatrixType>:
    Equatable, MatrixBase, ConstantSizeMatrix, SquareMatrix
    where MatrixType: MatrixElementType

A 4x4 matrix. Conforms to Equatable, MatrixBase, ConstantSizeMatrix, and SquareMatrix. Conforms to MatrixOperationsBase by the extensions in VariableSizeMatrix.

  • The type of the matrix’s elements.

    Declaration

    Swift

    public typealias ElementType = MatrixType
  • The number of rows and columns of the matrix. Self.dimensions and self.dimensions must equal size for both components.

    Declaration

    Swift

    public static var size: Int { get }
  • The identity 4x4 matrix.

    Declaration

    Swift

    public static var identity: Matrix4Base<MatrixType> { get }
  • The values of the matrix. The number of elements must equal the number of rows times the number of columns.

    Declaration

    Swift

    public private(set) var elements: [MatrixType]
  • Initializes this instance with the specified elements. If elements does not contain enough values, the remaining elements are initialized to 0. If elements contains too many elements, the extra values are ignored.

    Declaration

    Swift

    public init(elements: [MatrixType])

    Return Value

    a matrix initialized with the values of elements.

  • Provides access to the individual elements.

    Declaration

    Swift

    public subscript(index: Int) -> MatrixType { get set }

    Parameters

    index

    The index of the element to get or set.

    Return Value

    The value of the element at the given index.