SimulationFunction
public protocol SimulationFunction
Conforming types implement a dynamic function that models changes to a vector over time.
-
The type of vector driven by the simulation
Declaration
Swift
associatedtype Value : VectorConvertible
-
The computed acceleration for a given simulation state.
Declaration
Parameters
value
The current value of the simulation.
velocity
The current velocity of the simulation.
Return Value
A vector containing the acceleration (in units per second) based on
value
andvelocity
. -
Determines whether the simulation can converge (come to rest) for the given state.
Declaration
Swift
func convergence(value: Value.VectorType, velocity: Value.VectorType) -> Convergence<Value>