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.