Files
jak-project/test/decompiler/reference/jak3/engine/anim/aligner-h_REF.gc
T
water111 c8a1643e9f [jak3] Add zoom blur and color filter effect (#4031)
Add the zoom blur effect, used by cutscene effects and a few weapons:


https://github.com/user-attachments/assets/8d231b34-faf8-4b88-a636-edf2b5477ff9

And color filtering


https://github.com/user-attachments/assets/67db5933-4b29-4c77-ad56-5025cbefa328

There's still two blit-displays not covered: scanlines and the light jak
slow motion effect.
2025-10-04 17:06:18 -04:00

73 lines
3.2 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type align-control
(deftype align-control (basic)
"Align-control is a utility for moving a process-drawable based on its animation.
The animation format has two special parent-like joints: prejoint and align.
The prejoint is the parent for all joints, so it causes all bones to move.
The align joint has no children, but the convention is that moving align will
cause the entire process-drawable's root to move, effectively moving the entire character.
Most of the time, this is the preferable way to move a character as part of an animation -
it will update their velocity and when the animation ends or is canceled,
the offset in position from playing the animation will stay. For example, if Jak punches,
his velocity will increase due to the animated align in the punch animation.
To implement this, the align-control computes the relative transform between align frames.
To apply the position offset, typically the velocity is updated, then the normal per-frame
physics update will end up moving the position. For orientation, there is no concept of
angular velocity, so instead align-control directly modifies the quaternion.
Unlike normal animation evaluation, the alignment's blend is computed in a different way
that doesn't blend and instead just picks the most recently pushed animation."
((flags align-flags)
(process process-drawable)
(frame-group art-joint-anim)
(frame-num float)
(matrix matrix 2 :inline)
(transform transform 2 :inline)
(delta transformq :inline)
(last-speed meters)
(align transformq :inline :overlay-at (-> transform 0 trans data 0))
)
(:methods
(new (symbol type process) _type_)
(compute-delta-align! (_type_) transformq)
(align! (_type_ align-opts float float float) trsqv)
(adjust-root-no-gravity! (_type_ align-opts vector int float float) trsqv)
(first-transform (_type_) transform)
(second-transform (_type_) transform)
)
)
;; definition for method 3 of type align-control
(defmethod inspect ((this align-control))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~1Tflags: #x~X~%" (-> this flags))
(format #t "~1Tprocess: ~A~%" (-> this process))
(format #t "~1Tframe-group: ~A~%" (-> this frame-group))
(format #t "~1Tframe-num: ~f~%" (-> this frame-num))
(format #t "~1Tmatrix[2] @ #x~X~%" (-> this matrix))
(format #t "~1Ttransform[2] @ #x~X~%" (-> this transform))
(format #t "~1Tdelta: #<transformq @ #x~X>~%" (-> this delta))
(format #t "~1Tlast-speed: (meters ~m)~%" (-> this last-speed))
(format #t "~1Talign: #<transformq @ #x~X>~%" (-> this transform))
(label cfg-4)
this
)
;; definition for method 0 of type align-control
;; WARN: Return type mismatch object vs align-control.
(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process))
(let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(when (zero? this)
(go process-drawable-art-error "memory")
(return (the-as align-control 0))
)
(set! (-> this process) (the-as process-drawable arg0))
(the-as align-control this)
)
)