public class
Pose
Represents an immutable rigid transformation from one coordinate space to another. As provided from all ARCore APIs, Poses always describe the transformation from object's local coordinate space to the world coordinate space (see below). That is, Poses from ARCore APIs can be thought of as equivalent to OpenGL model matrices.
The transformation is defined using a quaternion rotation about the origin followed by a translation.
Coordinate system is right-handed, like OpenGL conventions.
Translation units are meters.
World Coordinate Space
As ARCore's understanding of the environment changes, it adjusts its model of the world to
keep things consistent. When this happens, the numerical location (coordinates) of the camera and
Anchor
s can change significantly to maintain appropriate relative positions of the
physical locations they represent.
These changes mean that every frame should be considered to be in a completely unique world coordinate space. The numerical coordinates of anchors and the camera should never be used outside the rendering frame during which they were retrieved. If a position needs to be considered beyond the scope of a single rendering frame, either an anchor should be created or a position relative to a nearby existing anchor should be used.
Fields
public
static
final
Pose
|
IDENTITY |
The identity pose. |
Public Constructors
|
Pose(float[] translation, float[] rotation)
Returns a new pose having the specified translation and rotation.
|
Public Methods
Pose
|
|
Pose
|
extractRotation()
Returns a pose having the rotation of this pose but no translation.
|
Pose
|
extractTranslation()
Returns a pose having the translation of this pose but no rotation.
|
void
|
getRotationQuaternion(float[] dest, int offset)
Copies the rotation quaternion into a float array starting at offset.
|
float[]
|
getRotationQuaternion()
Returns a
float[4] containing the rotation component of this pose. |
float[]
|
getTransformedAxis(int axis, float scale)
Returns the transformed direction of a local axis.
|
void
|
getTransformedAxis(int axis, float scale, float[] dest, int offset)
Computes the transformed direction of a local axis, outputting into a float array.
|
float[]
|
getTranslation()
Returns a
float[3] containing the translation component of this pose. |
void
|
getTranslation(float[] dest, int offset)
Copies the translation vector into a float array starting at offset.
|
float[]
|
getXAxis()
Returns a 3-element array containing the direction of the transformed X axis.
|
float[]
|
getYAxis()
Returns a 3-element array containing the direction of the transformed Y axis.
|
float[]
|
getZAxis()
Returns a 3-element array containing the direction of the transformed Z axis.
|
Pose
|
inverse()
Returns a pose that performs the opposite transformation.
|
static
Pose
|
makeInterpolated(Pose a, Pose b, float t)
Returns a new pose that blends between two input poses.
|
static
Pose
|
makeRotation(float[] quaternion)
Creates a rotation-only pose.
|
static
Pose
|
makeRotation(float x, float y, float z, float w)
Creates a rotation-only pose.
|
static
Pose
|
makeTranslation(float[] translation)
Creates a translation-only pose.
|
static
Pose
|
makeTranslation(float tx, float ty, float tz)
Creates a translation-only pose.
|
float
|
qw()
Returns the W component of this pose's rotation quaternion.
|
float
|
qx()
Returns the X component of this pose's rotation quaternion.
|
float
|
qy()
Returns the Y component of this pose's rotation quaternion.
|
float
|
qz()
Returns the Z component of this pose's rotation quaternion.
|
float[]
|
rotateVector(float[] vectorIn)
Rotates the provided vector by the pose's rotation.
|
void
|
rotateVector(float[] vectorIn, int inOffset, float[] vectorOut, int outOffset)
Rotates the provided vector by the pose's rotation.
|
void
|
toMatrix(float[] dest, int offset)
Converts this pose to a model matrix, placing the matrix in column-major order into entries
offset through offset+15 of the dest array. |
String
|
toString()
Returns a human-readable representation of this pose.
|
float[]
|
transformPoint(float[] x)
Transforms the provided point by this pose.
|
void
|
transformPoint(float[] pointIn, int inOffset, float[] pointOut, int outOffset)
Transforms the provided point by the pose.
|
float
|
tx()
Returns the X component of this pose's translation.
|
float
|
ty()
Returns the Y component of this pose's translation.
|
float
|
tz()
Returns the Z component of this pose's translation.
|