Clean up static macros and add more to g3d

This commit is contained in:
oakes
2014-01-29 03:11:59 -05:00
parent d2ffe4463f
commit 0efbe68fb5
4 changed files with 65 additions and 18 deletions

View File

@@ -11,35 +11,35 @@
(defmacro geometry!
"Calls a single method on [GeometryUtils](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/GeometryUtils.html)"
[k & options]
`(~(u/static-symbol [:math :GeometryUtils k] u/key->camel) ~@options))
`(~(u/static-camel :math :GeometryUtils k) ~@options))
(defmacro interpolation
"Returns a static class in [Interpolation](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/Interpolation.html)
(interpolation :bounce)"
[k]
`~(symbol (str u/main-package ".math.Interpolation$" (u/key->pascal k))))
`~(static-class :math :Interpolation k))
(defmacro intersector!
"Calls a single method on [Intersector](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/Intersector.html)
(intersector! :is-point-in-triangle 0 1 0 0 1 2 3 0)"
[k & options]
`(~(u/static-symbol [:math :Intersector k] u/key->camel) ~@options))
`(~(u/static-camel :math :Intersector k) ~@options))
(defmacro math!
"Calls a single method on [MathUtils](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/MathUtils.html)
(math! :ceil 0.1)"
[k & options]
`(~(u/static-symbol [:math :MathUtils k] u/key->camel) ~@options))
`(~(u/static-camel :math :MathUtils k) ~@options))
(defmacro plane-side
"Returns a static field in [Plane.PlaneSide](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/Plane.PlaneSide.html)
(plane-side :back)"
[k]
`~(symbol (str u/main-package ".math.Plane$PlaneSide/" (u/key->pascal k))))
`~(u/static-class :math :Plane (str "PlaneSide/" (u/key->pascal k))))
; bezier