mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-07 15:46:12 +00:00
aux/math: implement math_pose_identity.
This commit is contained in:
parent
c776a19e15
commit
a027852767
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2019, Collabora, Ltd.
|
// Copyright 2019-2021, Collabora, Ltd.
|
||||||
// SPDX-License-Identifier: BSL-1.0
|
// SPDX-License-Identifier: BSL-1.0
|
||||||
/*!
|
/*!
|
||||||
* @file
|
* @file
|
||||||
|
@ -379,6 +379,16 @@ math_matrix_4x4_inverse_view_projection(const struct xrt_matrix_4x4 *view,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Somewhat laboriously make an xrt_pose identity.
|
||||||
|
*
|
||||||
|
* @relates xrt_pose
|
||||||
|
* @ingroup aux_math
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
math_pose_identity(struct xrt_pose *pose);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Check if this pose can be used in transformation operations.
|
* Check if this pose can be used in transformation operations.
|
||||||
*
|
*
|
||||||
|
|
|
@ -419,6 +419,18 @@ math_pose_invert(const struct xrt_pose *pose, struct xrt_pose *outPose)
|
||||||
orientation(*outPose) = newOrientation;
|
orientation(*outPose) = newOrientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void
|
||||||
|
math_pose_identity(struct xrt_pose *pose)
|
||||||
|
{
|
||||||
|
pose->position.x = 0.0;
|
||||||
|
pose->position.y = 0.0;
|
||||||
|
pose->position.z = 0.0;
|
||||||
|
pose->orientation.x = 0.0;
|
||||||
|
pose->orientation.y = 0.0;
|
||||||
|
pose->orientation.z = 0.0;
|
||||||
|
pose->orientation.w = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Return the result of transforming a point by a pose/transform.
|
* Return the result of transforming a point by a pose/transform.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue