class Pose


Represents an immutable rigid transformation from one coordinate space to another.

Summary

Public companion functions

Float
distance(lhs: Pose, rhs: Pose)

Returns the distance between the two poses.

Pose
fromLookAt(eye: Vector3, target: Vector3, up: Vector3)

Returns a new pose oriented to look at target from eye position with up as the up vector.

Pose
lerp(start: Pose, end: Pose, ratio: Float)

Returns a new pose that is linearly interpolated between start and end using the interpolation amount ratio.

Public companion properties

Pose

Returns a new pose using the identity rotation.

Public constructors

Pose(other: Pose)

Creates a new pose with the same values as the other pose.

Pose(translation: Vector3, rotation: Quaternion)

Public functions

infix Pose
compose(other: Pose)

Returns the result of composing this with other.

Pose
copy(translation: Vector3, rotation: Quaternion)

Returns a copy of the pose.

open operator Boolean
equals(other: Any?)

Returns true if this pose is equal to the other.

open Int
Pose
rotate(rotation: Quaternion)

Rotates this pose by the given rotation.

open String
infix Vector3

Transforms the provided point by the pose by applying both the rotation and the translation components of the pose.

infix Vector3

Transforms the provided vector by the pose by only applying the rotation component of the pose.

Pose
translate(translation: Vector3)

Translates this pose by the given translation.

Public properties

Vector3

The backward vector in the local coordinate system.

Vector3

The down vector in the local coordinate system.

Vector3

The forward vector in the local coordinate system.

Pose

Returns a pose that performs the opposite translation.

Vector3

The left vector in the local coordinate system.

Vector3

The right vector in the local coordinate system.

Quaternion

the rotation component of this pose.

Vector3

the translation component of this pose.

Vector3

The up vector in the local coordinate system.

Public companion functions

distance

Added in 1.0.0-alpha01
fun distance(lhs: Pose, rhs: Pose): Float

Returns the distance between the two poses.

fromLookAt

Added in 1.0.0-alpha01
fun fromLookAt(eye: Vector3, target: Vector3, up: Vector3 = Vector3.Up): Pose

Returns a new pose oriented to look at target from eye position with up as the up vector.

Parameters
eye: Vector3

the position from which to look at target.

target: Vector3

the target position to look at.

up: Vector3 = Vector3.Up

a vector indicating the general "up" direction.

Returns
Pose

the pose oriented to look at target from eye position with up as the up vector.

lerp

Added in 1.0.0-alpha01
fun lerp(start: Pose, end: Pose, ratio: Float): Pose

Returns a new pose that is linearly interpolated between start and end using the interpolation amount ratio. The position is lerped, but the rotation will be slerped if the angles are far apart.

If ratio is outside of the range [0, 1], the returned pose will be extrapolated.

Public companion properties

Identity

val IdentityPose

Returns a new pose using the identity rotation.

Public constructors

Pose

Added in 1.0.0-alpha01
Pose(other: Pose)

Creates a new pose with the same values as the other pose.

Pose

Added in 1.0.0-alpha01
Pose(translation: Vector3 = Vector3(), rotation: Quaternion = Quaternion())

Public functions

compose

Added in 1.0.0-alpha01
infix fun compose(other: Pose): Pose

Returns the result of composing this with other.

copy

Added in 1.0.0-alpha01
fun copy(
    translation: Vector3 = this.translation,
    rotation: Quaternion = this.rotation
): Pose

Returns a copy of the pose.

equals

open operator fun equals(other: Any?): Boolean

Returns true if this pose is equal to the other.

hashCode

open fun hashCode(): Int

rotate

Added in 1.0.0-alpha01
fun rotate(rotation: Quaternion): Pose

Rotates this pose by the given rotation.

toString

open fun toString(): String

transformPoint

Added in 1.0.0-alpha01
infix fun transformPoint(point: Vector3): Vector3

Transforms the provided point by the pose by applying both the rotation and the translation components of the pose. This is because a point represents a specific location in space. It needs to account for the position, scale and orientation of the space it is in.

transformVector

Added in 1.0.0-alpha01
infix fun transformVector(vector: Vector3): Vector3

Transforms the provided vector by the pose by only applying the rotation component of the pose. This is because a vector represents a direction and magnitude, not a specific location. It only needs to account for the scale and orientation of the space it is in since it has no position.

translate

Added in 1.0.0-alpha01
fun translate(translation: Vector3): Pose

Translates this pose by the given translation.

Public properties

backward

Added in 1.0.0-alpha01
val backwardVector3

The backward vector in the local coordinate system.

down

Added in 1.0.0-alpha01
val downVector3

The down vector in the local coordinate system.

forward

Added in 1.0.0-alpha01
val forwardVector3

The forward vector in the local coordinate system.

inverse

Added in 1.0.0-alpha01
val inversePose

Returns a pose that performs the opposite translation.

left

Added in 1.0.0-alpha01
val leftVector3

The left vector in the local coordinate system.

right

Added in 1.0.0-alpha01
val rightVector3

The right vector in the local coordinate system.

rotation

Added in 1.0.0-alpha01
val rotationQuaternion

the rotation component of this pose.

translation

Added in 1.0.0-alpha01
val translationVector3

the translation component of this pose.

up

Added in 1.0.0-alpha01
val upVector3

The up vector in the local coordinate system.