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

;; name: test-bike.gc
;; name in dgo: test-bike
;; dgos: CWI

;; DECOMP BEGINS

(deftype test-bike (bikec)
  ()
  )


(define *test-bike-constants*
  (new 'static 'rigid-body-vehicle-constants
    :info (new 'static 'rigid-body-info
      :mass 2.0
      :inv-mass 0.5
      :linear-damping 0.995
      :angular-damping 0.995
      :friction-factor 0.516
      :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0)
      :inertial-tensor-box (new 'static 'array meters 3 (meters 1.5) (meters 2) (meters 5))
      )
    :extra (new 'static 'rigid-body-object-extra-info
      :max-time-step 0.033333335
      :gravity (meters 40)
      :idle-distance (meters 50)
      :attack-force-scale 1.0
      )
    :name '*test-bike-constants*
    :flags #x11
    :object-type #xd
    :guard-type #x7
    :max-engine-thrust (meters 50)
    :inv-max-engine-thrust 0.0000048828124
    :engine-response-rate 32.0
    :engine-intake-factor 1.0
    :brake-factor 2.0
    :turbo-boost-factor 1.0
    :max-xz-speed (meters 100)
    :ground-probe-distance (meters 5)
    :ground-probe-offset (meters 0.5)
    :cos-ground-effect-angle -0.00000004371139
    :spring-lift-factor 0.35
    :air-drag-factor 1.2
    :steering-fin-angle 1820.4445
    :steering-thruster-factor 6.0
    :steering-thruster-max-gain 2.0
    :steering-thruster-half-gain-speed (meters 80)
    :tire-steering-angle 1274.3112
    :tire-static-friction 0.5
    :tire-static-friction-speed (meters 1)
    :tire-dynamic-friction 0.25
    :tire-dynamic-friction-speed (meters 3)
    :tire-inv-max-friction-speed 0.000024414063
    :airfoil-factor 8.0
    :drag-force-factor 1.0
    :speed-limiting-drag 0.75
    :pitch-control-factor 0.5
    :roll-control-factor 1.0
    :roll-angle 7281.778
    :jump-thrust-factor 0.625
    :buoyancy-factor 1.0
    :player-weight 163840.0
    :player-shift-x (meters 0.6)
    :player-shift-z (meters 0.125)
    :target-speed-offset (meters 4)
    :turning-accel (meters 20)
    :toughness-factor 1.0
    :damage-factor 4.0
    :camera-string-min-height (meters 2.5)
    :camera-string-max-height (meters 2.5)
    :camera-string-min-length (meters 5)
    :camera-string-max-length (meters 5.5)
    :camera-min-fov 16384.0
    :camera-max-fov 18204.445
    :camera-head-offset 4096.0
    :camera-foot-offset -4096.0
    :camera-air-max-angle-offset 5461.3335
    :camera-max-lookaround-speed 40960.0
    :seat-count 2
    :section-count 2
    :grab-rail-count 2
    :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2
      (new 'static 'vehicle-grab-rail-info
        :local-pos (new 'static 'inline-array vector 2
          (new 'static 'vector :x 2048.0 :w 1.0)
          (new 'static 'vector :x 2048.0 :z 8192.0 :w 1.0)
          )
        :normal (new 'static 'vector :x 1.0 :w 1.0)
        )
      (new 'static 'vehicle-grab-rail-info
        :local-pos (new 'static 'inline-array vector 2
          (new 'static 'vector :x -2048.0 :z 8192.0 :w 1.0)
          (new 'static 'vector :x -2048.0 :w 1.0)
          )
        :normal (new 'static 'vector :x -1.0 :w 1.0)
        )
      )
    :seat-array (new 'static 'inline-array vehicle-seat-info 4
      (new 'static 'vehicle-seat-info
        :position (new 'static 'vector :y 802.816 :z 1318.912 :w (the-as float #x10000))
        )
      (new 'static 'vehicle-seat-info
        :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000))
        )
      (new 'static 'vehicle-seat-info)
      (new 'static 'vehicle-seat-info)
      )
    :rider-hand-offset (new 'static 'inline-array vector 2
      (new 'static 'vector :x 2457.6 :y 409.6 :z 4710.4 :w 1.0)
      (new 'static 'vector :x -2457.6 :y 409.6 :z 4710.4 :w 1.0)
      )
    :section-bike-front (new 'static 'vehicle-section-info
      :damage-seg-array (new 'static 'array uint64 3 #x20 #x8 #x2)
      :damage-seg-count 3
      )
    :section-bike-rear (new 'static 'vehicle-section-info
      :damage-seg-array (new 'static 'array uint64 3 #x40 #x10 #x4)
      :damage-seg-count 3
      )
    :explosion #f
    :engine-pitch-scale 0.25
    :engine-pitch-offset -0.25
    :engine-pitch-mod-amp 0.05
    :engine-sound-select 2
    :engine-sound (static-sound-name "vehicle-engine")
    :thrust-sound (static-sound-name "bike-thrust")
    :scrape-sound (static-sound-name "bike-scrape-stn")
    :glance-sound (static-sound-name "bike-glance-stn")
    :impact-sound (static-sound-name "bike-impact-stn")
    :extra-sound (static-sound-name "car-by-1")
    :explosion-part #xa1
    :headlight-count 1
    :taillight-count 1
    :thruster-flame-width (meters 0.6)
    :thruster-flame-length (meters 2)
    :thruster-local-pos (new 'static 'inline-array vector 2
      (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0)
      (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0)
      )
    :exhaust-local-pos (new 'static 'inline-array vector 2
      (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0)
      (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :w 1.0)
      )
    :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0))
    :smoke-local-pos (new 'static 'inline-array vector 2
      (new 'static 'vector :x 1638.4 :y -2048.0 :z 7372.8 :w 1.0)
      (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0)
      )
    :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0))
    :headlight-local-pos (new 'static 'inline-array vector 3
      (new 'static 'vector :y -614.4 :z 13721.6 :w 1.0)
      (new 'static 'vector)
      (new 'static 'vector)
      )
    :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 614.4 :z -7168.0 :w 1.0) (new 'static 'vector))
    :lift-thruster-count 2
    :roll-thruster-count 2
    :steering-thruster-count 2
    :stabilizer-count 4
    :inv-lift-thruster-count 0.5
    :lift-thruster-array (new 'static 'inline-array vehicle-control-point 2
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 7372.8003 :w 1.0)
        :normal (new 'static 'vector :y -1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -2457.6 :w 1.0)
        :normal (new 'static 'vector :y -1.0 :w 1.0)
        )
      )
    :roll-thruster-array (new 'static 'inline-array vehicle-control-point 2
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0)
        :normal (new 'static 'vector :x 0.3 :y -0.6 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0)
        :normal (new 'static 'vector :x -0.3 :y -0.6 :w 1.0)
        )
      )
    :steering-thruster-array (new 'static 'inline-array vehicle-control-point 2
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 10240.0 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -5324.8 :w 1.0)
        :normal (new 'static 'vector :x -1.0 :w 1.0)
        )
      )
    :stabilizer-array (new 'static 'inline-array vehicle-control-point 6
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -5734.4 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 10649.6 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 0.25)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 2457.6 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 0.75)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -5734.4 :w 1.0)
        :normal (new 'static 'vector :y 1.0 :w 0.25)
        )
      (new 'static 'vehicle-control-point)
      (new 'static 'vehicle-control-point)
      )
    :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0)
    :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0)
    :color-option-count 1
    :color-option-array (new 'static 'inline-array vector 1 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0))
    )
  )

