mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
f7bd0752f8
* wip * getting stuff set up so we can actually run test cases * better handle block entry stuff * types2 working on gstring * comments * math ref working * up to first stack stuff * stack fixes * bounding box * math stuff is working * float fixes * temp debug for (method 9 profile-array) * stupid stupid bug * debugging * everything is broken * some amount of type stuff works * bitfield * texture bitfields not working * temp * types * more stuff * type check * temp * float related fixes for light and res problems * revisit broken files, fix bugs * more types * vector debug * bug fixes for decompiler crashes in harder functions * update goal_src
61 lines
1.7 KiB
Common Lisp
61 lines
1.7 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: dynamics-h.gc
|
|
;; name in dgo: dynamics-h
|
|
;; dgos: ENGINE, GAME
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype dynamics (basic)
|
|
((name symbol :offset-assert 4)
|
|
(gravity-max meters :offset-assert 8)
|
|
(gravity-length meters :offset-assert 12)
|
|
(gravity vector :inline :offset-assert 16)
|
|
(gravity-normal vector :inline :offset-assert 32)
|
|
(walk-distance meters :offset-assert 48)
|
|
(run-distance meters :offset-assert 52)
|
|
)
|
|
:method-count-assert 10
|
|
:size-assert #x38
|
|
:flag-assert #xa00000038
|
|
(:methods
|
|
(set-gravity-length (_type_ float) none 9)
|
|
)
|
|
)
|
|
|
|
(defmethod set-gravity-length dynamics ((obj dynamics) (arg0 float))
|
|
(set! (-> obj gravity-length) arg0)
|
|
(vector-float*! (-> obj gravity) (-> obj gravity-normal) arg0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defun time-to-apex ((arg0 float) (arg1 float))
|
|
(the int (/ arg0 (- (* 0.0033333334 arg1))))
|
|
)
|
|
|
|
(defun time-to-ground ((arg0 float) (arg1 float) (arg2 float))
|
|
(let ((f0-0 0.0)
|
|
(v0-0 0)
|
|
)
|
|
(while (< (- arg2) f0-0)
|
|
(set! arg0 (- arg0 (* 0.0033333334 arg1)))
|
|
(+! f0-0 (* 0.0033333334 arg0))
|
|
(+! v0-0 1)
|
|
)
|
|
v0-0
|
|
)
|
|
)
|
|
|
|
(define *standard-dynamics* (new 'static 'dynamics
|
|
:name 'standard
|
|
:gravity-max (meters 40)
|
|
:gravity-length (meters 60)
|
|
:gravity (new 'static 'vector :y 245760.0 :w 1.0)
|
|
:gravity-normal (new 'static 'vector :y 1.0 :w 1.0)
|
|
:walk-distance (meters 2)
|
|
:run-distance (meters 5)
|
|
)
|
|
)
|