OSVR-Core
|
Basic structures and conversion utilities for common math entites. More...
Modules | |
Matrix conventions and bit flags | |
Namespaces | |
osvr::util::eigen_interop | |
Namespace containing const_map() and map() function implementations/overloads to allow easy interoperation of OSVR types and Eigen types. | |
Classes | |
struct | OSVR_Pose3 |
A structure defining a 3D (6DOF) rigid body pose: translation and rotation. More... | |
struct | OSVR_Quaternion |
A structure defining a quaternion, often a unit quaternion representing 3D rotation. More... | |
struct | OSVR_RadialDistortionParameters |
Parameters for a per-color-component radial distortion shader. More... | |
struct | OSVR_Vec2 |
A structure defining a 2D vector, which represents position. More... | |
struct | OSVR_Vec3 |
A structure defining a 3D vector, often a position/translation. More... | |
Macros | |
#define | OSVR_QUAT_MEMBER(COMPONENT, INDEX) |
#define | OSVR_VEC_MEMBER(COMPONENT, INDEX) |
#define | OSVR_VEC_MEMBER(COMPONENT, INDEX) |
Typedefs | |
typedef struct OSVR_Pose3 | OSVR_Pose3 |
A structure defining a 3D (6DOF) rigid body pose: translation and rotation. | |
typedef struct OSVR_Quaternion | OSVR_Quaternion |
A structure defining a quaternion, often a unit quaternion representing 3D rotation. | |
typedef struct OSVR_RadialDistortionParameters | OSVR_RadialDistortionParameters |
Parameters for a per-color-component radial distortion shader. | |
typedef struct OSVR_Vec2 | OSVR_Vec2 |
A structure defining a 2D vector, which represents position. | |
typedef struct OSVR_Vec3 | OSVR_Vec3 |
A structure defining a 3D vector, often a position/translation. | |
Functions | |
Eigen::Map< Eigen::Vector3d > | osvr::util::vecMap (OSVR_Vec3 &vec) |
Wrap an OSVR_Vec3 in an Eigen object that allows it to interoperate with Eigen as though it were an Eigen::Vector3d. More... | |
Eigen::Map< const Eigen::Vector3d > | osvr::util::vecMap (OSVR_Vec3 const &vec) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. For constant vectors. More... | |
Eigen::Quaterniond | osvr::util::fromQuat (OSVR_Quaternion const &q) |
Convert an OSVR_Quaternion to an Eigen::Quaterniond. | |
void | osvr::util::toQuat (Eigen::Quaterniond const &src, OSVR_Quaternion &q) |
Convert an Eigen::Quaterniond to a OSVR_Quaternion. | |
Eigen::Isometry3d | osvr::util::fromPose (OSVR_Pose3 const &pose) |
Turn an OSVR_Pose3 into an Eigen::Transform. More... | |
void | osvr::util::toPose (Eigen::Isometry3d const &xform, OSVR_Pose3 &pose) |
Turn an Eigen::Isometry3d (transform) into an OSVR_Pose3. More... | |
void | osvr::util::toPose (Eigen::Matrix4d const &mat, OSVR_Pose3 &pose) |
Turn an Eigen::Matrix4d (transform) into an OSVR_Pose3. More... | |
OSVR_UTIL_EXPORT OSVR_ReturnCode | osvrPose3ToMatrixd (OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, double *mat) |
Set a matrix of doubles based on a Pose3. More... | |
OSVR_UTIL_EXPORT OSVR_ReturnCode | osvrPose3ToMatrixf (OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, float *mat) |
Set a matrix of floats based on a Pose3. More... | |
OSVR_INLINE void | osvrPose3SetIdentity (OSVR_Pose3 *pose) |
Set a pose to identity. | |
OSVR_INLINE void | osvrQuatSetIdentity (OSVR_Quaternion *q) |
Set a quaternion to the identity rotation. | |
OSVR_INLINE void | osvrQuatToQuatlib (q_type dest, OSVR_Quaternion const *src) |
OSVR_INLINE void | osvrQuatFromQuatlib (OSVR_Quaternion *dest, q_type const src) |
OSVR_INLINE void | osvrVec3ToQuatlib (q_vec_type dest, OSVR_Vec3 const *src) |
OSVR_INLINE void | osvrVec3FromQuatlib (OSVR_Vec3 *dest, q_vec_type const src) |
OSVR_INLINE void | osvrPose3ToQuatlib (q_xyz_quat_type *dest, OSVR_Pose3 const *src) |
OSVR_INLINE void | osvrPose3FromQuatlib (OSVR_Pose3 *dest, q_xyz_quat_type const *src) |
OSVR_INLINE void | osvrVec2Zero (OSVR_Vec2 *v) |
Set a Vec2 to the zero vector. | |
OSVR_INLINE void | osvrVec3Zero (OSVR_Vec3 *v) |
Set a Vec3 to the zero vector. | |
Variables | |
OSVR_Vec3 | OSVR_RadialDistortionParameters::k1 |
Vector of K1 coefficients for the R, G, B channels. | |
OSVR_Vec2 | OSVR_RadialDistortionParameters::centerOfProjection |
Center of projection for the radial distortion, relative to the bounds of this surface. | |
Basic structures and conversion utilities for common math entites.
This is not intended to be a full math library. It is expected that you convert the values in these structures into your own math types. If you do not yet have a math library, Eigen is highly recommended.
#define OSVR_QUAT_MEMBER | ( | COMPONENT, | |
INDEX | |||
) |
#define OSVR_VEC_MEMBER | ( | COMPONENT, | |
INDEX | |||
) |
#define OSVR_VEC_MEMBER | ( | COMPONENT, | |
INDEX | |||
) |
|
inline |
Turn an OSVR_Pose3 into an Eigen::Transform.
pose | Input pose |
OSVR_UTIL_EXPORT OSVR_ReturnCode osvrPose3ToMatrixd | ( | OSVR_Pose3 const * | pose, |
OSVR_MatrixConventions | flags, | ||
double * | mat | ||
) |
Set a matrix of doubles based on a Pose3.
pose | The Pose3 to convert | |
flags | Memory ordering flag - see Matrix flags | |
[out] | mat | an array of 16 doubles |
OSVR_UTIL_EXPORT OSVR_ReturnCode osvrPose3ToMatrixf | ( | OSVR_Pose3 const * | pose, |
OSVR_MatrixConventions | flags, | ||
float * | mat | ||
) |
Set a matrix of floats based on a Pose3.
pose | The Pose3 to convert | |
flags | Memory ordering flag - see Matrix flags | |
[out] | mat | an array of 16 floats |
|
inline |
Turn an Eigen::Isometry3d (transform) into an OSVR_Pose3.
[in] | xform | Input transform. |
[out] | pose | Destination to set based on xform. |
|
inline |
Turn an Eigen::Matrix4d (transform) into an OSVR_Pose3.
[in] | mat | Input transform. Assumed to contain only position and orientation. |
[out] | pose | Destination to set based on xform. |
|
inline |
Wrap an OSVR_Vec3 in an Eigen object that allows it to interoperate with Eigen as though it were an Eigen::Vector3d.
vec | A vector to wrap |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. For constant vectors.