CollisionCalculator

class CollisionCalculator

Calculates collision during the animation

  • Calculates collisions start positions

    Declaration

    Swift

    func calculateCollisionDegrees(sliceDegree: CGFloat, rotationDegreeOffset: CGFloat, rotationDegree: CGFloat, animationDuration: CFTimeInterval)

    Parameters

    sliceDegree

    Slice degree

    rotationDegreeOffset

    Rotation degree offset

    rotationDegree

    Animation full rotation degree

    animationDuration

    Animation duration time

  • Calculates collisions if needed

    Declaration

    Swift

    func calculateCollisionsIfNeeded(layerRotationZ: Double?, onCollision: ((_ progress: Double?) -> Void)? = nil)

    Parameters

    layerRotationZ

    Animation layer rotation Z position

    onCollision

    On collision callback

  • Resets parameters

    Declaration

    Swift

    func reset()