public final class Pose


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

Summary

Public fields

static final @NonNull Pose

Returns a new pose using the identity rotation.

Public constructors

Pose(@NonNull Pose other)

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

Pose(@NonNull Vector3 translation, @NonNull Quaternion rotation)

Public methods

final @NonNull Pose

Returns the result of composing this with other.

final @NonNull Pose
copy(@NonNull Vector3 translation, @NonNull Quaternion rotation)

Returns a copy of the pose.

static final float

Returns the distance between the two poses.

boolean
equals(Object other)

Returns true if this pose is equal to the other.

static final @NonNull Pose

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

final @NonNull Vector3

The backward vector in the local coordinate system.

final @NonNull Vector3

The down vector in the local coordinate system.

final @NonNull Vector3

The forward vector in the local coordinate system.

final @NonNull Pose

Returns a pose that performs the opposite translation.

final @NonNull Vector3

The left vector in the local coordinate system.

final @NonNull Vector3

The right vector in the local coordinate system.

final @NonNull Quaternion

the rotation component of this pose.

final @NonNull Vector3

the translation component of this pose.

final @NonNull Vector3

The up vector in the local coordinate system.

int
static final @NonNull Pose
lerp(@NonNull Pose start, @NonNull Pose end, float ratio)

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

final @NonNull Pose

Rotates this pose by the given rotation.

@NonNull String
final @NonNull Vector3

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

final @NonNull Vector3

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

final @NonNull Pose
translate(@NonNull Vector3 translation)

Translates this pose by the given translation.

Public fields

Identity

public static final @NonNull Pose Identity

Returns a new pose using the identity rotation.

Public constructors

Pose

Added in 1.0.0-alpha01
public Pose(@NonNull Pose other)

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

Pose

Added in 1.0.0-alpha01
public Pose(@NonNull Vector3 translation, @NonNull Quaternion rotation)

Public methods

compose

Added in 1.0.0-alpha01
public final @NonNull Pose compose(@NonNull Pose other)

Returns the result of composing this with other.

copy

Added in 1.0.0-alpha01
public final @NonNull Pose copy(@NonNull Vector3 translation, @NonNull Quaternion rotation)

Returns a copy of the pose.

distance

Added in 1.0.0-alpha01
public static final float distance(@NonNull Pose lhs, @NonNull Pose rhs)

Returns the distance between the two poses.

equals

public boolean equals(Object other)

Returns true if this pose is equal to the other.

fromLookAt

Added in 1.0.0-alpha01
public static final @NonNull Pose fromLookAt(@NonNull Vector3 eye, @NonNull Vector3 target, @NonNull Vector3 up)

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

Parameters
@NonNull Vector3 eye

the position from which to look at target.

@NonNull Vector3 target

the target position to look at.

@NonNull Vector3 up

a vector indicating the general "up" direction.

Returns
@NonNull Pose

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

getBackward

Added in 1.0.0-alpha01
public final @NonNull Vector3 getBackward()

The backward vector in the local coordinate system.

getDown

Added in 1.0.0-alpha01
public final @NonNull Vector3 getDown()

The down vector in the local coordinate system.

getForward

Added in 1.0.0-alpha01
public final @NonNull Vector3 getForward()

The forward vector in the local coordinate system.

getInverse

Added in 1.0.0-alpha01
public final @NonNull Pose getInverse()

Returns a pose that performs the opposite translation.

getLeft

Added in 1.0.0-alpha01
public final @NonNull Vector3 getLeft()

The left vector in the local coordinate system.

getRight

Added in 1.0.0-alpha01
public final @NonNull Vector3 getRight()

The right vector in the local coordinate system.

getRotation

Added in 1.0.0-alpha01
public final @NonNull Quaternion getRotation()

the rotation component of this pose.

getTranslation

Added in 1.0.0-alpha01
public final @NonNull Vector3 getTranslation()

the translation component of this pose.

getUp

Added in 1.0.0-alpha01
public final @NonNull Vector3 getUp()

The up vector in the local coordinate system.

hashCode

public int hashCode()

lerp

Added in 1.0.0-alpha01
public static final @NonNull Pose lerp(@NonNull Pose start, @NonNull Pose end, float ratio)

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.

rotate

Added in 1.0.0-alpha01
public final @NonNull Pose rotate(@NonNull Quaternion rotation)

Rotates this pose by the given rotation.

toString

public @NonNull String toString()

transformPoint

Added in 1.0.0-alpha01
public final @NonNull Vector3 transformPoint(@NonNull Vector3 point)

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
public final @NonNull Vector3 transformVector(@NonNull Vector3 vector)

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
public final @NonNull Pose translate(@NonNull Vector3 translation)

Translates this pose by the given translation.