From b141b4c5f4005da786e2f087e621e04b30a39e29 Mon Sep 17 00:00:00 2001 From: Paulo Feodrippe Date: Mon, 13 Jan 2025 22:53:23 -0500 Subject: [PATCH] wip5 --- test/vybe/flecs_test.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/vybe/flecs_test.clj b/test/vybe/flecs_test.clj index 70d3188..2940ad9 100644 --- a/test/vybe/flecs_test.clj +++ b/test/vybe/flecs_test.clj @@ -115,15 +115,17 @@ transform-global (field it vt/Transform 3) transform-local (field it vt/Transform 4) - is-parent-set (vf.c/ecs-field-is-set it 5) - #_ #_ transform-parent (field it vt/Transform 5)] + is-parent-set (vf.c/ecs-field-is-set it 5)] (doseq [i (range (:count @it))] (let [t-global (vp/& (nth transform-global i)) t-local (vp/& (nth transform-local i)) local (matrix-transform (nth pos i) (nth rot i) (nth scale i))] (reset! @t-local local) - (reset! @t-global local))))) + (if is-parent-set + (let [transform-parent (field it vt/Transform 5)] + (reset! @t-global (vr.c/matrix-multiply local (nth transform-parent 0)))) + (reset! @t-global local)))))) (vc/defn* default-systems :- :void [w :- :*]