Reorder functions so documentation is consistent

This commit is contained in:
oakes
2014-04-06 20:12:27 -04:00
parent 84f41c9216
commit 6e45161518

View File

@@ -50,14 +50,6 @@
(set! (. (. camera position) y) (/ height 2)) (set! (. (. camera position) y) (/ height 2))
(.update camera))) (.update camera)))
(defn width!
"Sets the width of the camera in `screen`, adjusting the height so the ratio
remains in tact.
(width! screen 480)"
[screen new-width]
(size! screen new-width (* new-width (/ (game :height) (game :width)))))
(defn width (defn width
"Returns the width of the camera in `screen`. "Returns the width of the camera in `screen`.
@@ -66,13 +58,13 @@ remains in tact.
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. camera viewportWidth))) (. camera viewportWidth)))
(defn height! (defn width!
"Sets the height of the camera in `screen`, adjusting the width so the ratio "Sets the width of the camera in `screen`, adjusting the height so the ratio
remains in tact. remains in tact.
(height! screen 360)" (width! screen 480)"
[screen new-height] [screen new-width]
(size! screen (* new-height (/ (game :width) (game :height))) new-height)) (size! screen new-width (* new-width (/ (game :height) (game :width)))))
(defn height (defn height
"Returns the height of the camera in `screen`. "Returns the height of the camera in `screen`.
@@ -82,12 +74,13 @@ remains in tact.
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. camera viewportHeight))) (. camera viewportHeight)))
(defn x! (defn height!
"Sets only the x position of the camera in `screen`." "Sets the height of the camera in `screen`, adjusting the width so the ratio
[screen x-val] remains in tact.
(let [^Camera camera (u/get-obj screen :camera)]
(set! (. (. camera position) x) x-val) (height! screen 360)"
(.update camera))) [screen new-height]
(size! screen (* new-height (/ (game :width) (game :height))) new-height))
(defn x (defn x
"Returns the x position of the camera in `screen`." "Returns the x position of the camera in `screen`."
@@ -95,11 +88,11 @@ remains in tact.
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. (. camera position) x))) (. (. camera position) x)))
(defn y! (defn x!
"Sets only the y position of the camera in `screen`." "Sets only the x position of the camera in `screen`."
[screen y-val] [screen x-val]
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(set! (. (. camera position) y) y-val) (set! (. (. camera position) x) x-val)
(.update camera))) (.update camera)))
(defn y (defn y
@@ -108,11 +101,11 @@ remains in tact.
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. (. camera position) y))) (. (. camera position) y)))
(defn z! (defn y!
"Sets only the z position of the camera in `screen`." "Sets only the y position of the camera in `screen`."
[screen z-val] [screen y-val]
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(set! (. (. camera position) z) z-val) (set! (. (. camera position) y) y-val)
(.update camera))) (.update camera)))
(defn z (defn z
@@ -121,6 +114,19 @@ remains in tact.
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. (. camera position) z))) (. (. camera position) z)))
(defn z!
"Sets only the z position of the camera in `screen`."
[screen z-val]
(let [^Camera camera (u/get-obj screen :camera)]
(set! (. (. camera position) z) z-val)
(.update camera)))
(defn position
"Returns the position of the camera in `screen`."
[screen]
(let [^Camera camera (u/get-obj screen :camera)]
(. camera position)))
(defn position! (defn position!
"Sets the position of the camera in `screen`." "Sets the position of the camera in `screen`."
([screen pos] ([screen pos]
@@ -135,11 +141,11 @@ remains in tact.
(when z-val (set! (. (. camera position) z) z-val)) (when z-val (set! (. (. camera position) z) z-val))
(.update camera)))) (.update camera))))
(defn position (defn direction
"Returns the position of the camera in `screen`." "Returns the direction of the camera in `screen`."
[screen] [screen]
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. camera position))) (. camera direction)))
(defn direction! (defn direction!
"Sets the direction of the camera in `screen`." "Sets the direction of the camera in `screen`."
@@ -148,11 +154,11 @@ remains in tact.
(.lookAt camera x y z) (.lookAt camera x y z)
(.update camera))) (.update camera)))
(defn direction (defn near
"Returns the direction of the camera in `screen`." "Returns the near clipping plane distance of the camera in `screen`."
[screen] [screen]
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. camera direction))) (. camera near)))
(defn near! (defn near!
"Sets the near clipping plane distance of the camera in `screen`." "Sets the near clipping plane distance of the camera in `screen`."
@@ -161,11 +167,11 @@ remains in tact.
(set! (. camera near) n) (set! (. camera near) n)
(.update camera))) (.update camera)))
(defn near (defn far
"Returns the near clipping plane distance of the camera in `screen`." "Returns the far clipping plane distance of the camera in `screen`."
[screen] [screen]
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(. camera near))) (. camera far)))
(defn far! (defn far!
"Sets the far clipping plane distance of the camera in `screen`." "Sets the far clipping plane distance of the camera in `screen`."
@@ -173,9 +179,3 @@ remains in tact.
(let [^Camera camera (u/get-obj screen :camera)] (let [^Camera camera (u/get-obj screen :camera)]
(set! (. camera far) n) (set! (. camera far) n)
(.update camera))) (.update camera)))
(defn far
"Returns the far clipping plane distance of the camera in `screen`."
[screen]
(let [^Camera camera (u/get-obj screen :camera)]
(. camera far)))