@@ -698,6 +698,7 @@ module.exports = {
698
698
*
699
699
* - `velocity`: Initial velocity. Required.
700
700
* - `deceleration`: Rate of decay. Default 0.997.
701
+ * - `isInteraction`: Whether or not this animation creates an "interaction handle" on the `InteractionManager`. Default true.
701
702
* - `useNativeDriver`: Uses the native driver when true. Default false.
702
703
*/
703
704
decay,
@@ -712,21 +713,49 @@ module.exports = {
712
713
* - `easing`: Easing function to define curve.
713
714
* Default is `Easing.inOut(Easing.ease)`.
714
715
* - `delay`: Start the animation after delay (milliseconds). Default 0.
716
+ * - `isInteraction`: Whether or not this animation creates an "interaction handle" on the `InteractionManager`. Default true.
715
717
* - `useNativeDriver`: Uses the native driver when true. Default false.
716
718
*/
717
719
timing,
718
720
/**
719
- * Spring animation based on Rebound and
720
- * [Origami](https://facebook.github.io/origami/). Tracks velocity state to
721
- * create fluid motions as the `toValue` updates, and can be chained together.
721
+ * Animates a value according to an analytical spring model based on
722
+ * [damped harmonic oscillation](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator).
723
+ * Tracks velocity state to create fluid motions as the `toValue` updates, and
724
+ * can be chained together.
722
725
*
723
- * Config is an object that may have the following options. Note that you can
724
- * only define bounciness/speed or tension/friction but not both:
726
+ * Config is an object that may have the following options.
727
+ *
728
+ * Note that you can only define one of bounciness/speed, tension/friction, or
729
+ * stiffness/damping/mass, but not more than one:
730
+ *
731
+ * The friction/tension or bounciness/speed options match the spring model in
732
+ * [Facebook Pop](https://github.com/facebook/pop), [Rebound](http://facebook.github.io/rebound/),
733
+ * and [Origami](http://origami.design/).
725
734
*
726
735
* - `friction`: Controls "bounciness"/overshoot. Default 7.
727
736
* - `tension`: Controls speed. Default 40.
728
737
* - `speed`: Controls speed of the animation. Default 12.
729
738
* - `bounciness`: Controls bounciness. Default 8.
739
+ *
740
+ * Specifying stiffness/damping/mass as parameters makes `Animated.spring` use an
741
+ * analytical spring model based on the motion equations of a [damped harmonic
742
+ * oscillator](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator).
743
+ * This behavior is slightly more precise and faithful to the physics behind
744
+ * spring dynamics, and closely mimics the implementation in iOS's
745
+ * CASpringAnimation primitive.
746
+ *
747
+ * - `stiffness`: The spring stiffness coefficient. Default 100.
748
+ * - `damping`: Defines how the spring’s motion should be damped due to the forces of friction. Default 10.
749
+ * - `mass`: The mass of the object attached to the end of the spring. Default 1.
750
+ *
751
+ * Other configuration options are as follows:
752
+ *
753
+ * - `velocity`: The initial velocity of the object attached to the spring. Default 0 (object is at rest).
754
+ * - `overshootClamping`: Boolean indiciating whether the spring should be clamped and not bounce. Default false.
755
+ * - `restDisplacementThreshold`: The threshold of displacement from rest below which the spring should be considered at rest. Default 0.001.
756
+ * - `restSpeedThreshold`: The speed at which the spring should be considered at rest in pixels per second. Default 0.001.
757
+ * - `delay`: Start the animation after delay (milliseconds). Default 0.
758
+ * - `isInteraction`: Whether or not this animation creates an "interaction handle" on the `InteractionManager`. Default true.
730
759
* - `useNativeDriver`: Uses the native driver when true. Default false.
731
760
*/
732
761
spring,
0 commit comments