Rotation

data class Rotation @JvmOverloads constructor(val yaw: Float, val pitch: Float, val isNormalized: Boolean = false) : Record

Constructors

Link copied to clipboard
constructor(yaw: Float, pitch: Float, isNormalized: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val directionVector: Vec3
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val xRot: Float
Link copied to clipboard
val yaw: Float
Link copied to clipboard
val yRot: Float

Functions

Link copied to clipboard
fun angleTo(other: Rotation): Float

Calculates the angle between this and the other rotation.

Link copied to clipboard
fun approximatelyEquals(other: Rotation, tolerance: Float = 2.0f): Boolean
Link copied to clipboard

Fixes GCD and Modulo 360° at yaw

Link copied to clipboard

Calculates what angles would need to be added to arrive at other.

Link copied to clipboard
fun toQuaternion(dest: Quaternionf = Quaternionf()): Quaternionf
Link copied to clipboard
fun towardsLinear(other: Rotation, horizontalFactor: Float, verticalFactor: Float): Rotation

Calculates a new rotation that is closer to the other rotation by a limiting factor of horizontalFactor and verticalFactor, which should be between 0 and 180 degrees.