;;-*-Lisp-*-
(in-package goal)

;; name: glider-h.gc
;; name in dgo: glider-h
;; dgos: HGA

(declare-type h-glide hvehicle)
(define-extern inside-cloudbox? (function vector symbol))
(define-extern inside-cloudbox-xz? (function vector symbol))
(define-extern move-pos-inside-cloudbox! (function vector none))
(define-extern glider-thermal-updraft-velocity (function h-glider none))
(define-extern desert-glide-task-done (function symbol))

;; DECOMP BEGINS

(deftype glider-thermal-info (structure)
  ((pos           vector  :inline)
   (r             float   :overlay-at (-> pos data 3))
   (hheight       float)
   (windspeed     float)
   (curpos        float)
   (thermal-time  time-frame)
   )
  (:methods
    (to-static-macro (_type_ object) none)
    )
  )


(deftype glider-ring-info (structure)
  ((pos         vector  :inline)
   (forw        vector  :inline)
   (boost       float)
   (dist        float)
   (xdist       float)
   (ydist       float)
   (toff        time-frame)
   (speedmod    float)
   (shootable   symbol)
   (lastring    symbol)
   (checkpoint  uint8)
   )
  (:methods
    (to-static-macro (_type_ object) none)
    )
  )


(deftype h-glider (hvehicle)
  ((minalt                   float)
   (curalt                   float)
   (maxalt                   float)
   (rollerr                  float)
   (pitcherr                 float)
   (alterr                   float)
   (rolling                  symbol)
   (speed                    float)
   (poierr                   float)
   (poipos                   float)
   (poivel                   float)
   (deathspin                symbol)
   (in-thermal               symbol)
   (in-thermal-time          time-frame)
   (min-thermal-time         time-frame)
   (thermal-start-time       time-frame)
   (thermal-strength         float)
   (deathrot                 vector                  :inline)
   (last-ring-pos            vector                  :inline)
   (progression-plane        vector                  :inline)
   (birth                    time-frame)
   (stop-time                time-frame)
   (pitch-down-time          time-frame)
   (pitch-side-time          time-frame)
   (ambient-wind-sound-time  time-frame)
   (thermal-sound-time       time-frame)
   (updraft-vel              float)
   (updraft-acc              float)
   (updraft-err              float)
   (rel-up-vel               float)
   (flap-pos                 float)
   (amb-sound                sound-id)
   (amb-sound-playing        symbol)
   (full-speed-boost?        symbol)
   (lost-lift?               symbol)
   (lost-lift-time           time-frame)
   (right-rudder             joint-mod-rotate-local  :inline)
   (left-rudder              joint-mod-rotate-local  :inline)
   (right-alerone            joint-mod-rotate-local  :inline)
   (left-alerone             joint-mod-rotate-local  :inline)
   (flap                     joint-mod-set-local     6 :inline)
   )
  (:methods
    (h-glider-method-162 (_type_) none)
    )
  )
