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. More...
Modules | |
Matrix conventions and bit flags | |
Namespaces | |
osvr::util::eigen_interop | |
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) |
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_ReturnCode | osvrPose3ToMatrixd (OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, double *mat) |
Set a matrix of doubles based on a Pose3. More... | |
OSVR_ReturnCode | osvrPose3ToMatrixf (OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, float *mat) |
Set a matrix of floats based on a Pose3. More... | |
void | osvrPose3SetIdentity (OSVR_Pose3 *pose) |
Set a pose to identity. | |
double | osvrQuatGetW (OSVR_Quaternion const *q) |
Accessor for quaternion component W. | |
void | osvrQuatSetW (OSVR_Quaternion *q, double val) |
Setter for quaternion component W. | |
double | osvrQuatGetX (OSVR_Quaternion const *q) |
Accessor for quaternion component X. | |
void | osvrQuatSetX (OSVR_Quaternion *q, double val) |
Setter for quaternion component X. | |
double | osvrQuatGetY (OSVR_Quaternion const *q) |
Accessor for quaternion component Y. | |
void | osvrQuatSetY (OSVR_Quaternion *q, double val) |
Setter for quaternion component Y. | |
double | osvrQuatGetZ (OSVR_Quaternion const *q) |
Accessor for quaternion component Z. | |
void | osvrQuatSetZ (OSVR_Quaternion *q, double val) |
Setter for quaternion component Z. | |
void | osvrQuatSetIdentity (OSVR_Quaternion *q) |
Set a quaternion to the identity rotation. | |
void | osvrQuatToQuatlib (q_type dest, OSVR_Quaternion const *src) |
void | osvrQuatFromQuatlib (OSVR_Quaternion *dest, q_type const src) |
void | osvrVec3ToQuatlib (q_vec_type dest, OSVR_Vec3 const *src) |
void | osvrVec3FromQuatlib (OSVR_Vec3 *dest, q_vec_type const src) |
void | osvrPose3ToQuatlib (q_xyz_quat_type *dest, OSVR_Pose3 const *src) |
void | osvrPose3FromQuatlib (OSVR_Pose3 *dest, q_xyz_quat_type const *src) |
double | osvrVec2GetX (OSVR_Vec2 const *v) |
Accessor for Vec2 component X. | |
void | osvrVec2SetX (OSVR_Vec2 *v, double val) |
Setter for Vec2 component X. | |
double | osvrVec2GetY (OSVR_Vec2 const *v) |
Accessor for Vec2 component Y. | |
void | osvrVec2SetY (OSVR_Vec2 *v, double val) |
Setter for Vec2 component Y. | |
void | osvrVec2Zero (OSVR_Vec2 *v) |
Set a Vec2 to the zero vector. | |
double | osvrVec3GetX (OSVR_Vec3 const *v) |
Accessor for Vec3 component X. | |
void | osvrVec3SetX (OSVR_Vec3 *v, double val) |
Setter for Vec3 component X. | |
double | osvrVec3GetY (OSVR_Vec3 const *v) |
Accessor for Vec3 component Y. | |
void | osvrVec3SetY (OSVR_Vec3 *v, double val) |
Setter for Vec3 component Y. | |
double | osvrVec3GetZ (OSVR_Vec3 const *v) |
Accessor for Vec3 component Z. | |
void | osvrVec3SetZ (OSVR_Vec3 *v, double val) |
Setter for Vec3 component Z. | |
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 | |||
) |
#include <osvr/Util/QuaternionC.h>
Definition at line 54 of file QuaternionC.h.
#define OSVR_VEC_MEMBER | ( | COMPONENT, | |
INDEX | |||
) |
#include <osvr/Util/Vec2C.h>
#define OSVR_VEC_MEMBER | ( | COMPONENT, | |
INDEX | |||
) |
#include <osvr/Util/Vec3C.h>
|
inline |
#include <osvr/Util/EigenInterop.h>
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 |
Definition at line 52 of file EigenInterop.h.
|
inline |
#include <osvr/Util/EigenInterop.h>
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.
Definition at line 58 of file EigenInterop.h.
|
inline |
#include <osvr/Util/EigenInterop.h>
Turn an OSVR_Pose3 into an Eigen::Transform.
pose | Input pose |
Definition at line 81 of file EigenInterop.h.
|
inline |
#include <osvr/Util/EigenInterop.h>
Turn an Eigen::Isometry3d (transform) into an OSVR_Pose3.
[in] | xform | Input transform. |
[out] | pose | Destination to set based on xform. |
Definition at line 93 of file EigenInterop.h.
|
inline |
#include <osvr/Util/EigenInterop.h>
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. |
Definition at line 104 of file EigenInterop.h.
OSVR_ReturnCode osvrPose3ToMatrixd | ( | OSVR_Pose3 const * | pose, |
OSVR_MatrixConventions | flags, | ||
double * | mat | ||
) |
#include <osvr/Util/MatrixConventionsC.h>
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 |
Definition at line 51 of file MatrixConventionsC.cpp.
OSVR_ReturnCode osvrPose3ToMatrixf | ( | OSVR_Pose3 const * | pose, |
OSVR_MatrixConventions | flags, | ||
float * | mat | ||
) |
#include <osvr/Util/MatrixConventionsC.h>
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 |
Definition at line 56 of file MatrixConventionsC.cpp.