From f3025b5ba415742610f3238bc916b4b83c5b0f11 Mon Sep 17 00:00:00 2001 From: Red-Thirten Date: Thu, 4 Jan 2024 11:12:10 -0800 Subject: [PATCH] Update Matrix4x4fMathExtra.nlvm Added comments --- .../scripts/util/Matrix4x4fMathExtra.nlvm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flying_camera_route_tool/scripts/util/Matrix4x4fMathExtra.nlvm b/flying_camera_route_tool/scripts/util/Matrix4x4fMathExtra.nlvm index 5e2e1f0..c1e1f9c 100644 --- a/flying_camera_route_tool/scripts/util/Matrix4x4fMathExtra.nlvm +++ b/flying_camera_route_tool/scripts/util/Matrix4x4fMathExtra.nlvm @@ -1,4 +1,6 @@ -public static void matrixToEuler(Matrix4x4f m, Vector3f e){ +// These are not needed because NL2 already has com.nolimitscoaster.Tools.matrixToPitchHeadBankPosScale + +public static void matrixToEuler(Matrix4x4f m, Vector3f e){ // Works // Assuming the angles are in radians. if (m.elemAt(2,1) > 0.998f){ // singularity at north pole e.x = (float) (Math.PI/2); // attitude @@ -17,7 +19,7 @@ public static void matrixToEuler(Matrix4x4f m, Vector3f e){ e.z = (float) (Math.atan2((double) m.elemAt(0,1), (double) m.elemAt(1,1))); // heading } -public static void eulerToMatrix(Vector3f e, Matrix4x4f m){ +public static void eulerToMatrix(Vector3f e, Matrix4x4f m){ // Doesn't work // Assuming the angles are in radians. float ch = (float) (Math.cos((double) e.y)); float sh = (float) (Math.sin((double) e.y));