Skip to content

Commit

Permalink
Remove bvh intialization from assert. (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Blomqvist authored Mar 29, 2022
1 parent 3608950 commit e8f3173
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ using namespace Eigen;

class SceneCamera {
public:
Eigen::Matrix3f cameraMatrix;
int imageWidth;
int imageHeight;
Eigen::Matrix3f cameraMatrix;

SceneCamera(const std::filesystem::path intrinsicsPath);
SceneCamera(const Eigen::Matrix3f cameraMatrix, double width, double height);
Expand Down
1 change: 1 addition & 0 deletions src/controllers/studio_view_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ bool StudioViewController::keypress(char character, const InputModifier mod) {
} else if (mod == ModShift && character == '2') {
pointCloudView.loadPointCloud();
sceneModel.activeView = active_view::PointCloudView;
return true;
} else if (character == 'K') {
sceneModel.activeToolId = AddKeypointToolId;
return true;
Expand Down
7 changes: 6 additions & 1 deletion src/geometry/ray_trace_cloud.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "geometry/ray_trace_cloud.h"
#include <iostream>

using namespace geometry;
using namespace particle_tracing;
Expand All @@ -11,7 +12,11 @@ RayTraceCloud::RayTraceCloud(std::shared_ptr<geometry::PointCloud> pc, float& si
RowMatrixf vertices = pointCloud->points;
SphereGeometry sphereGeometry(vertices.data(), 0.01);
SpherePred spherePredicate(vertices.data());
assert(bvh.Build(vertices.rows(), sphereGeometry, spherePredicate, options));
bool ret = bvh.Build(vertices.rows(), sphereGeometry, spherePredicate, options);
if (!ret) {
std::cout << "Failed to initialize bounding volume hierarchy" << std::endl;
exit(1);
}
}

Intersection RayTraceCloud::traceRayIntersection(const Vector3f& origin, const Vector3f& direction) const {
Expand Down

0 comments on commit e8f3173

Please sign in to comment.