I'm trying to call the randomVector method from the Vec2D class found here http://toxiclibs.org/docs/core/
Here is my code:
(def particles (new ArrayList))
(defn add-particle []
(dotimes [i 100]
(doto particles
;(.add (new Vec2D (random (width)) (random (height))))
(.add (Vec2D/randomVector))))
So far so good but I need to call other methods like scale and add from the same class, I have not idea how to do that in Clojure
Here is how I do it in Java:
Vec2D position = Vec2D.randomVector().scale( 60 ).add( canvasCenter );
Any help will be much appreciated
..or->with.. This is a duplicate question: stackoverflow.com/questions/8821751/…