39 template <
typename Scalar>
40 static inline OSVR_ReturnCode pose3toMatrix(
OSVR_Pose3 const *pose,
53 return pose3toMatrix(pose, flags, mat);
58 return pose3toMatrix(pose, flags, mat);
62 static_assert(!static_cast<bool>(Eigen::Matrix4d::IsRowMajor),
63 "This and related code in MatrixConventions assume Eigen is "
64 "still column-major by default.");
66 static_assert((OSVR_MATRIX_MASK_ROWMAJOR | OSVR_MATRIX_MASK_ROWVECTORS |
67 OSVR_MATRIX_MASK_LHINPUT | OSVR_MATRIX_MASK_UNSIGNEDZ) ==
68 (OSVR_MATRIX_MASK_ROWMAJOR ^ OSVR_MATRIX_MASK_ROWVECTORS ^
69 OSVR_MATRIX_MASK_LHINPUT ^ OSVR_MATRIX_MASK_UNSIGNEDZ),
70 "Matrix convention masks must be independent!");
73 static_assert(CompactMatrixConventions::ComputeBits<
74 CompactMatrixFlags::NeedsTranspose>::value == (0x1 << 0),
76 static_assert(CompactMatrixConventions::ComputeBits<
77 CompactMatrixFlags::LeftHandInput>::value == (0x1 << 1),
79 static_assert(CompactMatrixConventions::ComputeBits<
80 CompactMatrixFlags::UnsignedZ>::value == (0x1 << 2),
83 CompactMatrixConventions::ComputeBits<
84 CompactMatrixFlags::NeedsTranspose, CompactMatrixFlags::LeftHandInput,
85 CompactMatrixFlags::UnsignedZ>::value == (1 + 2 + 4),
OSVR_ReturnCode osvrPose3ToMatrixd(OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, double *mat)
Set a matrix of doubles based on a Pose3.
Header wrapping include of and for warning quieting.
Eigen::Isometry3d fromPose(OSVR_Pose3 const &pose)
Turn an OSVR_Pose3 into an Eigen::Transform.
uint16_t OSVR_MatrixConventions
Type for passing matrix convention flags.
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
#define OSVR_RETURN_SUCCESS
The "success" value for an OSVR_ReturnCode.
OSVR_ReturnCode osvrPose3ToMatrixf(OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, float *mat)
Set a matrix of floats based on a Pose3.
A structure defining a 3D (6DOF) rigid body pose: translation and rotation.
Header for interoperation between the Eigen math library, the internal mini math library, and VRPN's quatlib.
void matrixEigenAssign(T const &src, OSVR_MatrixConventions flags, Scalar *dest)
Helper function template to assign/convert matrices as required.
double Scalar
Common scalar type.