xrt: Add xrt_space_graph

This commit is contained in:
Jakob Bornecrantz 2020-07-22 20:48:01 +01:00
parent 0ff1865c2e
commit 4d85db6051
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,4 @@
Add `xrt_space_graph` struct for calculating space relations. This struct and
accompanying makes it easier to reason about space relations than just functions
operating directly on `xrt_space_relation`. The code base is changed to use
these new functions.

View file

@ -368,6 +368,28 @@ struct xrt_space_relation
struct xrt_vec3 angular_acceleration;
};
/*!
* The maximum number of steps that can be in a space graph chain.
*
* @see xrt_space_graph::steps
* @ingroup xrt_iface math
*/
#define XRT_SPACE_GRAPHS_MAX 8
/*!
* A graph of space relations, technically more of a chain of transformation
* since it's not branching, but a flat graph is still a graph. Functions for
* manipulating this are available in `math/m_space.h`.
*
* @see xrt_space_relation
* @ingroup xrt_iface math
*/
struct xrt_space_graph
{
struct xrt_space_relation steps[XRT_SPACE_GRAPHS_MAX];
uint32_t num_steps;
};
/*
*