Spring

object Spring

Physics class contains a number of recommended configurations for physics animations.

Properties

Link copied to clipboard
const val DampingRatioHighBouncy: Float = 0.2f

Damping ratio for a very bouncy spring. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio, the more bouncy the spring.

Link copied to clipboard
const val DampingRatioLowBouncy: Float = 0.75f

Damping ratio for a spring with low bounciness. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio, the higher the bounciness.

Link copied to clipboard

Damping ratio for a medium bouncy spring. This is also the default damping ratio for spring force. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio, the more bouncy the spring.

Link copied to clipboard
const val DampingRatioNoBouncy: Float = 1.0f

Damping ratio for a spring with no bounciness. This damping ratio will create a critically damped spring that returns to equilibrium within the shortest amount of time without oscillating.

Link copied to clipboard

Default cutoff for rounding off physics based animations

Link copied to clipboard
const val StiffnessHigh: Float

Stiffness constant for extremely stiff spring

Link copied to clipboard
const val StiffnessLow: Float = 200.0f

Stiffness constant for a spring with low stiffness.

Link copied to clipboard
const val StiffnessMedium: Float = 1500.0f

Stiffness constant for medium stiff spring. This is the default stiffness for spring force.

Link copied to clipboard
const val StiffnessMediumLow: Float = 400.0f

Stiffness constant for medium-low stiff spring. This is the default stiffness for springs used in enter/exit transitions.

Link copied to clipboard
const val StiffnessVeryLow: Float = 50.0f

Stiffness constant for a spring with very low stiffness.