-
Notifications
You must be signed in to change notification settings - Fork 0
/
nasser.clj
27 lines (25 loc) · 904 Bytes
/
nasser.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(ns source2016.nasser
(:use arcadia.core
arcadia.linear
source2016.core))
(defn camera-control [go]
;; lerp to target-position
(set! (.. go transform position)
(Vector3/Lerp (.. go transform position)
(-> go state :target-position)
0.1))
;; lerp to look-at
(let [{:keys [look-at current-look-at]
:or {current-look-at (v3 0)}}
(state go)
lerped-look-at (Vector3/Lerp
(position current-look-at)
(position look-at)
0.1)]
(swap-state! go assoc :current-look-at lerped-look-at)
(.. go transform (LookAt lerped-look-at))))
(defn cube-mover [go]
(.. go transform (Rotate 0.5 0 0) )
(.. go transform (Translate (v3 (* 1 (Math/Sin (Time/time)))
0
0))))