From c0aef6be3b4a18077c1fd3bba19a550c7cb4f182 Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sat, 7 Dec 2024 21:09:36 +0100 Subject: [PATCH] cloth spheres debugging --- goal_src/jak3/engine/physics/cloth.gc | 22 +++++++++++-------- .../process-drawable/process-drawable.gc | 21 ++++++++++++------ goal_src/jak3/pc/debug/default-menu-pc.gc | 1 + 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/goal_src/jak3/engine/physics/cloth.gc b/goal_src/jak3/engine/physics/cloth.gc index dd9aab5f06b..16785c947eb 100644 --- a/goal_src/jak3/engine/physics/cloth.gc +++ b/goal_src/jak3/engine/physics/cloth.gc @@ -5,6 +5,9 @@ ;; name in dgo: cloth ;; dgos: GAME +(#when PC_PORT + (define *display-cloth-spheres* #f)) + ;; DECOMP BEGINS (defmethod relocate ((this verlet-particle-system) (offset int)) @@ -300,14 +303,14 @@ (meters 0.02) (static-rgba #x80 0 #x80 #x80) ) - ; (s4-0 - ; s3-0 - ; (the-as bucket-id s2-0) - ; *temp-string* - ; (the-as vector (-> this particles data s5-0)) - ; (the-as font-color s1-0) - ; (the-as vector2h #f) - ; ) + (s4-0 + s3-0 + (the-as bucket-id s2-0) + *temp-string* + (the-as vector (-> this particles data s5-0)) + (the-as font-color s1-0) + (the-as vector2h #f) + ) ) ) 0 @@ -637,7 +640,8 @@ (compute-verlet-step this (* 0.0033333334 (the float v1-4))) ) ) - ;; (debug-draw this) + ;; og:preserve-this + (if *display-cloth-spheres* (debug-draw this)) 0 ) ) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable.gc b/goal_src/jak3/engine/process-drawable/process-drawable.gc index 80a4c2c3cbb..a6652a30fa6 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable.gc @@ -41,7 +41,12 @@ ) ) ) - )) + ) + +(defun-debug draw-cloth-spheres ((pd process-drawable)) + "Added in PC port" + (if (-> pd draw cloth-instances) + (dotimes (i (length (-> pd draw cloth-instances))) (debug-draw-spheres (-> pd draw cloth-instances i)))))) ;; DECOMP BEGINS @@ -553,12 +558,14 @@ ) ) ;; og:preserve-this - (#when PC_PORT (when *debug-segment* - (when *display-bones* - (draw-bone-lines (the-as process-drawable (-> this process)))) - (if *display-joint-names* - (draw-joint-spheres (the-as process-drawable (-> this process)))) - )) + (#when PC_PORT + (when *debug-segment* + (when *display-bones* + (draw-bone-lines (the-as process-drawable (-> this process)))) + (if *display-joint-names* + (draw-joint-spheres (the-as process-drawable (-> this process)))) + (if *display-cloth-spheres* + (draw-cloth-spheres (the process-drawable (-> this process)))))) 0 (none) ) diff --git a/goal_src/jak3/pc/debug/default-menu-pc.gc b/goal_src/jak3/pc/debug/default-menu-pc.gc index 4c1705287a4..24635bc01bb 100644 --- a/goal_src/jak3/pc/debug/default-menu-pc.gc +++ b/goal_src/jak3/pc/debug/default-menu-pc.gc @@ -988,6 +988,7 @@ (flag "Joint names" *display-joint-names* dm-boolean-toggle-pick-func) (flag "Bone lines" *display-bones* dm-boolean-toggle-pick-func) (flag "Entity Lights" *display-lights* dm-boolean-toggle-pick-func) + (flag "Cloth Spheres" *display-cloth-spheres* dm-boolean-toggle-pick-func) (flag "Debug Font Auto-Scale" #f ,(dm-lambda-boolean-flag (-> *pc-settings* debug-font-scale-auto?))) (float-var "Debug Font Scale" #f ,(dm-lambda-float-var (-> *pc-settings* debug-font-scale)) 2 (new 'static 'bfloat :data 0.01) #t (new 'static 'bfloat :data 0.1) 2 0) )