Skip to content

Commit

Permalink
tm/abs operates on the vector for ballistics
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Sep 7, 2023
1 parent b9126d5 commit ca578f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shimmers/sketches/ballistics.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

(defn fire-projectile [state {:keys [pos angle target]}]
(let [dir (v/polar 1.0 angle)
[x y] (abs (tm/- (:pos target) pos))
[x y] (tm/abs (tm/- (:pos target) pos))
;; v0 is ignoring drag
v0 (initial-velocity angle [x y])
v0' (* v0 (dr/gaussian 1.0 0.12))
Expand Down

0 comments on commit ca578f1

Please sign in to comment.