Files
jak-project/test/decompiler/reference/engine/camera/cam-interface_REF.gc
T
Tyler Wilding 2bfe13d0be decomp: entity-h, camera-h, cam-update-h and cam-interface[-h] (#501)
* waiting for `entity-camera` / `entity-ambient` issue

* stash

* add missing definitions

* decomp: `cam-interface`

* as far as i can get with `path-h`, how do you specify pointers on the stack?

* correction, no way these are just simple integers but `etype`is still a mystery...

* decomp: `camera-h` | `cam-interface` | `cam-interface-h` and `entity-h`

* revert change to `process` doesn't seem likely
2021-06-02 20:09:04 -04:00

134 lines
3.2 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 data 8))
(f0-0 arg1)
)
(.lvf vf1 a0-2)
(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
(the-as vector (&-> *math-camera* inv-camera-rot data 4))
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 data 0))
(f1-0 (-> *math-camera* camera-rot data 2))
)
(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)))
(let ((v1-1 (-> gp-0 trans)))
(set! (-> v1-1 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)
)