 (defn deg->rad [deg]
   (* (* 2 Math/PI) (/ deg 360)))
 
-(defn gen-rotate-behavior [target & {:keys [from to time rotation-anchor]
-                                     :or {from 0 to 0 time 120 rotation-anchor [0.5 0.5]}}]
-  (let [[start-time time] (if (vector? time) time [(.time target) time])]
+(defn gen-rotate-behavior [& {:keys [from to time rotation-anchor]
+                              :or {from 0 to 0 time 120 rotation-anchor [0.5 0.5]}}]
+  (let [[start-time time] (if (vector? time) time [0 time])]
     (doto (CAAT/RotateBehavior.)
       (.setFrameTime start-time time) 
       (.setValues (deg->rad from)

              (set! this.isOpened true))))

    (set! basket-container.doClose
          (fn []
            (when this.isOpened
              ;; (log/info logger "Closing basket")
              (doto basket-head
                (. (emptyBehaviorList))
                (.setRotation 0)
                (.addBehavior (gen-move-behavior basket-head :from {:up 30})))
              (.addBehavior basket-body
                            (doto (CAAT/ScaleBehavior.)
                              (.setFrameTime (.time basket-body) 120)


(defn throw-into-basket
  "Animate a TARGET by moving it into the BASKET."
  [director scene basket target counter] 
  (let [total-animation-time 400
        source (.modelToView target (CAAT/Point. 0 0))
        destination (.modelToView basket (CAAT/Point. 0 0))
