Pose
public final class Pose
Represents an immutable rigid transformation from one coordinate space to another.
Summary
Public constructors |
|---|
|
Creates a new pose with the same values as the |
Pose(@NonNull Vector3 translation, @NonNull Quaternion rotation) |
Public methods |
|
|---|---|
final @NonNull Pose |
Returns the result of composing this with |
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 |
Returns true if this pose is equal to the |
static final @NonNull Pose |
Returns a new pose oriented to look at |
final @NonNull Vector3 |
The backward vector in the local coordinate system. |
final @NonNull Vector3 |
getDown()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 transformation. |
final @NonNull Vector3 |
getLeft()The left vector in the local coordinate system. |
final @NonNull Vector3 |
getRight()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 |
getUp()The up vector in the local coordinate system. |
int |
hashCode() |
static final @NonNull Pose |
Returns a new pose that is linearly interpolated between |
final @NonNull Pose |
rotate(@NonNull Quaternion rotation)Rotates this pose by the given |
@NonNull String |
toString() |
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. |
final @NonNull Vector3 |
transformVector(@NonNull Vector3 vector)Transforms the provided vector by the pose by only applying the rotation component of the pose. |
final @NonNull Pose |
Translates this pose by the given |
Public fields
Public constructors
Pose
public Pose(@NonNull Pose other)
Creates a new pose with the same values as the other pose.
Public methods
compose
public final @NonNull Pose compose(@NonNull Pose other)
Returns the result of composing this with other.
copy
public final @NonNull Pose copy(@NonNull Vector3 translation, @NonNull Quaternion rotation)
Returns a copy of the pose.
distance
public static final float distance(@NonNull Pose lhs, @NonNull Pose rhs)
Returns the distance between the two poses.
fromLookAt
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.
getBackward
public final @NonNull Vector3 getBackward()
The backward vector in the local coordinate system.
getDown
public final @NonNull Vector3 getDown()
The down vector in the local coordinate system.
getForward
public final @NonNull Vector3 getForward()
The forward vector in the local coordinate system.
getInverse
public final @NonNull Pose getInverse()
Returns a pose that performs the opposite transformation.
getLeft
public final @NonNull Vector3 getLeft()
The left vector in the local coordinate system.
getRight
public final @NonNull Vector3 getRight()
The right vector in the local coordinate system.
getRotation
public final @NonNull Quaternion getRotation()
the rotation component of this pose.
getTranslation
public final @NonNull Vector3 getTranslation()
the translation component of this pose.
getUp
public final @NonNull Vector3 getUp()
The up vector in the local coordinate system.
lerp
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
public final @NonNull Pose rotate(@NonNull Quaternion rotation)
Rotates this pose by the given rotation.
transformPoint
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
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
public final @NonNull Pose translate(@NonNull Vector3 translation)
Translates this pose by the given translation.