Skip to content

acl/core/track_writer.h

#include "acl/core/track_writer.h"

The interface that decompression uses to write the sample values.

default_sub_track_mode

enum class default_sub_track_mode
{
    skipped,
    constant,
    variable,
    legacy,
};

Describes how sub-tracks are processed. Sub-tracks can be skipped and not written (assumes that the caller knows what they are doing, probably pre-fills the output buffer), they can be constant (e.g. identity) or they can vary per sub-track (e.g. bind pose).

Value Description
skipped Sub-tracks are skipped entirely (e.g. caller pre-fills the output buffer).
constant Sub-tracks have a constant default value (e.g. identity).
variable Sub-tracks have a variable default value (e.g. bind pose).
legacy Scale sub-tracks have the pre ACL 2.1 behavior and will be constant and default to 1.0 for additive0 and 0.0 for additive1 See additive_clip_format8 This is only for backwards compatibility and will be deprecated/removed for ACL 3.0 To handle additive scale properly, use the correct sub-track mode and ensure the track_writer returns the correct value You can query what scale value to use from compressed_tracks::get_default_scale() USED FOR SCALE SUB-TRACKS ONLY !!! warning "Deprecated" Use constant instead and make sure the track_writer returns the correct value

track_writer

struct track_writer

We use a struct like this to allow an arbitrary format on the end user side. Since our decode function is templated on this type implemented by the user, the callbacks can trivially be inlined and customized. Only called functions need to be overridden and implemented.

track_writer::get_rounding_policy

constexpr sample_rounding_policy get_rounding_policy(
    sample_rounding_policy seek_policy,
    uint32_t) const

This allows the host runtime to control which rounding policy to use per track. To enable this, make sure that the decompression_settings supports this feature and provide sample_rounding_policy::per_track to the seek function. This function is called when the decompression settings enable the feature. If per track rounding isn't used, this function must return the seek policy provided as an argument (the one passed to the seek(..) function). If per track rounding is specified when seeking, this function must return a valid per track value. This function cannot return the per_track value. Doing so will assert at runtime.

track_writer::skip_track_float1

constexpr bool skip_track_float1(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::skip_track_float2

constexpr bool skip_track_float2(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::skip_track_float3

constexpr bool skip_track_float3(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::skip_track_float4

constexpr bool skip_track_float4(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::skip_track_vector4

constexpr bool skip_track_vector4(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::write_float1

void write_float1(uint32_t track_index, rtm::scalarf value)

Called by the decoder to write out a value for a specified track index.

track_writer::write_float2

void write_float2(uint32_t track_index, rtm::vector4f value)

Called by the decoder to write out a value for a specified track index.

track_writer::write_float3

void write_float3(uint32_t track_index, rtm::vector4f value)

Called by the decoder to write out a value for a specified track index.

track_writer::write_float4

void write_float4(uint32_t track_index, rtm::vector4f value)

Called by the decoder to write out a value for a specified track index.

track_writer::write_vector4

void write_vector4(uint32_t track_index, rtm::vector4f value)

Called by the decoder to write out a value for a specified track index.

track_writer::get_default_rotation_mode

static constexpr default_sub_track_mode get_default_rotation_mode()

If default sub-tracks aren't skipped, a value must be written. Either they are constant for every sub-track (e.g. identity) or they vary per sub-track (e.g. bind pose). By default, default sub-tracks are constant and the identity. Must be static constexpr!

track_writer::get_default_translation_mode

static constexpr default_sub_track_mode get_default_translation_mode()

If default sub-tracks aren't skipped, a value must be written. Either they are constant for every sub-track (e.g. identity) or they vary per sub-track (e.g. bind pose). By default, default sub-tracks are constant and the identity. Must be static constexpr!

track_writer::get_default_scale_mode

static constexpr default_sub_track_mode get_default_scale_mode()

If default sub-tracks aren't skipped, a value must be written. Either they are constant for every sub-track (e.g. identity) or they vary per sub-track (e.g. bind pose). By default, default sub-tracks are constant and the identity. Must be static constexpr!

track_writer::get_constant_default_rotation

rtm::quatf get_constant_default_rotation() const

If default sub-tracks are constant, these functions return their value.

track_writer::get_constant_default_translation

rtm::vector4f get_constant_default_translation() const

If default sub-tracks are constant, these functions return their value.

track_writer::get_constant_default_scale

rtm::vector4f get_constant_default_scale() const

If default sub-tracks are constant, these functions return their value.

track_writer::get_variable_default_rotation

rtm::quatf get_variable_default_rotation(uint32_t) const

If default sub-tracks are variable, these functions return their value.

track_writer::get_variable_default_translation

rtm::vector4f get_variable_default_translation(uint32_t) const

If default sub-tracks are variable, these functions return their value.

track_writer::get_variable_default_scale

rtm::vector4f get_variable_default_scale(uint32_t) const

If default sub-tracks are variable, these functions return their value.

track_writer::skip_all_rotations

static constexpr bool skip_all_rotations()

These allow host runtimes to control which track types they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be static constexpr!

track_writer::skip_all_translations

static constexpr bool skip_all_translations()

These allow host runtimes to control which track types they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be static constexpr!

track_writer::skip_all_scales

static constexpr bool skip_all_scales()

These allow host runtimes to control which track types they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be static constexpr!

track_writer::skip_track_rotation

constexpr bool skip_track_rotation(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::skip_track_translation

constexpr bool skip_track_translation(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::skip_track_scale

constexpr bool skip_track_scale(uint32_t) const

These allow host runtimes to control which tracks they are interested in. This information allows the codecs to avoid unpacking values that are not needed. Must be non-static member functions!

track_writer::write_rotation

void write_rotation(uint32_t track_index, rtm::quatf rotation)

Called by the decoder to write out a quaternion rotation value for a specified bone index.

track_writer::write_translation

void write_translation(uint32_t track_index, rtm::vector4f translation)

Called by the decoder to write out a translation value for a specified bone index.

track_writer::write_scale

void write_scale(uint32_t track_index, rtm::vector4f scale)

Called by the decoder to write out a scale value for a specified bone index.