add debug joint renderer (#2309)

This commit is contained in:
ManDude
2023-03-10 03:12:44 +00:00
committed by GitHub
parent 88179d14d7
commit 9cb2963cde
@@ -12,6 +12,17 @@
(define *display-bones* #f)
(define *display-joint-names* #f)
(defun draw-joint-spheres ((arg0 process-drawable))
(dotimes (s5-0 (-> arg0 node-list length))
(let ((a2-0 (vector<-cspace! (new-stack-vector0) (-> arg0 node-list data s5-0))))
(add-debug-sphere #t (bucket-id debug2) a2-0 (meters 0.2) (new 'static 'rgba :g #xff :a #x40))
(#when PC_PORT
(add-debug-text-sphere (!= (-> arg0 node-list data s5-0 joint) #f) (bucket-id debug2) a2-0 (meters 0.1) (the string (-> arg0 node-list data s5-0 joint name)) (static-rgba 0 #xff 0 #x40)))
)
)
#f
)
(defun-debug draw-bone-lines ((obj process-drawable))
"Added in PC port to debug bones"
(dotimes (i (-> obj node-list length))
@@ -460,8 +471,8 @@
(#when PC_PORT (when *debug-segment*
(if *display-bones*
(draw-bone-lines (the-as process-drawable (-> obj process))))
;; (if *display-joint-names*
;; (draw-joint-spheres obj))
(if *display-joint-names*
(draw-joint-spheres (the-as process-drawable (-> obj process))))
))
0
(none)