Skip to content

acl/compression/transform_space.h

#include "acl/compression/transform_space.h"

The transform space of transform tracks.

transform_space_t

enum class transform_space_t : uint8_t
{
    local = 0,
    mesh = 1,
    mesh_rotation = 2,
};

The space of the samples of transform tracks: how a sample uses the transform hierarchy. Compression uses the space to put the samples in object space, where it measures the error. The space does not change the compressed data: decompression returns the samples in the same space. Each transform track array holds its space, see track_array::set_transform_space.

Value Description
local Each transform is relative to its parent transform (local space, forward kinematics). A root transform is in object space. object_transform = mul(local_transform, parent_object_transform)
mesh Each transform is in object space (mesh space): it does not use its parent transform. The error of a transform does not move its children. object_transform = transform
mesh_rotation The rotation of each transform is in object space (mesh space). Its translation and its scale are relative to its parent transform, as in local space. The object rotation of a transform is its rotation: the rotation of its parent does not change it. The parent still moves the transform: its object translation uses the parent transform. object_transform = mul(local_transform, parent_object_transform) with local_transform.rotation = mul(transform.rotation, conjugate(parent_object_transform.rotation)) It supports the runtime transform types that compose rotations with a quaternion product: vqf, vqsf, vqvf, and vqmf. It does not support the relative base format. With the custom base format, the base adapter receives the base in this space.

get_transform_space_name

constexpr const char* get_transform_space_name(transform_space_t space)

Returns the name of a transform space.

get_transform_space

bool get_transform_space(const char* name, transform_space_t& out_space)

Finds the transform space that has the provided name. A name matches only when no other name character follows it: mesh does not match mesh_space. Returns true on success, false otherwise.