Files
2023-09-30 10:24:37 -04:00

469 lines
19 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: camera-h.gc
;; name in dgo: camera-h
;; dgos: ENGINE, GAME
;; +++cam-index-options
(defenum cam-index-options
:type uint32
:bitfield #t
(RADIAL)
(SPHERICAL)
)
;; ---cam-index-options
;; +++slave-los-state
(defenum slave-los-state
:type uint32
(none 0)
(cw 1)
(ccw 2)
(between 3)
)
;; ---slave-los-state
;; +++camera-blend-to-type
(defenum camera-blend-to-type
:type uint64
(unknown-0 0)
(unknown-1 1)
(unknown-2 2))
;; ---camera-blend-to-type
;; NOTE - for settings
(declare-type camera-slave process)
(define-extern cam-master-set-entity (function cam-setting-data none))
(define-extern cam-eye (state camera-slave))
(define-extern cam-endlessfall (state camera-slave))
(define-extern cam-master-activate-slave (function symbol none))
;; NOTE - for camera
(declare-type cam-rotation-tracker structure)
(define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector))
(define-extern slave-set-rotation! (function cam-rotation-tracker vector cam-slave-options-u32 float symbol none))
;; NOTE - for cam-start
(declare-type camera-master process)
(define-extern cam-master-init (function none :behavior camera-master))
;; NOTE - for cam-master
(define-extern cam-master-effect (function none :behavior camera-master))
(define-extern camera-master-debug (function camera-master none))
(define-extern group-rain-screend-drop sparticle-launch-group)
(define-extern parameter-ease-sin-clamp (function float float))
;; DECOMP BEGINS
(deftype cam-index (structure)
((flags cam-index-options :offset-assert 0)
(vec vector 2 :inline :offset-assert 16)
)
:method-count-assert 11
:size-assert #x30
:flag-assert #xb00000030
(:methods
(cam-index-method-9 (_type_ symbol entity vector curve) symbol 9)
(cam-index-method-10 (_type_ vector) float 10)
)
)
(deftype tracking-point (structure)
((position vector :inline :offset-assert 0)
(direction vector :inline :offset-assert 16)
(tp-length float :offset-assert 32)
(next int32 :offset-assert 36)
(incarnation int32 :offset-assert 40)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
)
(deftype tracking-spline-sampler (structure)
((cur-pt int32 :offset-assert 0)
(partial-pt float :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
(deftype tracking-spline (structure)
((point tracking-point 32 :inline :offset-assert 0)
(summed-len float :offset-assert 1536)
(free-point int32 :offset-assert 1540)
(used-point int32 :offset-assert 1544)
(partial-point float :offset-assert 1548)
(end-point int32 :offset-assert 1552)
(next-to-last-point int32 :offset-assert 1556)
(max-move float :offset-assert 1560)
(sample-len float :offset-assert 1564)
(used-count int32 :offset-assert 1568)
(old-position vector :inline :offset-assert 1584)
(debug-old-position vector :inline :offset-assert 1600)
(debug-out-position vector :inline :offset-assert 1616)
(debug-last-point int32 :offset-assert 1632)
)
:method-count-assert 24
:size-assert #x664
:flag-assert #x1800000664
(:methods
(tracking-spline-method-9 (_type_) none 9)
(tracking-spline-method-10 (_type_ vector) none 10)
(debug-point-info (_type_ int) none 11)
(debug-all-points (_type_) none 12)
(tracking-spline-method-13 (_type_ int) none 13)
(tracking-spline-method-14 (_type_ tracking-spline-sampler) none 14)
(tracking-spline-method-15 (_type_) none 15)
(tracking-spline-method-16 (_type_ float) none 16)
(tracking-spline-method-17 (_type_ vector float float symbol) int 17)
(tracking-spline-method-18 (_type_ float vector tracking-spline-sampler) vector 18)
(tracking-spline-method-19 (_type_ float vector tracking-spline-sampler) vector 19)
(tracking-spline-method-20 (_type_ vector int) none 20)
(tracking-spline-method-21 (_type_ vector float float float) vector 21)
(tracking-spline-method-22 (_type_ float) symbol 22)
(debug-draw-spline (_type_) none 23)
)
)
(deftype cam-float-seeker (structure)
((target float :offset-assert 0)
(value float :offset-assert 4)
(vel float :offset-assert 8)
(accel float :offset-assert 12)
(max-vel float :offset-assert 16)
(max-partial float :offset-assert 20)
)
:pack-me
:method-count-assert 13
:size-assert #x18
:flag-assert #xd00000018
(:methods
(init (_type_ float float float float) none 9)
(copy-to (_type_ _type_) none 10)
(update! (_type_ float) none 11)
(jump-to-target! (_type_ float) float 12)
)
)
(defmethod init cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float))
(set! (-> this target) arg0)
(set! (-> this value) arg0)
(set! (-> this vel) 0.0)
(set! (-> this accel) arg1)
(set! (-> this max-vel) arg2)
(set! (-> this max-partial) arg3)
0
(none)
)
(defmethod copy-to cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker))
(set! (-> this target) (-> arg0 target))
(set! (-> this value) (-> arg0 value))
(set! (-> this vel) (-> arg0 vel))
(set! (-> this accel) (-> arg0 accel))
(set! (-> this max-vel) (-> arg0 max-vel))
(set! (-> this max-partial) (-> arg0 max-partial))
0
(none)
)
(defmethod update! cam-float-seeker ((this cam-float-seeker) (arg0 float))
(with-pp
0.0
0.0
(let* ((f1-2 (- (+ (-> this target) arg0) (-> this value)))
(f0-5 (* (-> this max-partial) (fabs f1-2)))
)
(let ((f1-3 (* f1-2 (* (-> this accel) (-> pp clock time-adjust-ratio)))))
(+! (-> this vel) f1-3)
)
(let ((f1-6 (fabs (-> this vel)))
(f0-6 (fmin f0-5 (-> this max-vel)))
)
(if (< f0-6 f1-6)
(set! (-> this vel) (* (-> this vel) (/ f0-6 f1-6)))
)
)
)
(let ((f0-10 (* (-> this vel) (-> pp clock time-adjust-ratio))))
(+! (-> this value) f0-10)
)
0
(none)
)
)
(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float))
(set! (-> this value) (+ (-> this target) arg0))
(set! (-> this vel) 0.0)
0.0
)
(deftype cam-vector-seeker (structure)
((target vector :inline :offset-assert 0)
(value vector :inline :offset-assert 16)
(vel vector :inline :offset-assert 32)
(accel float :offset-assert 48)
(max-vel float :offset-assert 52)
(max-partial float :offset-assert 56)
)
:method-count-assert 11
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(init (_type_ vector float float float) none 9)
(update! (_type_ vector) none 10)
)
)
(defmethod init cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float))
(cond
(arg0
(set! (-> this target quad) (-> arg0 quad))
(set! (-> this value quad) (-> arg0 quad))
)
(else
(vector-reset! (-> this target))
(vector-reset! (-> this value))
)
)
(vector-reset! (-> this vel))
(set! (-> this accel) arg1)
(set! (-> this max-vel) arg2)
(set! (-> this max-partial) arg3)
0
(none)
)
(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector))
(with-pp
(let ((v1-0 (new 'stack-no-clear 'vector)))
0.0
(cond
(arg0
(vector+! v1-0 (-> this target) arg0)
(vector-! v1-0 v1-0 (-> this value))
)
(else
(vector-! v1-0 (-> this target) (-> this value))
)
)
(let ((f0-2 (* (-> this max-partial) (vector-length v1-0))))
(vector-float*! v1-0 v1-0 (* (-> this accel) (-> pp clock time-adjust-ratio)))
(vector+! (-> this vel) (-> this vel) v1-0)
(let ((f1-3 (vector-length (-> this vel)))
(f0-3 (fmin f0-2 (-> this max-vel)))
)
(if (< f0-3 f1-3)
(vector-float*! (-> this vel) (-> this vel) (/ f0-3 f1-3))
)
)
)
(vector-float*! v1-0 (-> this vel) (-> pp clock time-adjust-ratio))
(vector+! (-> this value) (-> this value) v1-0)
)
0
(none)
)
)
(deftype cam-rotation-tracker (structure)
((inv-mat matrix :inline :offset-assert 0)
(no-follow basic :offset-assert 64)
(follow-pt vector :inline :offset-assert 80)
(follow-off vector :inline :offset-assert 96)
(follow-blend float :offset-assert 112)
(tilt-adjust cam-float-seeker :inline :offset-assert 116)
(point-of-interest-blend cam-float-seeker :inline :offset-assert 140)
(underwater-blend cam-float-seeker :inline :offset-assert 164)
(looking-at vector :inline :offset-assert 192)
(looking-interesting vector :inline :offset-assert 208)
(old-cam-trans vector :inline :offset-assert 224)
(follow-height-extra cam-float-seeker :inline :offset-assert 240)
)
:method-count-assert 9
:size-assert #x108
:flag-assert #x900000108
)
(deftype camera-combiner (process)
((trans vector :inline :offset-assert 128)
(inv-camera-rot matrix :inline :offset-assert 144)
(fov float :offset-assert 208)
(interp-val float :offset-assert 212)
(interp-step float :offset-assert 216)
(dist-from-src float :offset-assert 220)
(dist-from-dest float :offset-assert 224)
(flip-control-axis vector :inline :offset-assert 240)
(velocity vector :inline :offset-assert 256)
(tracking-status uint64 :offset-assert 272)
(tracking-options int32 :offset-assert 280)
(tracking cam-rotation-tracker :inline :offset-assert 288)
(fast-rot basic :offset-assert 552)
)
:heap-base #x1b0
:method-count-assert 14
:size-assert #x22c
:flag-assert #xe01b0022c
(:states
cam-combiner-active
)
)
(deftype camera-slave (process)
((trans vector :inline :offset-assert 128)
(fov float :offset-assert 144)
(fov0 float :offset-assert 148)
(fov1 float :offset-assert 152)
(fov-index cam-index :inline :offset-assert 160)
(tracking cam-rotation-tracker :inline :offset-assert 208)
(view-off-param float :offset-assert 472)
(view-off vector :inline :offset-assert 480)
(joystick-saved-view-off vector :inline :offset-assert 496)
(min-z-override float :offset-assert 512)
(view-flat vector :inline :offset-assert 528)
(string-vel-dir uint32 :offset-assert 544)
(string-trans vector :inline :offset-assert 560)
(position-spline tracking-spline :inline :offset-assert 576)
(pivot-pt vector :inline :offset-assert 2224)
(pivot-rad float :offset-assert 2240)
(circular-follow vector :inline :offset-assert 2256)
(max-angle-offset float :offset-assert 2272)
(max-angle-curr float :offset-assert 2276)
(options cam-slave-options-u32 :offset-assert 2280)
(cam-entity entity :offset-assert 2284)
(butt-timer uint64 :offset-assert 2288)
(butt-seek basic :offset-assert 2296)
(butt-vector vector :inline :offset-assert 2304)
(velocity vector :inline :offset-assert 2320)
(desired-pos vector :inline :offset-assert 2336)
(time-dist-too-far uint32 :offset-assert 2352)
(los-state slave-los-state :offset-assert 2356)
(good-point vector :inline :offset-assert 2368)
(los-tgt-spline-pt int32 :offset-assert 2384)
(los-tgt-spline-pt-incarnation int32 :offset-assert 2388)
(los-last-pos vector :inline :offset-assert 2400)
(intro-curve curve :inline :offset-assert 2416)
(intro-offset vector :inline :offset-assert 2448)
(intro-t float :offset-assert 2464)
(intro-t-step float :offset-assert 2468)
(outro-exit-value float :offset-assert 2472)
(spline-exists basic :offset-assert 2476)
(spline-curve curve :inline :offset-assert 2480)
(spline-offset vector :inline :offset-assert 2512)
(index cam-index :inline :offset-assert 2528)
(saved-pt vector :inline :offset-assert 2576)
(spline-tt float :offset-assert 2592)
(spline-follow-dist float :offset-assert 2596)
(enter-has-run symbol :offset-assert 2600)
(blend-from-type uint64 :offset-assert 2608)
(blend-to-type camera-blend-to-type :offset-assert 2616)
(have-phony-joystick basic :offset-assert 2624)
(phony-joystick-x float :offset-assert 2628)
(phony-joystick-y float :offset-assert 2632)
(string-min-val vector :inline :offset-assert 2640)
(string-max-val vector :inline :offset-assert 2656)
(string-val-locked basic :offset-assert 2672)
(relative-position vector :inline :offset-assert 2688)
(string-relative basic :offset-assert 2704)
)
:heap-base #xa20
:method-count-assert 14
:size-assert #xa94
:flag-assert #xe0a200a94
(:states
cam-bike
cam-circular
cam-decel
cam-endlessfall
cam-eye
cam-fixed
cam-fixed-read-entity
cam-free-floating
cam-launcher-longfall
cam-launcher-shortfall
cam-lookat
cam-point-watch
cam-pov
cam-pov-track
cam-pov180
cam-really-fixed
cam-remote
cam-robotboss
cam-spline
cam-standoff
cam-standoff-read-entity
cam-stick
cam-string
cam-turret
)
)
(deftype camera-master (process)
((master-options cam-master-options-u32 :offset-assert 128)
(settings cam-setting-data :offset-assert 132)
(slave (pointer camera-slave) :offset-assert 136)
(decel (pointer camera-slave) :offset-assert 140)
(slave-options uint32 :offset-assert 144)
(view-off-param-save float :offset-assert 148)
(changer uint32 :offset-assert 152)
(string-min cam-vector-seeker :inline :offset-assert 160)
(string-max cam-vector-seeker :inline :offset-assert 224)
(string-push-z float :offset-assert 284)
(local-down vector :inline :offset-assert 288)
(focus focus :inline :offset-assert 304)
(being-attacked symbol :offset-assert 316)
(attack-start time-frame :offset-assert 320)
(on-ground symbol :offset-assert 328)
(under-water int32 :offset-assert 332)
(on-pole symbol :offset-assert 336)
(tgt-rot-mat matrix :inline :offset-assert 352)
(tgt-face-mat matrix :inline :offset-assert 416)
(tpos-old vector :inline :offset-assert 480)
(tpos-curr vector :inline :offset-assert 496)
(tpos-old-adj vector :inline :offset-assert 512)
(tpos-curr-adj vector :inline :offset-assert 528)
(tpos-tgt vector :inline :offset-assert 544)
(upspeed float :offset-assert 560)
(pitch-off vector :inline :offset-assert 576)
(target-spline tracking-spline :inline :offset-assert 592)
(ease-from vector :inline :offset-assert 2240)
(ease-t float :offset-assert 2256)
(ease-step float :offset-assert 2260)
(ease-to vector :inline :offset-assert 2272)
(outro-curve curve :inline :offset-assert 2288)
(outro-t float :offset-assert 2308)
(outro-t-step float :offset-assert 2312)
(outro-exit-value float :offset-assert 2316)
(water-drip-time time-frame :offset-assert 2320)
(water-drip sparticle-launch-control :offset-assert 2328)
(water-drip-mult float :offset-assert 2332)
(water-drip-speed float :offset-assert 2336)
)
:heap-base #x8b0
:method-count-assert 17
:size-assert #x924
:flag-assert #x1108b00924
(:methods
(camera-master-method-14 (_type_ vector) vector 14)
(camera-master-method-15 (_type_ vector) vector 15)
(camera-master-method-16 (_type_ symbol) int 16)
)
(:states
cam-master-active
)
)