open class Pose(var t: Vector3 = Vector3(0f, 0f, 0f), var q: Quaternion = Quaternion(1.0f, 0f, 0f, 0f))
Pose
(
t
, q
)
|
Signature
constructor(t: Vector3 = Vector3(0f, 0f, 0f), q: Quaternion = Quaternion(1.0f, 0f, 0f, 0f)) Parameters Returns Pose |
q
: Quaternion
[Get][Set] |
The orientation quaternion of the pose.
Signature
open var q: Quaternion |
t
: Vector3
[Get][Set] |
The position vector of the pose.
Signature
open var t: Vector3 |
component1
()
|
Signature
operator fun component1(): Vector3 Returns Vector3 |
component2
()
|
Signature
operator fun component2(): Quaternion Returns Quaternion |
copy
()
| |
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 |
hashCode
()
|
Signature
open override fun hashCode(): Int Returns Int |
inverse
()
| |
isApproximatelyEqual
(
other
, distanceThreshold
, angleDegreesThreshold
)
|
Checks if this pose is approximately equal to another pose, considering both position and rotation.
This method combines position proximity (Euclidean distance) and rotation proximity (angular distance) checks into a single convenience method. Both conditions must be satisfied for the poses to be considered approximately equal.
Signature
fun isApproximatelyEqual(other: Pose, distanceThreshold: Float, angleDegreesThreshold: Float): Boolean Parameters distanceThreshold: Float
The maximum allowed Euclidean distance between positions (in meters).
angleDegreesThreshold: Float
The maximum allowed angular difference in degrees.
Returns Boolean
True if both the position is within the distance threshold and the rotation is within the angle threshold.
|
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 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 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 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
)
| |
removePitchAndRoll
()
|
Removes the pitch and roll components from this pose, effectively aligning it with the up vector.
Signature
fun removePitchAndRoll(): Pose |
right
()
|
Calculates the right direction vector of this pose.
Signature
fun right(): Vector3 |
times
(
p
)
| |
times
(
v
)
| |
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 |