49 #define MATH_GRAVITY_M_S2 (9.8066) 309 const struct xrt_pose *relative_pose,
310 const struct xrt_pose *base_space_pose,
371 const struct xrt_pose *base_space_pose,
419 double horizfov_total,
422 double vertfov_total,
void math_relation_openxr_locate(const struct xrt_pose *space_pose, const struct xrt_space_relation *relative_relation, const struct xrt_pose *base_space_pose, struct xrt_space_relation *result)
Combine the poses of the target and base space with the relative relation of those spaces...
Definition: m_base.cpp:540
A 3 element vector with single floats.
Definition: xrt_defines.h:131
A pose composed of a position and orientation.
Definition: xrt_defines.h:229
bool math_vec3_validate(const struct xrt_vec3 *vec3)
Check if this vec3 is valid for math operations.
Definition: m_base.cpp:61
void math_quat_finite_difference(const struct xrt_quat *quat0, const struct xrt_quat *quat1, float dt, struct xrt_vec3 *out_ang_vel)
Compute an angular velocity vector (exponential map format) by taking the finite difference of two qu...
void math_relation_accumulate_relation(const struct xrt_space_relation *additional_relation, struct xrt_space_relation *in_out_relation)
Apply another step of space relation on top of an existing relation.
Definition: m_base.cpp:496
void math_relation_apply_offset(const struct xrt_pose *offset, struct xrt_space_relation *in_out_relation)
Apply a static pose on top of an existing relation.
Definition: m_base.cpp:474
size_t math_hash_string(const char *str_c, size_t length)
Generate a hash value from the given string, trailing zero not included.
Definition: m_hash.cpp:15
void math_quat_from_plus_x_z(const struct xrt_vec3 *plus_x, const struct xrt_vec3 *plus_z, struct xrt_quat *result)
Create a rotation from two vectors plus x and z, by creating a rotation matrix by crossing z and x to...
Definition: m_base.cpp:113
void math_pose_transform(const struct xrt_pose *transform, const struct xrt_pose *pose, struct xrt_pose *outPose)
Apply a rigid-body transformation to a pose.
Definition: m_base.cpp:276
A tightly packed 3x3 matrix of floats.
Definition: xrt_defines.h:266
A quaternion with single floats.
Definition: xrt_defines.h:97
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:334
void math_quat_integrate_velocity(const struct xrt_quat *quat, const struct xrt_vec3 *ang_vel, float dt, struct xrt_quat *result)
Integrate an angular velocity vector (exponential map) and apply to a quaternion. ...
void math_vec3_accum(const struct xrt_vec3 *additional, struct xrt_vec3 *inAndOut)
Accumulate a vector by adding in-place.
Definition: m_base.cpp:69
Common defines and enums for XRT.
bool math_pose_validate(const struct xrt_pose *pose)
Check if this pose can be used in transformation operations.
Definition: m_base.cpp:226
void math_pose_invert(const struct xrt_pose *pose, struct xrt_pose *outPose)
Invert pose.
Definition: m_base.cpp:235
void math_pose_transform_point(const struct xrt_pose *transform, const struct xrt_vec3 *point, struct xrt_vec3 *out_point)
Apply a rigid-body transformation to a point.
Definition: m_base.cpp:289
Describes a projection matrix fov.
Definition: xrt_defines.h:240
void math_pose_openxr_locate(const struct xrt_pose *space_pose, const struct xrt_pose *relative_pose, const struct xrt_pose *base_space_pose, struct xrt_pose *result)
Combine the poses of the target and base space with the relative pose of those spaces.
Definition: m_base.cpp:301
void math_relation_reset(struct xrt_space_relation *out)
Reset a relation to zero velocity, located at origin, and all validity flags.
Definition: m_base.cpp:468
void math_quat_from_matrix_3x3(const struct xrt_matrix_3x3 *mat, struct xrt_quat *result)
Create a rotation from a 3x3 rotation matrix.
Definition: m_base.cpp:101
void math_vec3_cross(const struct xrt_vec3 *l, const struct xrt_vec3 *r, struct xrt_vec3 *result)
Cross product of a vector.
Definition: m_base.cpp:78
void math_quat_normalize(struct xrt_quat *inout)
Normalize a quaternion.
Definition: m_base.cpp:158
bool math_quat_validate(const struct xrt_quat *quat)
Check if this quat can be used in transformation operations.
Definition: m_base.cpp:136
void math_quat_from_angle_vector(float angle_rads, const struct xrt_vec3 *vector, struct xrt_quat *result)
Create a rotation from a angle in radians and a vector.
Definition: m_base.cpp:93
bool math_compute_fovs(double w_total, double w_1, double horizfov_total, double h_total, double h_1, double vertfov_total, struct xrt_fov *fov)
Perform the computations from "Computing Half-Fields-Of-View from Simpler Display Models"...
Definition: m_optics.c:125
void math_quat_rotate_vec3(const struct xrt_quat *left, const struct xrt_vec3 *right, struct xrt_vec3 *result)
Rotate a vector.
void math_quat_rotate(const struct xrt_quat *left, const struct xrt_quat *right, struct xrt_quat *result)
Rotate a quaternion (compose rotations).
Definition: m_base.cpp:165