35m_pose_is_identity(
const struct xrt_pose *pose)
39 return ((p.position.x == 0.0f || p.position.x == -0.0f) &&
40 (p.position.y == 0.0f || p.position.y == -0.0f) &&
41 (p.position.z == 0.0f || p.position.z == -0.0f) &&
42 (p.orientation.x == 0.0f || p.orientation.x == -0.0f) &&
43 (p.orientation.y == 0.0f || p.orientation.y == -0.0f) &&
44 (p.orientation.z == 0.0f || p.orientation.z == -0.0f) &&
45 (p.orientation.w == 1.0f || p.orientation.w == -1.0f)
64 set_tracked ? XRT_SPACE_RELATION_BITMASK_ALL
66 XRT_SPACE_RELATION_POSITION_VALID_BIT);
75 *out_relation = relation;
121 return &xrc->steps[xrc->step_count++];
138 xrc->steps[xrc->step_count++] = *relation;
154 m_space_relation_invert(&r, &invert);
185 if (m_pose_is_identity(&p)) {
204 if (m_pose_is_identity(&p)) {
static struct xrt_space_relation * m_relation_chain_reserve(struct xrt_relation_chain *xrc)
Reserve a step in the chain and return a pointer to the relation.
Definition: m_space.h:118
static void m_relation_chain_push_relation(struct xrt_relation_chain *xrc, const struct xrt_space_relation *relation)
Append a new relation.
Definition: m_space.h:132
void m_relation_chain_resolve(const struct xrt_relation_chain *xrc, struct xrt_space_relation *out_relation)
Compute the equivalent single relation from flattening a relation chain.
Definition: m_space.cpp:288
static void m_relation_chain_push_inverted_relation(struct xrt_relation_chain *xrc, const struct xrt_space_relation *relation)
Append the inverse of the provided relation.
Definition: m_space.h:149
static void m_relation_chain_push_inverted_pose_if_not_identity(struct xrt_relation_chain *xrc, const struct xrt_pose *pose)
Append the inverse of a pose as a relation without velocity, if it is not the identity pose.
Definition: m_space.h:200
void math_pose_invert(const struct xrt_pose *pose, struct xrt_pose *outPose)
Invert pose.
Definition: m_base.cpp:919
static void m_space_relation_from_pose(const struct xrt_pose *pose, bool set_tracked, struct xrt_space_relation *out_relation)
Create an xrt_space_relation from a pose.
Definition: m_space.h:61
static void m_space_relation_ident(struct xrt_space_relation *out_relation)
Create an xrt_space_relation with only orientation and position valid flags.
Definition: m_space.h:82
static void m_relation_chain_push_pose_if_not_identity(struct xrt_relation_chain *xrc, const struct xrt_pose *pose)
Append a new pose as a relation without velocity, if it is not the identity pose.
Definition: m_space.h:181
void m_space_relation_interpolate(struct xrt_space_relation *a, struct xrt_space_relation *b, float t, enum xrt_space_relation_flags flags, struct xrt_space_relation *out_relation)
Linearly interpolate between two relations a and b.
Definition: m_space.cpp:327
static void m_relation_chain_push_pose(struct xrt_relation_chain *xrc, const struct xrt_pose *pose)
Append a new pose as a fully tracked relation.
Definition: m_space.h:168
xrt_space_relation_flags
Flags of which components of a xrt_space_relation is valid.
Definition: xrt_defines.h:629
C interface to math library.
Definition: m_space.cpp:87
A pose composed of a position and orientation.
Definition: xrt_defines.h:465
#define XRT_POSE_IDENTITY
Identity value for xrt_pose.
Definition: xrt_defines.h:475
A chain of space relations and their associated validity flags.
Definition: xrt_defines.h:695
#define XRT_RELATION_CHAIN_CAPACITY
The maximum number of steps that can be in a relation chain.
Definition: xrt_defines.h:685
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:657
#define XRT_VEC3_ZERO
All-zero value for xrt_vec3.
Definition: xrt_defines.h:295
Common defines and enums for XRT.