SpatialWheelMotion

The wheel's turn as it is shown, stepped once per frame. A drag sets where the wheel is heading; each frame eases the shown turn toward it, and a release with some speed keeps the wheel spinning until friction stops it. Times are in seconds, angles in radians.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

True while there is still something to move.

Link copied to clipboard
Link copied to clipboard

The turn on screen.

Link copied to clipboard

Where the shown turn is heading.

Link copied to clipboard

Speed of a released spin, zero when not coasting.

Functions

Link copied to clipboard
fun drag(yaw: Float, time: Double)

The hand has moved the wheel to yaw at time.

Link copied to clipboard
fun grab(): Float

Halts the wheel where it is and returns the turn a drag should start from.

Link copied to clipboard
fun release(time: Double)

The hand let go at time: a quick enough spin carries on.

Link copied to clipboard
fun reset()

Swings back to north the short way round.

Link copied to clipboard
fun step(dt: Double): Boolean

Advances one frame and returns true when the shown turn changed.

Link copied to clipboard
fun stop()

Stops a coast where it is. A swing back to north carries on, since the taps of the double tap that started it also arrive here.