   (let [[slope1 off1] (slope-offset seg1)
         [slope2 off2] (slope-offset seg2)]
     (cond
+     (and (not slope1) (not slope2))
+     nil
+
      (and slope1 slope2)
      (let [x (/ (- off2 off1) (- slope1 slope2))
            y (+ (* x slope1) off1)]

   :else
   nil))

;;(constrain-intersect [0.5 0 0] [[0.5 0.5] [0.5 -0.5]] [[0 0] [1 0]])

(defn line-segment-intersect [seg1 seg2]
  (let [intersect (line-intersect seg1 seg2)]
    (constrain-intersect intersect seg1 seg2)))

;(line-intersect [[0.5 0.5] [0.5 -0.5]] [[0 0] [1 0]])
;;(line-segment-intersect [[0.5 0.5] [0.5 -0.5]] [[0 0] [1 0]])

(defn arm-face-intersect [arm face]
  ;; facing down, towards y-axis


(defn position [block]
  (physics/get-position (:phys block)))

(defn face-intersect [face pointer]
  ;; intersects in 2D (facing z)
