UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAnimationCompression_PerTrackUtils Class Reference

#include <AnimationCompression.h>

Static Public Member Functions

static uint16 CompressFixed16 (float Value, int32 Log2MaxValue=0)
 
template<int32 Log2MaxValue>
static float DecompressFixed16 (uint16 Value)
 
static int32 MakeHeader (const int32 NumKeys, const int32 KeyFormat, const int32 KeyFlags, bool bReallyNeedsFrameTable)
 
static int32 GetKeyCountFromHeader (int32 Header)
 
static void GetAllSizesFromFormat (int32 KeyFormat, int32 FormatFlags, int32 &KeyComponentCount, int32 &KeyComponentSize, int32 &FixedComponentCount, int32 &FixedComponentSize)
 
static void GetByteSizesFromFormat (int32 KeyFormat, int32 FormatFlags, int32 &BytesPerKey, int32 &FixedBytes)
 
static void DecomposeHeader (int32 Header, int32 &KeyFormat, int32 &NumKeys, int32 &FormatFlags)
 
static void DecomposeHeader (int32 Header, int32 &KeyFormat, int32 &NumKeys, int32 &FormatFlags, int32 &BytesPerKey, int32 &FixedBytes)
 
template<bool bIsDataAligned = true>
static void DecompressTranslation (int32 Format, int32 FormatFlags, FVector3f &Out, const uint8 *RESTRICT TopOfStream, const uint8 *RESTRICT KeyData)
 
template<bool bIsDataAligned = true>
static void DecompressRotation (int32 Format, int32 FormatFlags, FQuat4f &Out, const uint8 *RESTRICT TopOfStream, const uint8 *RESTRICT KeyData)
 
template<bool bIsDataAligned = true>
static void DecompressScale (int32 Format, int32 FormatFlags, FVector3f &Out, const uint8 *RESTRICT TopOfStream, const uint8 *RESTRICT KeyData)
 
template<>
float DecompressFixed16 (uint16 Value)
 

Detailed Description

This class contains helper methods for dealing with animations compressed with the per-track codec

Member Function Documentation

◆ CompressFixed16()

static uint16 FAnimationCompression_PerTrackUtils::CompressFixed16 ( float  Value,
int32  Log2MaxValue = 0 
)
inlinestatic

Compresses a float into a signed fixed point number, which can range from the symmetrical values of -2^Log2MaxValue .. 2^Log2MaxValue. No clamping is done, values that don't fit will overflow.

For example, a Log2MaxValue of 0 can encode -1..1, and 7 can encode -128..128.

Parameters
ValueValue to encode
Log2MaxValueEncoding range (can be 0..15)
Returns
The quantized value

◆ DecomposeHeader() [1/2]

static void FAnimationCompression_PerTrackUtils::DecomposeHeader ( int32  Header,
int32 KeyFormat,
int32 NumKeys,
int32 FormatFlags 
)
inlinestatic

Decomposes a header created with MakeHeader into three/four fields (two are still left packed into FormatFlags):

Parameters
HeaderThe header to decompose
KeyFormat[OUT] The encoding format used for each key
NumKeys[OUT] The number of keys in this track
FormatFlags[OUT] Three bits of format-specific information and a single bit to indicate if a key->frame table follows the keys

◆ DecomposeHeader() [2/2]

static void FAnimationCompression_PerTrackUtils::DecomposeHeader ( int32  Header,
int32 KeyFormat,
int32 NumKeys,
int32 FormatFlags,
int32 BytesPerKey,
int32 FixedBytes 
)
inlinestatic

Decomposes a header created with MakeHeader into three/four fields (two are still left packed into FormatFlags):

Parameters
HeaderThe header to decompose
KeyFormat[OUT] The encoding format used for each key
NumKeys[OUT] The number of keys in this track
FormatFlags[OUT] Three bits of format-specific information and a single bit to indicate if a key->frame table follows the keys

And some derived values:

Parameters
BytesPerKey[OUT] The number of bytes each key takes up
FixedBytes[OUT] The number of fixed bytes at the head of the track stream

◆ DecompressFixed16() [1/2]

template<int32 Log2MaxValue>
static float FAnimationCompression_PerTrackUtils::DecompressFixed16 ( uint16  Value)
inlinestatic

Decompresses a fixed point number encoded by ComrpessFixed16

Parameters
ValueValue to decode
Log2MaxValueEncoding range (can be 0..15)
Returns
The decompressed value

◆ DecompressFixed16() [2/2]

template<>
float FAnimationCompression_PerTrackUtils::DecompressFixed16 ( uint16  Value)
inlinestatic

◆ DecompressRotation()

template<bool bIsDataAligned = true>
static void FAnimationCompression_PerTrackUtils::DecompressRotation ( int32  Format,
int32  FormatFlags,
FQuat4f Out,
const uint8 *RESTRICT  TopOfStream,
const uint8 *RESTRICT  KeyData 
)
inlinestatic

Decompress a single rotation key from a single track that was compressed with the PerTrack codec (scalar)

◆ DecompressScale()

template<bool bIsDataAligned = true>
static void FAnimationCompression_PerTrackUtils::DecompressScale ( int32  Format,
int32  FormatFlags,
FVector3f Out,
const uint8 *RESTRICT  TopOfStream,
const uint8 *RESTRICT  KeyData 
)
inlinestatic

Decompress a single Scale key from a single track that was compressed with the PerTrack codec (scalar)

◆ DecompressTranslation()

template<bool bIsDataAligned = true>
static void FAnimationCompression_PerTrackUtils::DecompressTranslation ( int32  Format,
int32  FormatFlags,
FVector3f Out,
const uint8 *RESTRICT  TopOfStream,
const uint8 *RESTRICT  KeyData 
)
inlinestatic

Decompress a single translation key from a single track that was compressed with the PerTrack codec (scalar)

◆ GetAllSizesFromFormat()

static void FAnimationCompression_PerTrackUtils::GetAllSizesFromFormat ( int32  KeyFormat,
int32  FormatFlags,
int32 KeyComponentCount,
int32 KeyComponentSize,
int32 FixedComponentCount,
int32 FixedComponentSize 
)
inlinestatic

Figures out the size of various parts of a compressed track from the format and format flags combo

Parameters
KeyFormatThe encoding format used for each key
FormatFlagsThree bits of format-specific information and a single bit to indicate if a key->frame table follows the keys

◆ GetByteSizesFromFormat()

static void FAnimationCompression_PerTrackUtils::GetByteSizesFromFormat ( int32  KeyFormat,
int32  FormatFlags,
int32 BytesPerKey,
int32 FixedBytes 
)
inlinestatic

◆ GetKeyCountFromHeader()

static int32 FAnimationCompression_PerTrackUtils::GetKeyCountFromHeader ( int32  Header)
inlinestatic

Extracts the number of keys from a header created by MakeHeader

Parameters
HeaderHeader to extract the number of keys from
Returns
The number of keys encoded in the header

◆ MakeHeader()

static int32 FAnimationCompression_PerTrackUtils::MakeHeader ( const int32  NumKeys,
const int32  KeyFormat,
const int32  KeyFlags,
bool  bReallyNeedsFrameTable 
)
inlinestatic

Creates a header integer with four fields: NumKeys can be no more than 24 bits (positions 0..23) KeyFlags can be no more than 3 bits (positions 24..27) bReallyNeedsFrameTable is a single bit (position 27) KeyFormat can be no more than 4 bits (positions 31..28)


The documentation for this class was generated from the following file: