               cy (if (pos? (bit-and idx 2)) (+ y h) y)]
           [(QuadtreeNode. cx cy (* 0.5 w) (* 0.5 h) nil (if add? p)) idx]))))
   (node-bounds [this]
-    (thi.ng.geom.types.Rect. (g/vec2 x y) (* w 2) (* h 2)))
+    (thi.ng.geom.types.Rect. (g/vec2 x y) (* w 2.0) (* h 2.0)))
   (split-node [this]
     (assoc this :children qt-children :data nil))
   (add-point

  (if (:children this)
    (let [[c i] (child-for-point this p)]
      (if c
        (delete-point* c p (conj path [this i]))
        (or (ffirst path) this)))
    (if (m/delta= p (:data this))
      (if (seq path)

      (delete-point* this p [])
      this)))

(defrecord OctreeNode [^double x ^double y ^double z ^double w ^double h ^double d children data]
  TreeOps
  (child-index-for-point [this [px py pz]]
    (+ (if (< pz (+ z d)) 0 4)
