Skip to content

Commit

Permalink
wip7
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeodrippe committed Jan 14, 2025
1 parent 14e77f5 commit c4c0f09
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions test/vybe/flecs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
:inout (flecs/EcsIn)
:oper (flecs/EcsOptional)}]}})))))

(deftest default-systems-test
#_(deftest default-systems-test
(let [w (vf/make-world)]
(vf/eid w vt/Translation)
(vf/eid w vt/Rotation)
Expand Down Expand Up @@ -194,27 +194,6 @@
[:m12 :m13 :m15])))))

;; -- Macro system.
(vc/defn* vybe-transform-2 :- :void
[it :- [:* vf/iter_t]]
(let [pos (field it vt/Translation 0)
rot (field it vt/Rotation 1)
scale (field it vt/Scale 2)

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)]

(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)
(if is-parent-set
(reset! @t-global (vr.c/matrix-multiply local (nth transform-parent 0)))
(reset! @t-global local))))))

(vp/defnc ddd :- :long
[w :- :*]
(let [q (vf/parse-query-expr w
Expand All @@ -235,7 +214,7 @@
id (bit-or (flecs/EcsCascade) (flecs/EcsUp))
system-desc (vf/system_desc_t
{:entity e
:callback (vp/mem vybe-transform-2)
:callback (vp/mem vybe-transform)
:query q})]
(tap> id)
(vf.c/ecs-system-init
Expand Down Expand Up @@ -279,7 +258,7 @@
transform-parent
(vr.c/matrix-multiply transform-parent)))))

#_(deftest default-systems-2-test
(deftest default-systems-2-test
(let [w (vf/make-world)]
(vf/eid w vt/Translation)
(vf/eid w vt/Rotation)
Expand Down

0 comments on commit c4c0f09

Please sign in to comment.