From a68344681b90fdb3da581a4f3d5ba348ab0c6389 Mon Sep 17 00:00:00 2001 From: Ricardo Buring Date: Mon, 25 Jul 2022 18:35:14 +0200 Subject: [PATCH] Fixup BVH debugging statements (cherry picked from commit 90725964a45aad2652905db55398ccabc2eb80d8) --- core/math/bvh.h | 9 +-------- core/math/bvh_public.inc | 6 +++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/math/bvh.h b/core/math/bvh.h index e45aabdac22..9606a703f78 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -301,7 +301,7 @@ public: tree.update(); _check_for_collisions(); #ifdef BVH_INTEGRITY_CHECKS - tree.integrity_check_all(); + tree._integrity_check_all(); #endif } @@ -477,13 +477,6 @@ private: continue; } -#ifdef BVH_CHECKS - // if neither are pairable, they should ignore each other - // THIS SHOULD NEVER HAPPEN .. now we only test the pairable tree - // if the changed item is not pairable - CRASH_COND(params.test_pairable_only && !tree._extra[ref_id].pairable); -#endif - // checkmasks is already done in the cull routine. BVHHandle h_collidee; h_collidee.set_id(ref_id); diff --git a/core/math/bvh_public.inc b/core/math/bvh_public.inc index db4de03b39d..f590c805e93 100644 --- a/core/math/bvh_public.inc +++ b/core/math/bvh_public.inc @@ -2,7 +2,7 @@ public: BVHHandle item_add(T *p_userdata, bool p_active, const BOUNDS &p_aabb, int32_t p_subindex, bool p_pairable, uint32_t p_pairable_type, uint32_t p_pairable_mask, bool p_invisible = false) { #ifdef BVH_VERBOSE_TREE VERBOSE_PRINT("\nitem_add BEFORE"); - _debug_recursive_print_tree(0); + _debug_recursive_print_tree(p_tree_id); VERBOSE_PRINT("\n"); #endif @@ -90,8 +90,8 @@ BVHHandle item_add(T *p_userdata, bool p_active, const BOUNDS &p_aabb, int32_t p mem += _nodes.estimate_memory_use(); String sz = _debug_aabb_to_string(abb); - VERBOSE_PRINT("\titem_add [" + itos(ref_id) + "] " + itos(_refs.size()) + " refs,\t" + itos(_nodes.size()) + " nodes " + sz); - VERBOSE_PRINT("mem use : " + itos(mem) + ", num nodes : " + itos(_nodes.size())); + VERBOSE_PRINT("\titem_add [" + itos(ref_id) + "] " + itos(_refs.used_size()) + " refs,\t" + itos(_nodes.used_size()) + " nodes " + sz); + VERBOSE_PRINT("mem use : " + itos(mem) + ", num nodes reserved : " + itos(_nodes.reserved_size())); #endif