fixed trimesh visualization
@@ -297,8 +297,12 @@ impl Physics {
break;
}
}
+
if node.is_some() {
- if let Node::Mesh(mesh) = &graph[node] {
+ let mut stack = vec![node];
+ while let Some(handle) = stack.pop() {
+ let node = &graph[handle];
+ if let Node::Mesh(mesh) = node {
// Trimesh's transform is special - it has transform baked into vertices.
// We have to emulate it here.
let transform = mesh.global_transform();
@@ -319,6 +323,8 @@ impl Physics {
}
}
}
+ stack.extend_from_slice(node.children());
+ }
}
}
ColliderShapeDesc::Heightfield(_) => {} // TODO
