Vector4Base
public struct Vector4Base<VectorType> where VectorType : Addable
A 4-dimensional vector.
-
The number of components in a
Vector4Baseinstance.Declaration
Swift
public static var numberOfComponents: Int { get }
-
The values of the vector.
Declaration
Swift
public private(set) var components: [VectorType] -
The x coordinate of the vector (the first component).
Declaration
Swift
public var x: VectorType { get set } -
The y coordinate of the vector (the second component).
Declaration
Swift
public var y: VectorType { get set } -
The z coordinate of the vector (the third component).
Declaration
Swift
public var z: VectorType { get set } -
The w coordinate of the vector (the fourth component).
Declaration
Swift
public var w: VectorType { get set } -
Initializse the zero vector.
Declaration
Swift
public init() -
Initializes a
VectorBasewith the given values.Declaration
Swift
public init(x: VectorType, y: VectorType, z: VectorType, w: VectorType)Parameters
xThe first component of the vector.
yThe second component of the vector.
zThe third component of the vector.
wThe fourth component of the vector.
-
Provides access to the underlying components of this instance.
Declaration
Swift
public subscript(index: Int) -> VectorType { get set }Parameters
indexThe index of the component to access.
Return Value
The component at the given index.
-
The color white.
Declaration
Swift
public static var white: Vector4Base<Double> { get } -
The color black.
Declaration
Swift
public static var black: Vector4Base<Double> { get } -
The color black with zero alpha.
Declaration
Swift
public static var clear: Vector4Base<Double> { get } -
The color red.
Declaration
Swift
public static var red: Vector4Base<Double> { get } -
The color green.
Declaration
Swift
public static var green: Vector4Base<Double> { get } -
The color blue.
Declaration
Swift
public static var blue: Vector4Base<Double> { get } -
The color yellow.
Declaration
Swift
public static var yellow: Vector4Base<Double> { get } -
The color magenta.
Declaration
Swift
public static var magenta: Vector4Base<Double> { get } -
The color cyan.
Declaration
Swift
public static var cyan: Vector4Base<Double> { get } -
The color purple.
Declaration
Swift
public static var purple: Vector4Base<Double> { get } -
The color brown.
Declaration
Swift
public static var brown: Vector4Base<Double> { get } -
The color orange.
Declaration
Swift
public static var orange: Vector4Base<Double> { get } -
The color gray.
Declaration
Swift
public static var gray: Vector4Base<Double> { get } -
The color light gray.
Declaration
Swift
public static var lightGray: Vector4Base<Double> { get } -
The color dark gray.
Declaration
Swift
public static var darkGray: Vector4Base<Double> { get } -
The color dark red.
Declaration
Swift
public static var darkRed: Vector4Base<Double> { get } -
The color dark green.
Declaration
Swift
public static var darkGreen: Vector4Base<Double> { get } -
The color dark blue.
Declaration
Swift
public static var darkBlue: Vector4Base<Double> { get } -
The red component of the vector (equivalent to x).
Declaration
Swift
public var r: VectorType { get set } -
The green component of the vector (equivalent to y).
Declaration
Swift
public var g: VectorType { get set } -
The blue component of the vector (equivalent to z).
Declaration
Swift
public var b: VectorType { get set } -
The alpha component of the vector (equivalent to w).
Declaration
Swift
public var a: VectorType { get set } -
The red component of the vector (equivalent to r).
Declaration
Swift
public var red: VectorType { get set } -
The green component of the vector (equivalent to g).
Declaration
Swift
public var green: VectorType { get set } -
The blue component of the vector (equivalent to b).
Declaration
Swift
public var blue: VectorType { get set } -
The blue component of the vector (equivalent to a).
Declaration
Swift
public var alpha: VectorType { get set }
-
The unit vector in the x direction.
Declaration
Swift
public static var unitX: Vector4Base<VectorType> { get } -
The unit vector in the y direction.
Declaration
Swift
public static var unitY: Vector4Base<VectorType> { get } -
The unit vector in the z direction.
Declaration
Swift
public static var unitZ: Vector4Base<VectorType> { get } -
The unit vector in the w direction.
Declaration
Swift
public static var unitW: Vector4Base<VectorType> { get }
Vector4Base Structure Reference