mirror of
https://github.com/open-goal/jak-project
synced 2026-05-25 23:35:33 -04:00
fef7fad65a
* decomile process-drawable-h * one more
127 lines
3.1 KiB
Common Lisp
127 lines
3.1 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
(rlet ((vf0 :class vf))
|
|
(init-vf0-vector)
|
|
|
|
;; definition for function position-in-front-of-camera!
|
|
(defun position-in-front-of-camera! ((arg0 vector) (arg1 float) (arg2 float))
|
|
(rlet ((vf0 :class vf)
|
|
(vf1 :class vf)
|
|
(vf2 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(let ((v1-0 arg0))
|
|
(let ((a0-2 (-> *math-camera* inv-camera-rot vector 2))
|
|
(f0-0 arg1)
|
|
)
|
|
(.lvf vf1 (&-> a0-2 quad))
|
|
(let ((a0-3 f0-0))
|
|
(.mov vf2 a0-3)
|
|
)
|
|
)
|
|
(.add.x.vf vf1 vf0 vf0 :mask #b1000)
|
|
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
|
|
(.svf (&-> v1-0 quad) vf1)
|
|
)
|
|
(vector+float*! arg0 arg0 (-> *math-camera* inv-camera-rot vector 1) arg2)
|
|
(let ((a0-5 arg0))
|
|
(let ((v1-3 arg0)
|
|
(a1-3 (-> *math-camera* trans))
|
|
)
|
|
(.mov.vf vf6 vf0 :mask #b1000)
|
|
(.lvf vf4 (&-> v1-3 quad))
|
|
(.lvf vf5 (&-> a1-3 quad))
|
|
)
|
|
(.add.vf vf6 vf4 vf5 :mask #b111)
|
|
(.svf (&-> a0-5 quad) vf6)
|
|
)
|
|
arg0
|
|
)
|
|
)
|
|
|
|
;; definition for function matrix-local->world
|
|
(defun matrix-local->world ((arg0 symbol))
|
|
(if arg0
|
|
(-> *math-camera* inv-camera-rot-smooth)
|
|
(-> *math-camera* inv-camera-rot)
|
|
)
|
|
)
|
|
|
|
;; definition for function matrix-world->local
|
|
(defun matrix-world->local ()
|
|
(-> *math-camera* camera-rot)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(when (or (not *camera-dummy-vector*) (zero? *camera-dummy-vector*))
|
|
(let ((v1-8 (new 'global 'vector)))
|
|
(.svf (&-> v1-8 quad) vf0)
|
|
(set! *camera-dummy-vector* v1-8)
|
|
)
|
|
)
|
|
|
|
;; definition for function camera-pos
|
|
;; INFO: Return type mismatch object vs vector.
|
|
(defun camera-pos ()
|
|
(the-as vector (cond
|
|
(*camera-combiner*
|
|
(-> *camera-combiner* stack)
|
|
)
|
|
(*math-camera*
|
|
(-> *math-camera* trans)
|
|
)
|
|
(else
|
|
*camera-dummy-vector*
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function math-camera-pos
|
|
(defun math-camera-pos ()
|
|
(-> *math-camera* trans)
|
|
)
|
|
|
|
;; definition for function camera-angle
|
|
(defun camera-angle ()
|
|
(let ((f0-0 (-> *math-camera* camera-rot vector 0 x))
|
|
(f1-0 (-> *math-camera* camera-rot vector 0 z))
|
|
)
|
|
(atan f1-0 f0-0)
|
|
)
|
|
)
|
|
|
|
;; definition for function camera-teleport-to-entity
|
|
;; INFO: Return type mismatch int vs none.
|
|
;; Used lq/sq
|
|
(defun camera-teleport-to-entity ((arg0 entity-actor))
|
|
(local-vars (pp process))
|
|
(let ((gp-0 (new 'stack 'transformq)))
|
|
(set!
|
|
(-> gp-0 trans quad)
|
|
(-> (the-as transform (-> arg0 extra)) scale quad)
|
|
)
|
|
(quaternion-copy! (the-as quaternion (-> gp-0 rot)) (-> arg0 quat))
|
|
(vector-identity! (-> gp-0 scale))
|
|
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-2 from) pp)
|
|
(set! (-> a1-2 num-params) 1)
|
|
(set! (-> a1-2 message) 'teleport-to-transformq)
|
|
(set! (-> a1-2 param 0) (the-as uint gp-0))
|
|
(send-event-function *camera* a1-2)
|
|
)
|
|
)
|
|
(let ((v0-4 0))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(none)
|
|
|
|
)
|