Files
jak-project/goal_src/engine/physics/dynamics-h.gc
T
water111 c043367094 [goalc] fix 0 in xmm128, be more strict with none in comparison (#1079)
* fix a few small bugs

* merge fixup

* 0 constant fix
2022-01-15 22:33:53 -05:00

50 lines
1.3 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: dynamics-h.gc
;; name in dgo: dynamics-h
;; dgos: GAME, ENGINE
(deftype dynamics (basic)
((name basic :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 9
:size-assert #x38
:flag-assert #x900000038
)
(defun time-to-apex ((arg0 float) (arg1 float))
(the int (/ arg0 (- (vel-tick 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 GRAVITY_MAX
:gravity-length GRAVITY_AMOUNT
:gravity (new 'static 'vector :x 0.0 :y GRAVITY_AMOUNT :z 0.0 :w 1.0)
:gravity-normal (new 'static 'vector :x 0.0 :y 1.0 :z 0.0 :w 1.0)
:walk-distance (meters 2)
:run-distance (meters 5)
)
)