   #_(reset! *update-handlers* {})
   (reset! *physics* nil)
   (reset! *objects* {}))
+
+(defn disable-collisions "Disable collision detection." [] (reset! collisions-enabled false))
+(defn enable-collisions "Enable collision detection." [] (reset! collisions-enabled true))
+
+(defn disable-neighborhoods "Disable neighborhood detection." [] (reset! neighborhoods-enabled false))
+(defn enable-neighborhoods "Enable neighborhood detection." [] (reset! neighborhoods-enabled true))
 
 (defn start-gui 
   "Start the simulation with a GUI."

           (org.lwjgl.opengl Display GL11)
           (org.lwjgl BufferUtils)))

(def #^:dynamic *gui-state* (atom {:rotate-mode :none :translate-mode :none                                    
                                   :rot-x 0 :rot-y 0 :rot-z 0
                                   :shift-x 0 :shift-y -20 :shift-z -50;-30                                   

(defn mouse-drag
  "Rotate the world."
  [[dx dy] _ button state]
  (let [rads (/ (Math/PI) 180)
        thetaY (*(:rot-y state) rads)
        sY (sin thetaY)
        cY (cos thetaY)
        thetaX (* (:rot-x state) rads)
        sX (sin thetaX)
        cX (cos thetaX)]  
	  (when @shift-key-down
	    (cond 
	      ; Rotate
	      (= :left button)
	      (swap! *gui-state* assoc
	             :rot-x (+ (:rot-x @*gui-state*) dy)
	             :rot-y (+ (:rot-y @*gui-state*) dx))
	      (= :right button)
	      (swap! *gui-state* assoc
	             :shift-x (+ (:shift-x @*gui-state*) (* dx cY))
	             :shift-y (- (:shift-y @*gui-state*) (* dy cX))
	             :shift-z (+ (:shift-z @*gui-state*) (* dx sY))
	             )
	      ; Zoom
	      (= :center button)
	      (swap! *gui-state* assoc
	             :shift-x (+ (:shift-x @*gui-state*) (* (/ dy 6) (* sY -1)))
	             :shift-y (+ (:shift-y @*gui-state*) (* (/ dy 6) sX))
	             :shift-z (+ (:shift-z @*gui-state*) (* (/ dy 6) cY))           
	             ))))
  state)

(defn mouse-wheel
  "Respond to a mousewheel movement. dw is +/- depending on scroll-up or down."
  [dw state]
  (let [rads (/ (Math/PI) 180)
        thetaY (*(:rot-y state) rads)
        sY (sin thetaY)
        cY (cos thetaY)
        thetaX (* (:rot-x state) rads)
        sX (sin thetaX)
        cX (cos thetaX)]
  (swap! *gui-state* assoc
						         :shift-z (+ (:shift-z @*gui-state*) (* (/ dw 6) cY))
						         :shift-x (+ (:shift-x @*gui-state*) (* (/ dw 6) (* sY -1)))
						         :shift-y (+ (:shift-y @*gui-state*) (* (/ dw 6) sX)))
  state))

(defn mouse-move
  "Respond to a change in x,y position of the mouse."
