 (ns physim.core
   (:require [THREE :as THREE]))
 
+(def particle-radius 20)
+(def particle-diameter (* 2 particle-radius))
 (def particle-count 10)
-(def gravity-multiplier 100)
+(def gravity-multiplier 200)
 (def speed-limit 5)
 (def initial-speed 0)
 

                  dir (map #(/ % mag) dir)]
              (map + a
                   (if (> mag 0)
                     (map #(* % (/ gravity-multiplier (* mag mag))) dir)
                     [0 0 0]))))
          [0 0 0]
          all))


(defn mesh-from-particle
  [p]
  (let [geometry (THREE.SphereGeometry.
                  particle-radius particle-radius particle-radius)
        material (THREE.MeshNormalMaterial.)
        mesh (THREE.Mesh. geometry material)]
    (set-position! mesh (:pos p))