(defmethod init-skel-and-rigid-body ((this test-bike))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f)))
    (the-as pair 0)
    )
  (alloc-and-init-rigid-body-control this *test-bike-constants*)
  (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 7 #t))
  (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t))
  (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 9 #t))
  (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t))
  (set! (-> this fin2-fl) (new 'process 'joint-mod-rotate-local this 4 #t))
  (set! (-> this fin2-fr) (new 'process 'joint-mod-rotate-local this 5 #t))
  (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 8 #t))
  (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 11 #t))
  (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 12 #t))
  (set! (-> this spoiler-l) (new 'process 'joint-mod-rotate-local this 13 #t))
  (set! (-> this spoiler-r) (new 'process 'joint-mod-rotate-local this 14 #t))
  0
  (none)
  )

(deftype evan-test-bike (bikea)
  ()
  )


(define *evan-test-bike-constants*
  (new 'static 'rigid-body-vehicle-constants
    :info (new 'static 'rigid-body-info
      :mass 2.0
      :inv-mass 0.5
      :linear-damping 0.995
      :angular-damping 0.995
      :bounce-factor 0.4
      :friction-factor 0.05
      :bounce-mult-factor 1.22
      :cm-offset-joint (new 'static 'vector :z 2457.6 :w 1.0)
      :inertial-tensor-box (new 'static 'array meters 3 (meters 3) (meters 4) (meters 6))
      )
    :extra (new 'static 'rigid-body-object-extra-info
      :max-time-step 0.033333335
      :gravity (meters 40)
      :idle-distance (meters 50)
      :attack-force-scale 1.0
      )
    :name '*evan-test-bike-constants*
    :flags #x70
    :object-type #xb
    :guard-type #x7
    :max-engine-thrust (meters 50)
    :inv-max-engine-thrust 0.0000048828124
    :engine-response-rate 30.0
    :engine-intake-factor 1.0
    :brake-factor 2.0
    :turbo-boost-factor 1.0
    :max-xz-speed (meters 40)
    :ground-probe-distance (meters 5)
    :cos-ground-effect-angle 0.42261824
    :spring-lift-factor 0.3
    :air-drag-factor 1.0
    :steering-thruster-factor 5.0
    :steering-thruster-max-gain 4.0
    :steering-thruster-half-gain-speed (meters 15)
    :tire-friction-factor 0.5
    :tire-static-friction 0.55
    :tire-dynamic-friction 0.4
    :tire-dynamic-friction-speed (meters 2)
    :tire-inv-max-friction-speed 0.000024414063
    :airfoil-factor 1.0
    :drag-force-factor 1.0
    :speed-scrubbing-drag 10.0
    :speed-limiting-drag 0.75
    :pitch-control-factor 1.0
    :roll-control-factor 1.0
    :jump-thrust-factor 0.625
    :buoyancy-factor 1.0
    :player-weight 163840.0
    :player-shift-x (meters 0.6)
    :player-shift-z (meters 1)
    :target-speed-offset (meters 4)
    :turning-accel (meters 20)
    :toughness-factor 1.0
    :damage-factor 4.0
    :camera-string-min-height (meters 4.5)
    :camera-string-max-height (meters 4.5)
    :camera-string-min-length (meters 5)
    :camera-string-max-length (meters 12.5)
    :camera-min-fov 15109.688
    :camera-max-fov 17476.268
    :camera-head-offset 8192.0
    :camera-foot-offset 4096.0
    :camera-normal-max-angle-offset 5461.3335
    :camera-air-max-angle-offset 5461.3335
    :camera-max-lookaround-speed 40960.0
    :seat-count 2
    :section-count 2
    :grab-rail-count 2
    :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 2
      (new 'static 'vehicle-grab-rail-info
        :local-pos (new 'static 'inline-array vector 2
          (new 'static 'vector :x 2048.0 :w 1.0)
          (new 'static 'vector :x 2048.0 :z 4096.0 :w 1.0)
          )
        :normal (new 'static 'vector :x 1.0 :w 1.0)
        )
      (new 'static 'vehicle-grab-rail-info
        :local-pos (new 'static 'inline-array vector 2
          (new 'static 'vector :x -2048.0 :z 4096.0 :w 1.0)
          (new 'static 'vector :x -2048.0 :w 1.0)
          )
        :normal (new 'static 'vector :x -1.0 :w 1.0)
        )
      )
    :seat-array (new 'static 'inline-array vehicle-seat-info 4
      (new 'static 'vehicle-seat-info :position (new 'static 'vector :w (the-as float #x10000)))
      (new 'static 'vehicle-seat-info
        :position (new 'static 'vector :y 2048.0 :z -4096.0 :w (the-as float #x40000))
        )
      (new 'static 'vehicle-seat-info)
      (new 'static 'vehicle-seat-info)
      )
    :rider-hand-offset (new 'static 'inline-array vector 2
      (new 'static 'vector :x 2457.6 :y 409.6 :z 4710.4 :w 1.0)
      (new 'static 'vector :x -2457.6 :y 409.6 :z 4710.4 :w 1.0)
      )
    :section-bike-front (new 'static 'vehicle-section-info
      :damage-seg-array (new 'static 'array uint64 3 #x10 #x8 #x2)
      :damage-seg-count 3
      )
    :section-bike-rear (new 'static 'vehicle-section-info
      :damage-seg-array (new 'static 'array uint64 3 #x20 #x4 #x0)
      :damage-seg-count 2
      )
    :explosion #f
    :engine-pitch-scale 0.25
    :engine-pitch-offset -0.25
    :engine-pitch-mod-amp 0.05
    :engine-sound-select 1
    :engine-sound (static-sound-name "vehicle-engine")
    :thrust-sound (static-sound-name "bike-thrust")
    :scrape-sound (static-sound-name "bike-scrape-stn")
    :glance-sound (static-sound-name "bike-glance-stn")
    :impact-sound (static-sound-name "bike-impact-stn")
    :extra-sound (static-sound-name "bike-by-1")
    :explosion-part #xa1
    :headlight-count 1
    :taillight-count 1
    :thruster-flame-width (meters 0.6)
    :thruster-flame-length (meters 2)
    :thruster-local-pos (new 'static 'inline-array vector 2
      (new 'static 'vector :x 1024.0 :z -3276.8 :w 1.0)
      (new 'static 'vector :x -1024.0 :z -3276.8 :w 1.0)
      )
    :exhaust-local-pos (new 'static 'inline-array vector 2
      (new 'static 'vector :x 1024.0 :y 204.8 :z -3276.8 :w 1.0)
      (new 'static 'vector :x -1024.0 :y 204.8 :z -3276.8 :w 1.0)
      )
    :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0))
    :smoke-local-pos (new 'static 'inline-array vector 2
      (new 'static 'vector :x 1638.4 :y -2048.0 :z 7372.8 :w 1.0)
      (new 'static 'vector :x -1638.4 :y -2048.0 :z 7372.8 :w 1.0)
      )
    :smoke-local-vel (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0))
    :headlight-local-pos (new 'static 'inline-array vector 3
      (new 'static 'vector :y -819.2 :z 10240.0 :w 1.0)
      (new 'static 'vector)
      (new 'static 'vector)
      )
    :taillight-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :y 1433.6 :z -10240.0 :w 1.0) (new 'static 'vector))
    :lift-thruster-count 2
    :roll-thruster-count 2
    :steering-thruster-count 2
    :stabilizer-count 4
    :inv-lift-thruster-count 0.5
    :lift-thruster-array (new 'static 'inline-array vehicle-control-point 2
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :y 819.2 :z 7372.8003 :w 1.0)
        :normal (new 'static 'vector :y -1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :y 819.2 :z -2457.6 :w 1.0)
        :normal (new 'static 'vector :y -1.0 :w 1.0)
        )
      )
    :roll-thruster-array (new 'static 'inline-array vehicle-control-point 2
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :z 2457.6 :w 1.0)
        :normal (new 'static 'vector :x 0.3 :y -0.6 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :z 2457.6 :w 1.0)
        :normal (new 'static 'vector :x -0.3 :y -0.6 :w 1.0)
        )
      )
    :steering-thruster-array (new 'static 'inline-array vehicle-control-point 2
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 10240.0 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -5324.8 :w 1.0)
        :normal (new 'static 'vector :x -1.0 :w 1.0)
        )
      )
    :stabilizer-array (new 'static 'inline-array vehicle-control-point 6
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -5734.4 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 10649.6 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 0.5)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z 2457.6 :w 1.0)
        :normal (new 'static 'vector :x 1.0 :w 2.0)
        )
      (new 'static 'vehicle-control-point
        :local-pos (new 'static 'vector :z -5734.4 :w 1.0)
        :normal (new 'static 'vector :y 1.0 :w 1.0)
        )
      (new 'static 'vehicle-control-point)
      (new 'static 'vehicle-control-point)
      )
    :engine-thrust-local-pos (new 'static 'vector :z -3276.7998 :w 1.0)
    :brake-local-pos (new 'static 'vector :z -3276.7998 :w 1.0)
    :color-option-count 1
    :color-option-array (new 'static 'inline-array vector 1 (new 'static 'vector :x 0.6 :y 0.6 :z 1.5 :w 1.0))
    )
  )

(defmethod init-skel-and-rigid-body ((this evan-test-bike))
  (initialize-skeleton
    this
    (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f)))
    (the-as pair 0)
    )
  (alloc-and-init-rigid-body-control this *evan-test-bike-constants*)
  (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 8 #t))
  (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 7 #t))
  (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t))
  (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 5 #t))
  (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 4 #t))
  (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 9 #t))
  (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 10 #t))
  0
  (none)
  )
