DiscreteRotation


value class DiscreteRotation


Kotlin value class that represents fixed 0, 90, 180, 270 degree rotations with utility functions for adding and subtracting discrete rotations from each other.

A DiscreteRotation represents integer degrees in fixed 90 degree increments.

Summary

Public companion functions

DiscreteRotation
from(degrees: Int)

Convert integer degrees to a DiscreteRotation

DiscreteRotation
fromSurfaceRotation(surfaceRotation: Int)

Get a DiscreteRotation from Surface rotation values.

DiscreteRotation
round(degrees: Float)

Round floating point degrees to a DiscreteRotation.

DiscreteRotation
round(degrees: Int)

Round integer degrees to a DiscreteRotation.

Public functions

inline operator DiscreteRotation
minus(degrees: Int)

Subtract a DiscreteRotation from this, modding the result by 360.

inline operator DiscreteRotation

Subtract a DiscreteRotation from this, modding the result by 360.

inline operator DiscreteRotation
plus(degrees: Int)

Add a DiscreteRotation from this, modding the result by 360.

inline operator DiscreteRotation

Add a DiscreteRotation from this, modding the result by 360.

open String

Public properties

Int

Public companion functions

from

Added in 1.7.0-alpha01
fun from(degrees: Int): DiscreteRotation

Convert integer degrees to a DiscreteRotation

fromSurfaceRotation

Added in 1.7.0-alpha01
fun fromSurfaceRotation(surfaceRotation: Int): DiscreteRotation

Get a DiscreteRotation from Surface rotation values.

round

Added in 1.7.0-alpha01
fun round(degrees: Float): DiscreteRotation

Round floating point degrees to a DiscreteRotation.

round

Added in 1.7.0-alpha01
fun round(degrees: Int): DiscreteRotation

Round integer degrees to a DiscreteRotation.

Public functions

minus

Added in 1.7.0-alpha01
inline operator fun minus(degrees: Int): DiscreteRotation

Subtract a DiscreteRotation from this, modding the result by 360.

minus

Added in 1.7.0-alpha01
inline operator fun minus(other: DiscreteRotation): DiscreteRotation

Subtract a DiscreteRotation from this, modding the result by 360.

plus

Added in 1.7.0-alpha01
inline operator fun plus(degrees: Int): DiscreteRotation

Add a DiscreteRotation from this, modding the result by 360.

plus

Added in 1.7.0-alpha01
inline operator fun plus(other: DiscreteRotation): DiscreteRotation

Add a DiscreteRotation from this, modding the result by 360.

toString

open fun toString(): String

Public properties

degrees

Added in 1.7.0-alpha01
val degreesInt