From b3cdcf3a67d93a66a5f024de6fde28f410c0eee2 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:14:55 -0500 Subject: [PATCH] custom actor, fix animation compression (#3802) Fix a missing scale factor when using the large mode in the animation compressor. This would make some joints have a translation of near 0 if the original animation had stuff moving a large distance Co-authored-by: water111 --- goalc/build_actor/common/animation_processing.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/goalc/build_actor/common/animation_processing.cpp b/goalc/build_actor/common/animation_processing.cpp index 55e75d8b6c..1153c101c9 100644 --- a/goalc/build_actor/common/animation_processing.cpp +++ b/goalc/build_actor/common/animation_processing.cpp @@ -188,11 +188,12 @@ void compress_frame_to_matrix(CompressedFrame* frame, void compress_trans(CompressedFrame* frame, const math::Vector3f& trans, bool big) { if (big) { // 64, 64, 32 + const math::Vector3f scaled_trans = trans * 4096.f; u64 data[1]; - memcpy(data, trans.data(), 2 * sizeof(float)); + memcpy(data, scaled_trans.data(), 2 * sizeof(float)); frame->data64.push_back(data[0]); u32 data_32[1]; - memcpy(data_32, &trans.z(), sizeof(float)); + memcpy(data_32, &scaled_trans.z(), sizeof(float)); frame->data32.push_back(data_32[0]); } else { constexpr float kTransScale = 4.f / 4096.f;