namespace UnityEngine.XR.ARFoundation.InternalUtils
{
static class PoseUtils
{
///
/// Returns the offset between and , calculated as
/// (b.position - a.position, b.rotation * Quaternion.Inverse(a.rotation)).
///
/// Pose a.
/// Pose b.
/// The offset between and .
public static Pose CalculateOffset(Pose a, Pose b)
{
return new Pose(b.position - a.position, b.rotation * Quaternion.Inverse(a.rotation));
}
///
/// Adds an offset to , calculated as
/// (a.position + offset.position, offset.rotation * pose.rotation).
///
/// The pose.
/// The offset.
/// pose + offset
public static Pose WithOffset(this Pose pose, Pose offset)
{
return new Pose(pose.position + offset.position, offset.rotation * pose.rotation);
}
}
}