springForcing

fun Clock.springForcing(property: KProperty0<Double>, k: Double = 1.0, kProperty: KProperty0<Double>? = null, decay: Double = 0.9, decayProperty: KProperty0<Double>? = null): DoublePropertySpringForcer(source)
fun <T : LinearType<T>> Clock.springForcing(property: KProperty0<T>, k: Double = 1.0, kProperty: KProperty0<Double>? = null, decay: Double = 0.9, decayProperty: KProperty0<Double>? = null): LinearTypePropertySpringForcer<T>(source)

Create a property spring force delegate

Since

0.4.3

Parameters

property

the property that is used as the spring anchor

k

the spring stiffness

kProperty

the spring stiffness property, overrides k

decay

velocity decay, best to set to < 1

decayProperty

velocity decay property, overrides decay