Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xelatihy committed Jan 30, 2024
1 parent 484cfa6 commit 9e096fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions libs/yocto/yocto_raycasting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ void refit_scene_bvh(scene_bvh& sbvh, const scene_data& scene,
}

// Compute scene bounding box
bbox3f scene_bounds(const scene_data& scene) {
bbox3f compute_scene_bounds(const scene_data& scene) {
auto shape_bbox = vector<bbox3f>{};
auto bbox = invalidb3f;
for (auto& shape : scene.shapes) {
Expand All @@ -805,7 +805,7 @@ bbox3f scene_bounds(const scene_data& scene) {
}

// Compute shape bounding box
bbox3f shape_bounds(const shape_data& shape) {
bbox3f compute_shape_bounds(const shape_data& shape) {
auto bbox = invalidb3f;
for (auto p : shape.positions) bbox = merge(bbox, p);
return bbox;
Expand Down
12 changes: 6 additions & 6 deletions libs/yocto/yocto_raycasting.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ bvh_tree make_quads_bvh(const vector<vec4i>& quads,
const vector<vec3f>& positions, bool highquality = false);

// Updates shape bvh for changes in positions and radia
void update_points_bvh(bvh_tree& bvh, const vector<int>& points,
void refit_points_bvh(bvh_tree& bvh, const vector<int>& points,
const vector<vec3f>& positions, const vector<float>& radius);
void update_lines_bvh(bvh_tree& bvh, const vector<vec2i>& lines,
void refit_lines_bvh(bvh_tree& bvh, const vector<vec2i>& lines,
const vector<vec3f>& positions, const vector<float>& radius);
void update_triangles_bvh(bvh_tree& bvh, const vector<vec3i>& triangles,
void refit_triangles_bvh(bvh_tree& bvh, const vector<vec3i>& triangles,
const vector<vec3f>& positions);
void update_quads_bvh(
void refit_quads_bvh(
bvh_tree& bvh, const vector<vec4i>& quads, const vector<vec3f>& positions);

// Find a shape element or scene instances that intersects a ray,
Expand Down Expand Up @@ -464,8 +464,8 @@ intersection3f overlap_scene_bvh(const scene_bvh& bvh, const scene_data& scene,
vec3f pos, float max_distance, bool find_any = false);

// Compute scene bounds
bbox3f scene_bounds(const scene_data& scene);
bbox3f shape_bounds(const shape_data& shape);
bbox3f compute_scene_bounds(const scene_data& scene);
bbox3f compute_shape_bounds(const shape_data& shape);

} // namespace yocto

Expand Down
2 changes: 1 addition & 1 deletion libs/yocto/yocto_sceneio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ void add_missing_camera(scene_data& scene) {
camera.aspect = (float)16 / (float)9;
camera.aperture = 0;
camera.lens = 0.050f;
auto bbox = scene_bounds(scene);
auto bbox = compute_scene_bounds(scene);
auto center = (bbox.max + bbox.min) / 2;
auto bbox_radius = length(bbox.max - bbox.min) / 2;
auto camera_dir = vec3f{0, 0, 1};
Expand Down

0 comments on commit 9e096fb

Please sign in to comment.