mirror of
https://github.com/open-goal/jak-project
synced 2026-06-22 09:05:44 -04:00
637990314b
Closes #736 --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
307 lines
10 KiB
Common Lisp
Vendored
Generated
307 lines
10 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for method 10 of type cylinder
|
|
(defmethod ray-capsule-intersect ((this cylinder) (ray1 vector) (ray2 vector))
|
|
(let ((t2-0 (new 'stack-no-clear 'vector))
|
|
(s4-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
0.0
|
|
0.0
|
|
(let ((f30-0
|
|
(ray-cylinder-intersect ray1 ray2 (-> this origin) (-> this axis) (-> this radius) (-> this length) t2-0)
|
|
)
|
|
)
|
|
(let ((f0-5 (ray-sphere-intersect ray1 ray2 (-> this origin) (-> this radius))))
|
|
(if (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0)))
|
|
(set! f30-0 f0-5)
|
|
)
|
|
)
|
|
(vector+float*! s4-0 (-> this origin) (-> this axis) (-> this length))
|
|
(let ((f0-8 (ray-sphere-intersect ray1 ray2 s4-0 (-> this radius))))
|
|
(if (and (>= f0-8 0.0) (or (< f30-0 0.0) (< f0-8 f30-0)))
|
|
(set! f30-0 f0-8)
|
|
)
|
|
)
|
|
f30-0
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition of type cylinder-verts
|
|
(deftype cylinder-verts (structure)
|
|
((vert vector 24 :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type cylinder-verts
|
|
(defmethod inspect ((this cylinder-verts))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'cylinder-verts)
|
|
(format #t "~1Tvert[24] @ #x~X~%" (-> this vert))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 9 of type cylinder
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw ((this cylinder) (arg0 vector4w))
|
|
(rlet ((acc :class vf)
|
|
(vf0 :class vf)
|
|
(vf1 :class vf)
|
|
(vf2 :class vf)
|
|
(vf3 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(let ((s1-0 (new 'stack-no-clear 'vector))
|
|
(s0-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(if (< 0.999 (fabs (-> this axis y)))
|
|
(vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0))
|
|
(vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0))
|
|
)
|
|
(vector-normalize! s1-0 (-> this radius))
|
|
(vector-float*! s0-0 (-> this axis) (/ (-> this length) 8))
|
|
(let ((s5-0 (new 'stack-no-clear 'cylinder-verts))
|
|
(s4-0 (new 'stack-no-clear 'cylinder-verts))
|
|
(s3-0 (new 'stack-no-clear 'matrix))
|
|
)
|
|
(matrix-axis-angle! s3-0 (-> this axis) 4096.0)
|
|
(let ((sv-896 (new 'stack-no-clear 'matrix)))
|
|
(vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0)
|
|
(let ((v1-6 (-> s3-0 trans)))
|
|
(.lvf vf4 (&-> (-> this origin) quad))
|
|
(.lvf vf5 (&-> sv-896 quad 0))
|
|
(.mov.vf.w vf6 vf0)
|
|
(.sub.vf.xyz vf6 vf4 vf5)
|
|
(.svf (&-> v1-6 quad) vf6)
|
|
)
|
|
)
|
|
(dotimes (v1-7 8)
|
|
(vector+! (-> s5-0 vert (+ v1-7 8)) (-> this origin) s1-0)
|
|
(vector+float*! (-> s5-0 vert (+ v1-7 8)) (-> s5-0 vert (+ v1-7 8)) s0-0 (the float v1-7))
|
|
)
|
|
(dotimes (s0-1 8)
|
|
(let ((sv-944 (-> s5-0 vert s0-1)))
|
|
(let ((sv-912 (-> this origin))
|
|
(sv-928 s1-0)
|
|
(f0-8 (cos (* 2048.0 (the float (- 7 s0-1)))))
|
|
)
|
|
(.lvf vf2 (&-> sv-928 quad))
|
|
(.lvf vf1 (&-> sv-912 quad))
|
|
(let ((v1-19 f0-8))
|
|
(.mov vf3 v1-19)
|
|
)
|
|
)
|
|
(.add.x.vf.w vf4 vf0 vf0)
|
|
(.mul.x.vf acc vf2 vf3)
|
|
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
|
|
(.svf (&-> sv-944 quad) vf4)
|
|
)
|
|
(let ((sv-992 (-> s5-0 vert s0-1)))
|
|
(let ((sv-960 (-> s5-0 vert s0-1))
|
|
(sv-976 (-> this axis))
|
|
(f0-13 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))
|
|
)
|
|
(.lvf vf2 (&-> sv-976 quad))
|
|
(.lvf vf1 (&-> sv-960 quad))
|
|
(let ((v1-33 f0-13))
|
|
(.mov vf3 v1-33)
|
|
)
|
|
)
|
|
(.add.x.vf.w vf4 vf0 vf0)
|
|
(.mul.x.vf acc vf2 vf3)
|
|
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
|
|
(.svf (&-> sv-992 quad) vf4)
|
|
)
|
|
(let ((sv-1040 (-> s5-0 vert (+ s0-1 16))))
|
|
(let ((sv-1008 (-> this origin))
|
|
(sv-1024 s1-0)
|
|
(f0-16 (cos (* 2048.0 (the float s0-1))))
|
|
)
|
|
(.lvf vf2 (&-> sv-1024 quad))
|
|
(.lvf vf1 (&-> sv-1008 quad))
|
|
(let ((v1-43 f0-16))
|
|
(.mov vf3 v1-43)
|
|
)
|
|
)
|
|
(.add.x.vf.w vf4 vf0 vf0)
|
|
(.mul.x.vf acc vf2 vf3)
|
|
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
|
|
(.svf (&-> sv-1040 quad) vf4)
|
|
)
|
|
(let ((sv-1088 (-> s5-0 vert (+ s0-1 16))))
|
|
(let ((sv-1056 (-> s5-0 vert (+ s0-1 16)))
|
|
(sv-1072 (-> this axis))
|
|
(f0-21 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1))))))
|
|
)
|
|
(.lvf vf2 (&-> sv-1072 quad))
|
|
(.lvf vf1 (&-> sv-1056 quad))
|
|
(let ((v1-57 f0-21))
|
|
(.mov vf3 v1-57)
|
|
)
|
|
)
|
|
(.add.x.vf.w vf4 vf0 vf0)
|
|
(.mul.x.vf acc vf2 vf3)
|
|
(.add.mul.w.vf.xyz vf4 vf1 vf0 acc)
|
|
(.svf (&-> sv-1088 quad) vf4)
|
|
)
|
|
)
|
|
(dotimes (s2-1 16)
|
|
(dotimes (s1-1 24)
|
|
(vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0)
|
|
(camera-line (-> s5-0 vert s1-1) (-> s4-0 vert s1-1) arg0)
|
|
(if (nonzero? s1-1)
|
|
(camera-line (-> s5-0 vert s1-1) (-> s5-0 vert (+ s1-1 -1)) arg0)
|
|
)
|
|
)
|
|
(let ((v1-77 s5-0))
|
|
(set! s5-0 s4-0)
|
|
(set! s4-0 v1-77)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for function ray-arbitrary-circle-intersect
|
|
(defun ray-arbitrary-circle-intersect ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float))
|
|
(let* ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg0))
|
|
(f0-2 (/ (vector-dot v1-1 arg3) (vector-dot arg1 arg3)))
|
|
)
|
|
(cond
|
|
((or (< 1.0 f0-2) (< f0-2 0.0))
|
|
-100000000.0
|
|
)
|
|
((let ((a0-8 (new 'stack-no-clear 'vector)))
|
|
(vector-float*! a0-8 arg1 f0-2)
|
|
(vector-! a0-8 a0-8 v1-1)
|
|
(< (vector-dot a0-8 a0-8) (* arg4 arg4))
|
|
)
|
|
f0-2
|
|
)
|
|
(else
|
|
-100000000.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 10 of type cylinder-flat
|
|
;; INFO: Used lq/sq
|
|
(defmethod ray-flat-cyl-intersect ((this cylinder-flat) (arg0 vector) (arg1 vector))
|
|
(let ((gp-0 (new 'stack-no-clear 'vector))
|
|
(s5-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
0.0
|
|
0.0
|
|
(let ((f30-0
|
|
(ray-cylinder-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius) (-> this length) gp-0)
|
|
)
|
|
)
|
|
(let ((f0-5 (ray-arbitrary-circle-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius))))
|
|
(when (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0)))
|
|
(set! f30-0 f0-5)
|
|
(set! (-> gp-0 quad) (-> this origin quad))
|
|
)
|
|
)
|
|
(vector+float*! s5-0 (-> this origin) (-> this axis) (-> this length))
|
|
(let ((f0-8 (ray-arbitrary-circle-intersect arg0 arg1 s5-0 (-> this axis) (-> this radius))))
|
|
(when (and (>= f0-8 0.0) (or (< f30-0 0.0) (< f0-8 f30-0)))
|
|
(set! f30-0 f0-8)
|
|
(set! (-> gp-0 quad) (-> s5-0 quad))
|
|
)
|
|
)
|
|
f30-0
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition of type cylinder-flat-verts
|
|
(deftype cylinder-flat-verts (structure)
|
|
((vert vector 10 :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type cylinder-flat-verts
|
|
(defmethod inspect ((this cylinder-flat-verts))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'cylinder-flat-verts)
|
|
(format #t "~1Tvert[10] @ #x~X~%" (-> this vert))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 9 of type cylinder-flat
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw ((this cylinder-flat) (arg0 vector4w))
|
|
(rlet ((vf0 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(let ((s1-0 (new 'stack-no-clear 'vector))
|
|
(s0-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(if (< 0.999 (fabs (-> this axis y)))
|
|
(vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0))
|
|
(vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0))
|
|
)
|
|
(vector-normalize! s1-0 (-> this radius))
|
|
(vector-float*! s0-0 (-> this axis) (/ (-> this length) 7))
|
|
(let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts))
|
|
(s4-0 (new 'stack-no-clear 'cylinder-flat-verts))
|
|
(s3-0 (new 'stack-no-clear 'matrix))
|
|
)
|
|
(matrix-axis-angle! s3-0 (-> this axis) 4096.0)
|
|
(let ((sv-448 (new 'stack-no-clear 'vector)))
|
|
(vector-matrix*! sv-448 (-> this origin) s3-0)
|
|
(let ((v1-6 (-> s3-0 trans)))
|
|
(.lvf vf4 (&-> (-> this origin) quad))
|
|
(.lvf vf5 (&-> sv-448 quad))
|
|
(.mov.vf.w vf6 vf0)
|
|
(.sub.vf.xyz vf6 vf4 vf5)
|
|
(.svf (&-> v1-6 quad) vf6)
|
|
)
|
|
)
|
|
(dotimes (v1-7 8)
|
|
(vector+! (-> s5-0 vert (+ v1-7 1)) (-> this origin) s1-0)
|
|
(vector+float*! (-> s5-0 vert (+ v1-7 1)) (-> s5-0 vert (+ v1-7 1)) s0-0 (the float v1-7))
|
|
)
|
|
(set! (-> s5-0 vert 0 quad) (-> this origin quad))
|
|
(vector+float*! (-> s5-0 vert 9) (-> this origin) (-> this axis) (-> this length))
|
|
(dotimes (s2-1 16)
|
|
(dotimes (s1-1 10)
|
|
(vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0)
|
|
(camera-line (-> s5-0 vert s1-1) (-> s4-0 vert s1-1) arg0)
|
|
(if (nonzero? s1-1)
|
|
(camera-line (-> s5-0 vert s1-1) (-> s5-0 vert (+ s1-1 -1)) arg0)
|
|
)
|
|
)
|
|
(let ((v1-29 s5-0))
|
|
(set! s5-0 s4-0)
|
|
(set! s4-0 v1-29)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
)
|