From e6bb431bf82dc225ea5a22ebf2a0b8a61433d57c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 22:55:37 +0000 Subject: [PATCH] Decompile fn_02026 (matrix::IsIdentity) Batch #10643 by StrawberrysherbetIX: 1 byte-identical, 0 confirmed by peer review. - fn_02026 matrix::IsIdentity: byte-identical Peer-reviewed-by: ragnarok-clanker, Yommy, dori, cremane Merged automatically: every function is byte-identical to the original. --- Source/Utility/Math/AffineMatrix.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Source/Utility/Math/AffineMatrix.cpp b/Source/Utility/Math/AffineMatrix.cpp index f1ad3997..9bcdff25 100644 --- a/Source/Utility/Math/AffineMatrix.cpp +++ b/Source/Utility/Math/AffineMatrix.cpp @@ -184,16 +184,13 @@ void matrix::MakeInverse(const matrix& source) { // OFFSET: 0x00554620 // FUNCTION: fn_02026 int matrix::IsIdentity() const { - const auto absolute = [](float value) { - return std::bit_cast(std::bit_cast(value) & 0x7FFFFFFFu); - }; const float tolerance = 1.0e-5f; - if (absolute(this->values[0] - 1.0f) > tolerance || absolute(this->values[4] - 1.0f) > tolerance || - absolute(this->values[8] - 1.0f) > tolerance || absolute(this->values[1]) > tolerance || - absolute(this->values[2]) > tolerance || absolute(this->values[3]) > tolerance || - absolute(this->values[5]) > tolerance || absolute(this->values[6]) > tolerance || - absolute(this->values[7]) > tolerance || absolute(this->values[9]) > tolerance || - absolute(this->values[10]) > tolerance || absolute(this->values[11]) > tolerance) { + if (std::fabs(this->values[0] - 1.0f) > tolerance || std::fabs(this->values[4] - 1.0f) > tolerance || + std::fabs(this->values[8] - 1.0f) > tolerance || std::fabs(this->values[1]) > tolerance || + std::fabs(this->values[2]) > tolerance || std::fabs(this->values[3]) > tolerance || + std::fabs(this->values[5]) > tolerance || std::fabs(this->values[6]) > tolerance || + std::fabs(this->values[7]) > tolerance || std::fabs(this->values[9]) > tolerance || + std::fabs(this->values[10]) > tolerance || std::fabs(this->values[11]) > tolerance) { return 0; } return 1;