Allow the camera functions to take the camera object directly
This commit is contained in:
@@ -269,9 +269,10 @@
|
|||||||
`(u/call! ^PerspectiveCamera (or (:camera ~screen) ~screen) ~k ~@options))
|
`(u/call! ^PerspectiveCamera (or (:camera ~screen) ~screen) ~k ~@options))
|
||||||
|
|
||||||
(defn size!
|
(defn size!
|
||||||
[{:keys [^OrthographicCamera camera]} width height]
|
[screen width height]
|
||||||
(assert camera)
|
(let [^OrthographicCamera camera (or (:camera screen) screen)]
|
||||||
(.setToOrtho camera false width height))
|
(assert camera)
|
||||||
|
(.setToOrtho camera false width height)))
|
||||||
|
|
||||||
(defn height!
|
(defn height!
|
||||||
[screen new-height]
|
[screen new-height]
|
||||||
@@ -282,22 +283,25 @@
|
|||||||
(size! screen new-width (* new-width (/ (game :height) (game :width)))))
|
(size! screen new-width (* new-width (/ (game :height) (game :width)))))
|
||||||
|
|
||||||
(defn x!
|
(defn x!
|
||||||
[{:keys [^Camera camera]} x]
|
[screen x]
|
||||||
(assert camera)
|
(let [^Camera camera (or (:camera screen) screen)]
|
||||||
(set! (. (. camera position) x) x)
|
(assert camera)
|
||||||
(.update camera))
|
(set! (. (. camera position) x) x)
|
||||||
|
(.update camera)))
|
||||||
|
|
||||||
(defn y!
|
(defn y!
|
||||||
[{:keys [^Camera camera]} y]
|
[screen y]
|
||||||
(assert camera)
|
(let [^Camera camera (or (:camera screen) screen)]
|
||||||
(set! (. (. camera position) y) y)
|
(assert camera)
|
||||||
(.update camera))
|
(set! (. (. camera position) y) y)
|
||||||
|
(.update camera)))
|
||||||
|
|
||||||
(defn z!
|
(defn z!
|
||||||
[{:keys [^Camera camera]} z]
|
[screen z]
|
||||||
(assert camera)
|
(let [^Camera camera (or (:camera screen) screen)]
|
||||||
(set! (. (. camera position) z) z)
|
(assert camera)
|
||||||
(.update camera))
|
(set! (. (. camera position) z) z)
|
||||||
|
(.update camera)))
|
||||||
|
|
||||||
(defn position!
|
(defn position!
|
||||||
([screen x y]
|
([screen x y]
|
||||||
|
|||||||
Reference in New Issue
Block a user