From 69a40fa22ac43222371d10f57f9fb845ae908fcf Mon Sep 17 00:00:00 2001 From: idontlikegits Date: Tue, 10 Mar 2026 16:19:35 +0000 Subject: [PATCH] FIX: avoid creating new objets, reference pre-existing static object --- Client/App/util/Math.cpp | 4 ++-- Client/Rendering/AppDraw/Draw.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Client/App/util/Math.cpp b/Client/App/util/Math.cpp index b2c446d4..e0f74e51 100644 --- a/Client/App/util/Math.cpp +++ b/Client/App/util/Math.cpp @@ -203,8 +203,8 @@ namespace RBX const G3D::Matrix3& Math::getAxisRotationMatrix(int face) { - static G3D::Matrix3 y = G3D::Matrix3::fromEulerAnglesXYZ(0, 0, G3D::halfPi()); - static G3D::Matrix3 z = G3D::Matrix3::fromEulerAnglesXYZ(0, G3D::halfPi(), 0); + static G3D::Matrix3 y = G3D::Matrix3::fromEulerAnglesXYZ(0.0f, 0.0f, (float)G3D::halfPi()); + static G3D::Matrix3 z = G3D::Matrix3::fromEulerAnglesXYZ(0.0f, (float)G3D::halfPi(), 0.0f); static G3D::Matrix3 y_neg = G3D::Matrix3(y); static G3D::Matrix3 z_neg = G3D::Matrix3(z); diff --git a/Client/Rendering/AppDraw/Draw.cpp b/Client/Rendering/AppDraw/Draw.cpp index c3a375eb..05c5d221 100644 --- a/Client/Rendering/AppDraw/Draw.cpp +++ b/Client/Rendering/AppDraw/Draw.cpp @@ -84,7 +84,7 @@ namespace RBX G3D::Vector3 halfSize = part.gridSize * 0.5f; - G3D::Matrix3 rot = Math::getAxisRotationMatrix(face); + const G3D::Matrix3& relativeRotation = Math::getAxisRotationMatrix(face); G3D::Vector3 relativeTranslation; @@ -93,7 +93,7 @@ namespace RBX relativeTranslation[axis] = halfSize[axis]*posNeg; - G3D::CoordinateFrame translation(rot, relativeTranslation); + G3D::CoordinateFrame translation(relativeRotation, relativeTranslation); G3D::CoordinateFrame newObject = part.coordinateFrame*translation; adorn->setObjectToWorldMatrix(newObject);