Initialize circles with a radius

This commit is contained in:
oakes
2014-01-17 22:50:06 -05:00
parent 5a4d4735ea
commit e0371d4d28

View File

@@ -110,12 +110,16 @@
`(u/call! ^ChainShape ~object ~k ~@options)) `(u/call! ^ChainShape ~object ~k ~@options))
(defn circle* (defn circle*
[] ([]
(CircleShape.)) (CircleShape.))
([radius]
(doto (circle*)
(.setRadius radius)
(.setPosition (m/vector-2 radius radius)))))
(defmacro circle (defmacro circle
[& options] [radius & options]
`(u/calls! ^CircleShape (circle*) ~@options)) `(u/calls! ^CircleShape (circle* ~radius) ~@options))
(defmacro circle! (defmacro circle!
[object k & options] [object k & options]