API reference
API reference
Select your platform
No SDKs available
No versions available

Pose Class

Modifiers: open
Represents a pose in 3D space, which includes a position and an orientation.

Signature

open class Pose(var t: Vector3 = Vector3(0f, 0f, 0f), var q: Quaternion = Quaternion(1.0f, 0f, 0f, 0f))

Constructors

Pose ( t , q )
Signature
constructor(t: Vector3 = Vector3(0f, 0f, 0f), q: Quaternion = Quaternion(1.0f, 0f, 0f, 0f))
Parameters
  The position vector of the pose.
  The orientation quaternion of the pose.
Returns

Properties

[Get][Set]
The orientation quaternion of the pose.
Signature
open var q: Quaternion
[Get][Set]
The position vector of the pose.
Signature
open var t: Vector3

Functions

component1 ()
Signature
operator fun component1(): Vector3
Returns
component2 ()
Signature
operator fun component2(): Quaternion
Returns
copy ()
Returns a copy of this pose.
Signature
fun copy(): Pose
Returns
  A copy of this pose.
equals ( other )
Signature
open operator override fun equals(other: Any?): Boolean
Parameters
other: Any?
Returns
Boolean
forward ()
Calculates the forward direction vector of this pose.
Signature
fun forward(): Vector3
Returns
  The forward vector.
hashCode ()
Signature
open override fun hashCode(): Int
Returns
Int
inverse ()
Computes the inverse of this pose.
Signature
fun inverse(): Pose
Returns
  The inverse pose.
isWithinAngle ( other , angleRadians )
Checks if the rotation of this pose is within a specified angular distance of another pose's rotation.
This method uses the industry-standard approach for comparing quaternion orientations: computing the angular distance between the two rotations using the dot product. It correctly handles the q vs -q equivalence (both represent the same rotation).
Signature
fun isWithinAngle(other: Pose, angleRadians: Float): Boolean
Parameters
other: Pose
  The other pose to compare with.
angleRadians: Float
  The maximum allowed angular difference in radians.
Returns
Boolean
  True if the angular distance between the two pose rotations is less than or equal to angleRadians.
isWithinAngleDegrees ( other , angleDegrees )
Checks if the rotation of this pose is within a specified angular distance of another pose's rotation.
This method uses the industry-standard approach for comparing quaternion orientations: computing the angular distance between the two rotations using the dot product. It correctly handles the q vs -q equivalence (both represent the same rotation).
Signature
fun isWithinAngleDegrees(other: Pose, angleDegrees: Float): Boolean
Parameters
other: Pose
  The other pose to compare with.
angleDegrees: Float
  The maximum allowed angular difference in degrees.
Returns
Boolean
  True if the angular distance between the two pose rotations is less than or equal to angleDegrees.
isWithinDistance ( other , distance )
Checks if the position of this pose is within a specified Euclidean distance of another pose's position.
This is the recommended approach for position-based proximity checks in VR/AR applications.
Signature
fun isWithinDistance(other: Pose, distance: Float): Boolean
Parameters
other: Pose
  The other pose to compare with.
distance: Float
  The maximum allowed Euclidean distance (in meters).
Returns
Boolean
  True if the Euclidean distance between the two pose positions is less than or equal to distance.
lerp ( dest , ratio )
Interpolates between this pose and another pose.
Signature
fun lerp(dest: Pose, ratio: Float): Pose
Parameters
dest: Pose
  The destination pose to interpolate towards.
ratio: Float
  The interpolation ratio.
Returns
  The interpolated pose.
removePitchAndRoll ()
Removes the pitch and roll components from this pose, effectively aligning it with the up vector.
Signature
fun removePitchAndRoll(): Pose
Returns
  A new pose with pitch and roll removed.
right ()
Calculates the right direction vector of this pose.
Signature
fun right(): Vector3
Returns
  The right vector.
times ( p )
Multiplies this pose with another pose.
Signature
inline operator fun times(p: Pose): Pose
Parameters
p: Pose
  The other pose to multiply with.
Returns
  A new pose resulting from the multiplication.
times ( v )
Multiplies this pose with a vector.
Signature
inline operator fun times(v: Vector3): Vector3
Parameters
  The vector to multiply with.
Returns
  The transformed vector.
toString ()
Provides a string representation of the pose.
Signature
open override fun toString(): String
Returns
String
  A string that represents the pose.
up ()
Calculates the up direction vector of this pose.
Signature
fun up(): Vector3
Returns
  The up vector.
Did you find this page helpful?