Vector3

public struct Vector3

A vector with 3 components.

  • 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
  • Creates a new Vector3 instance.

    Declaration

    Swift

    public init(_ x: Scalar, _ y: Scalar, _ z: 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
  • The empty vector (all scalar components are equal to 0.0).

    Declaration

    Swift

    public static var zero: Vector3
  • Interpolate between the given values.

    Declaration

    Swift

    public func interpolatedTo(to: Vector3, alpha: Scalar) -> Vector3
  • Interpolate between the given values.

    Declaration

    Swift

    public mutating func interpolateTo(to: Vector3, alpha: Scalar)