@@ -913,9 +913,6 @@ static void geo_process_object(struct Object *node) {
913913 mtxf_to_mtx (mtx , gMatStack [gMatStackIndex ]);
914914 gMatStackFixed [gMatStackIndex ] = mtx ;
915915
916- // ====================================================================
917- // === INJECT DEBUG BOX: DRAW TRUE HITBOX ===
918- // ====================================================================
919916 if ((node -> header .gfx .node .flags & GRAPH_RENDER_DRAW_DEBUG ) != 0 ) {
920917 Mtx * debugMtx = alloc_display_list (sizeof (Mtx ));
921918 if (debugMtx != NULL ) {
@@ -924,11 +921,8 @@ static void geo_process_object(struct Object *node) {
924921 Mat4 translateMat ;
925922 Mat4 tempMat ;
926923
927- // 1. Copy the current world matrix (which has visual scale baked in)
928924 mtxf_copy (debugMat , gMatStack [gMatStackIndex ]);
929925
930- // 2. Calculate Inverse Scale to counteract visual scaling and enforce true hitbox size
931- // (Avoid divide-by-zero crashes if a scale happens to be 0)
932926 Vec3f inverseScale = {
933927 (node -> header .gfx .scale [0 ] > 0.001f ) ? (node -> hitboxRadius / node -> header .gfx .scale [0 ]) : 0.0f ,
934928 (node -> header .gfx .scale [1 ] > 0.001f ) ? (node -> hitboxHeight / node -> header .gfx .scale [1 ]) : 0.0f ,
@@ -938,18 +932,14 @@ static void geo_process_object(struct Object *node) {
938932 mtxf_identity (scaleMat );
939933 mtxf_scale_vec3f (scaleMat , scaleMat , inverseScale );
940934
941- // 3. Apply the hitbox down offset (also inversely scaled by Y)
942935 float yOffset = (node -> header .gfx .scale [1 ] > 0.001f ) ? (- node -> hitboxDownOffset / node -> header .gfx .scale [1 ]) : 0.0f ;
943936 mtxf_translate (translateMat , (Vec3f ){0.0f , yOffset , 0.0f });
944937
945- // 4. Combine: tempMat = Translation * Scale
946938 mtxf_mul (tempMat , translateMat , scaleMat );
947939
948- // 5. Apply it to the main debug matrix
949940 mtxf_mul (debugMat , tempMat , debugMat );
950941 mtxf_to_mtx (debugMtx , debugMat );
951942
952- // 6. Push directly to the RDP!
953943 gSPMatrix (gDisplayListHead ++ , debugMtx , G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH );
954944 gSPDisplayList (gDisplayListHead ++ , dl_debug_box );
955945 gSPPopMatrix (gDisplayListHead ++ , G_MTX_MODELVIEW );
0 commit comments