 
 
 ;MACROS
-(defmacro >v3 [o]
-  `(.position (.transform ~o)))
 
 (defmacro >v2 [o]
   `(UnityEngine.Vector2. 

(defn ^UnityEngine.Vector3 
  transform-point [o v]
  (when-let [o (->go o)]
    (.TransformPoint (.transform o) (>v3 v))))

(defn ^UnityEngine.Vector3 
  inverse-transform-point [o v]
  (when-let [o (->go o)]
    (.InverseTransformPoint (.transform o) (>v3 v))))

(defn ^UnityEngine.Vector3 
  inverse-transform-direction [o v]
  (when-let [o (->go o)]
    (.InverseTransformDirection (.transform o) (>v3 v))))

(defn move-towards [v1 v2 step]
  (Vector3/MoveTowards v1 v2 step))

(defn ^UnityEngine.Vector3 lerp [^UnityEngine.Vector3 v1 ^UnityEngine.Vector3 v2 ratio]
  (Vector3/Lerp (>v3 v1) (>v3 v2) ratio))

(defn ^UnityEngine.GameObject local-scale [^UnityEngine.GameObject o]
  (when-let [o (->go o)] (.localScale (.transform o) )))

(defn ^UnityEngine.GameObject local-scale! [^UnityEngine.GameObject o ^UnityEngine.Vector3 v]
  (when-let [o (->go o)] (set! (.localScale (.transform o)) (>v3 v)) o))

(defn rotate-around! [o point axis angle]
  (when-let [o (->go o)]
  (. (.transform o) (RotateAround (>v3 point) (>v3 axis) angle))))

(defn rotation [o]
  (when-let [o (->go o)] (.rotation (.transform o) )))


(def  ->go arcadia.core/gobj)
(defn ->transform [v] (arcadia.core/cmpt v UnityEngine.Transform))

(defmacro >v3 [o]
  `(.position (.transform ~o)))

(defn X [o] (.x (>v3 o)))
(defn Y [o] (.y (>v3 o)))
