Browse Source

Fix assertion when rendering bounding volumes (broken since 6f8b379)

rdb 8 years ago
parent
commit
9bfc425b75
2 changed files with 3 additions and 1 deletions
  1. 2 0
      panda/src/pgraph/cullResult.cxx
  2. 1 1
      panda/src/pgraph/cullTraverser.cxx

+ 2 - 0
panda/src/pgraph/cullResult.cxx

@@ -105,6 +105,8 @@ add_object(CullableObject *object, const CullTraverser *traverser) {
   static const LColor flash_multisample_color(0.78f, 0.05f, 0.81f, 1.0f);
   static const LColor flash_multisample_color(0.78f, 0.05f, 0.81f, 1.0f);
   static const LColor flash_dual_color(0.92, 0.01f, 0.01f, 1.0f);
   static const LColor flash_dual_color(0.92, 0.01f, 0.01f, 1.0f);
 
 
+  nassertv(object->_draw_callback != nullptr || object->_geom != nullptr);
+
   bool force = !traverser->get_effective_incomplete_render();
   bool force = !traverser->get_effective_incomplete_render();
   Thread *current_thread = traverser->get_current_thread();
   Thread *current_thread = traverser->get_current_thread();
   CullBinManager *bin_manager = CullBinManager::get_global_ptr();
   CullBinManager *bin_manager = CullBinManager::get_global_ptr();

+ 1 - 1
panda/src/pgraph/cullTraverser.cxx

@@ -232,7 +232,7 @@ draw_bounding_volume(const BoundingVolume *vol,
   if (bounds_viz != (Geom *)NULL) {
   if (bounds_viz != (Geom *)NULL) {
     _geoms_pcollector.add_level(2);
     _geoms_pcollector.add_level(2);
     CullableObject *outer_viz =
     CullableObject *outer_viz =
-      new CullableObject(move(bounds_viz), get_bounds_outer_viz_state(),
+      new CullableObject(bounds_viz, get_bounds_outer_viz_state(),
                          internal_transform);
                          internal_transform);
     _cull_handler->record_object(outer_viz, this);
     _cull_handler->record_object(outer_viz, this);