Skip to content

Commit 6cef96b

Browse files
committed
Fix debug rendering
1 parent a40e111 commit 6cef96b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/debug_render/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fn debug_render_aabbs(
255255

256256
fn debug_render_bvh(bvh: Res<ColliderTrees>, mut gizmos: Gizmos<PhysicsGizmos>) {
257257
for node in bvh.dynamic_tree.bvh.nodes.iter() {
258-
if node.prim_count == 0 {
258+
if node.prim_count == 0 && node.aabb.valid() {
259259
gizmos.aabb_3d(
260260
Aabb3d::from_min_max(node.aabb.min, node.aabb.max),
261261
Transform::IDENTITY,
@@ -264,7 +264,7 @@ fn debug_render_bvh(bvh: Res<ColliderTrees>, mut gizmos: Gizmos<PhysicsGizmos>)
264264
}
265265
}
266266
for node in bvh.static_tree.bvh.nodes.iter() {
267-
if node.prim_count == 0 {
267+
if node.prim_count == 0 && node.aabb.valid() {
268268
gizmos.aabb_3d(
269269
Aabb3d::from_min_max(node.aabb.min, node.aabb.max),
270270
Transform::IDENTITY,

0 commit comments

Comments
 (0)