libs/yocto/yocto_scene.cpp
// Updates the scene and scene's instances bounding boxes
Updates the scene and scene's instances bounding boxes
Updates the scene and scene ' s instances bounding boxes
bbox3f compute_bounds(const scene_model* scene) {
  auto shape_bbox = unordered_map<scene_shape*, bbox3f>{};
  auto bbox       = invalidb3f;
  for (auto shape : scene->shapes) {
    auto sbvh = invalidb3f;
    for (auto p : shape->positions) sbvh = merge(sbvh, p);
    shape_bbox[shape] = sbvh;
  }
  for (auto instance : scene->instances) {
    auto sbvh = shape_bbox[instance->shape];
    bbox      = merge(bbox, transform_bbox(instance->frame, sbvh));
  }
  return bbox;
}
bbox3f compute_bounds ( const scene_model * scene ) { auto shape_bbox = unordered_map < scene_shape * , bbox3f > { } ; auto bbox = invalidb3f ; for ( auto shape : scene -> shapes ) { auto sbvh = invalidb3f ; for ( auto p : shape -> positions ) sbvh = merge ( sbvh , p ) ; shape_bbox [ shape ] = sbvh ; } for ( auto instance : scene -> instances ) { auto sbvh = shape_bbox [ instance -> shape ] ; bbox = merge ( bbox , transform_bbox ( instance -> frame , sbvh ) ) ; } return bbox ; }
Updates the scene and scene's instances bounding boxes
Updates the scene and scene ' s instances bounding boxes