PhysicsSystem
public class PhysicsSystem: PhysicsSolving
-
The velocity value to use in physics calculations.
Declaration
Swift
public var velocity: Double
-
The friction value to be applied in physics calculations.
Declaration
Swift
public var friction: Double
-
Declaration
Swift
public var timestamp: TimeInterval = 0.0
-
Initializer.
Declaration
Swift
public init(velocity: Double, friction: Double)
Parameters
velocity
The velocity used to calculate new values in physics system. Any values are accepted due to the differing ranges of velocity magnitude required for various motion applications. Experiment to see what suits your needs best.
friction
The friction used to calculate new values in the physics system. Acceptable values are 0.0 (no friction) to 1.0 (no movement); values outside of this range will be clamped to the nearest edge.
-
Declaration
Swift
public func solve(forPositions positions: [Double], timestamp: TimeInterval) -> [Double]
-
Declaration
Swift
public func reset()
-
Declaration
Swift
public func pause()
-
Declaration
Swift
public func resume()
-
Declaration
Swift
public func reverseDirection()