jak-project/goal_src/jak2/engine/physics/dynamics-h.gc
water111 f7bd0752f8
[decomp] Decompile first batch of files in engine (#1787)
* 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
2022-08-24 00:29:51 -04:00

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)
)
)