Vector4

public struct Vector4

A vector with 4 component.

  • x

    Component at index 0

    Declaration

    Swift

    public var x: Scalar
  • y

    Component at index 1

    Declaration

    Swift

    public var y: Scalar
  • z

    Component at index 2

    Declaration

    Swift

    public var z: Scalar
  • w

    Component at index 3

    Declaration

    Swift

    public var w: Scalar
  • Creates a new Vector4 instance.

    Declaration

    Swift

    public init(x: Scalar, y: Scalar, z: Scalar, w: Scalar)
  • Creates a vector for which all components are equal to the given scalar.

    Declaration

    Swift

    public init(scalar: Scalar)
  • The number of scalar components in this vector type.

    Declaration

    Swift

    public static var length: Int { get }
  • The empty vector (all scalar components are equal to 0.0).

    Declaration

    Swift

    public static var zero: Vector4 { get }
  • Declaration

    Swift

    public subscript(index: Int) -> Scalar { get set }
  • Declaration

    Swift

    public func clamped(min: Vector4, max: Vector4) -> Vector4
  • Interpolate between the given values.

    Declaration

    Swift

    public func interpolated(to otherValue: Vector4, alpha: Scalar) -> Vector4
  • Interpolate between the given values.

    Declaration

    Swift

    public mutating func interpolate(to otherValue: Vector4, alpha: Scalar)
  • Equatable.

    Declaration

    Swift

    public static func == (lhs: Vector4, rhs: Vector4) -> Bool
  • Product.

    Declaration

    Swift

    public static func * (lhs: Vector4, rhs: Vector4) -> Vector4
  • Product (in place).

    Declaration

    Swift

    public static func *= (lhs: inout Vector4, rhs: Vector4)
  • Quotient

    Declaration

    Swift

    public static func / (lhs: Vector4, rhs: Vector4) -> Vector4
  • Quotient (in place).

    Declaration

    Swift

    public static func /= (lhs: inout Vector4, rhs: Vector4)
  • Sum.

    Declaration

    Swift

    public static func + (lhs: Vector4, rhs: Vector4) -> Vector4
  • Sum (in place).

    Declaration

    Swift

    public static func += (lhs: inout Vector4, rhs: Vector4)
  • Difference.

    Declaration

    Swift

    public static func - (lhs: Vector4, rhs: Vector4) -> Vector4
  • Difference (in place).

    Declaration

    Swift

    public static func -= (lhs: inout Vector4, rhs: Vector4)
  • Scalar-Vector product.

    Declaration

    Swift

    public static func * (lhs: Scalar, rhs: Vector4) -> Vector4