acl/math/quat_packing.h¶
#include "acl/math/quat_packing.h"
The functions that pack and unpack quaternions.
pack_quat_128¶
void pack_quat_128(rtm::quatf rotation, uint8_t* out_rotation_data)
Writes the four components of a quaternion with float32 values (16 bytes).
unpack_quat_128¶
rtm::quatf unpack_quat_128(const uint8_t* data_ptr)
Reads a quaternion that pack_quat_128 wrote.
pack_quat_96¶
void pack_quat_96(rtm::quatf rotation, uint8_t* out_rotation_data)
Writes the [x,y,z] components of a quaternion with float32 values (12 bytes). The function makes [w] positive first, thus the reader can find [w] from [x,y,z].
unpack_quat_96_unsafe¶
rtm::quatf unpack_quat_96_unsafe(const uint8_t* data_ptr)
Assumes the data_ptr is padded in order to load up to 16 bytes from it.
pack_quat_48¶
void pack_quat_48(rtm::quatf rotation, uint8_t* out_rotation_data)
Writes the [x,y,z] components of a quaternion with 16 bits each (6 bytes). The function makes [w] positive first, thus the reader can find [w] from [x,y,z].
unpack_quat_48¶
rtm::quatf unpack_quat_48(const uint8_t* data_ptr)
Reads a quaternion that pack_quat_48 wrote. The function finds [w] from [x,y,z].
pack_quat_32¶
void pack_quat_32(rtm::quatf rotation, uint8_t* out_rotation_data)
Writes the [x,y,z] components of a quaternion with 11, 11, and 10 bits (4 bytes). The function makes [w] positive first, thus the reader can find [w] from [x,y,z].
unpack_quat_32¶
rtm::quatf unpack_quat_32(const uint8_t* data_ptr)
Reads a quaternion that pack_quat_32 wrote. The function finds [w] from [x,y,z].
get_packed_rotation_size¶
constexpr uint32_t get_packed_rotation_size(rotation_format8 format)
Returns the size in bytes of a full precision rotation sample with the given rotation format.
get_range_reduction_rotation_size¶
constexpr uint32_t get_range_reduction_rotation_size(rotation_format8 format)
Returns the size in bytes of the clip range of a rotation sub-track with the given rotation format: the minimum and the extent of each component, with float32 values.