VectorConvertible
public protocol VectorConvertible: Equatable, Interpolatable
Conforming types can be converted to and from vector types.
-
The concrete VectorType implementation that can represent the conforming type.
Declaration
Swift
associatedtype VectorType: Vector
-
Creates a new instance from a vector.
Declaration
Swift
init(vector: VectorType)
-
The vector representation of this instance.
Declaration
Swift
var vector: VectorType
-
zero
Extension methodReturns an instance initialized using the zero vector.
Declaration
Swift
public static var zero: Self
-
interpolated(to:alpha:)
Extension methodInterpolates between values.
Declaration
Swift
public func interpolated(to otherValue: Self, alpha: Scalar) -> Self
Parameters
to
The value to interpolate to.
alpha
The amount (between 0.0 and 1.0) to interpolate, where
0
returns the receiver, and1
returns theto
value.Return Value
The interpolated result.
-
springAnimation(to:initialVelocity:tension:damping:threshold:)
Extension methodReturns a spring animation with the given properties.
Declaration
Swift
public func springAnimation(to target: Self, initialVelocity: Self = .zero, tension: Scalar = 30.0, damping: Scalar = 5.0, threshold: Scalar = 0.1) -> SimulatedAnimation<Self, SpringFunction<Self.VectorType>>
-
animation(to:duration:timingFunction:)
Extension methodUndocumented
Declaration
Swift
public func animation(to finalValue: Self, duration: Double, timingFunction: TimingFunction = UnitBezier.swiftOut) -> BasicAnimation<Self>
-
decayAnimation(initialVelocity:drag:threshold:)
Extension methodReturns a decay animation with the given properties.
Declaration
Swift
public func decayAnimation(initialVelocity: Self, drag: Scalar = 3.0, threshold: Scalar = 0.1) -> SimulatedAnimation<Self, DecayFunction<Self.VectorType>>