Skip to content

Commit

Permalink
Change RTCRayHit mask default value and enable filter callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
lumurillo committed Mar 10, 2024
1 parent 8504b27 commit 67dc399
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp/open3d/t/geometry/RaycastingScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ struct RaycastingScene::Impl {
} else {
rh.ray.tfar = std::numeric_limits<float>::infinity();
}
rh.ray.mask = 0;
rh.ray.mask = -1;
rh.ray.id = i - range.begin();
rh.ray.flags = 0;
rh.hit.geomID = RTC_INVALID_GEOMETRY_ID;
Expand Down Expand Up @@ -462,7 +462,7 @@ struct RaycastingScene::Impl {
ray.dir_z = r[5];
ray.tnear = tnear;
ray.tfar = tfar;
ray.mask = 0;
ray.mask = -1;
ray.id = i - range.begin();
ray.flags = 0;

Expand Down Expand Up @@ -530,7 +530,7 @@ struct RaycastingScene::Impl {
rh->ray.dir_z = r[5];
rh->ray.tnear = 0;
rh->ray.tfar = std::numeric_limits<float>::infinity();
rh->ray.mask = 0;
rh->ray.mask = -1;
rh->ray.flags = 0;
rh->ray.id = i;
rh->hit.geomID = RTC_INVALID_GEOMETRY_ID;
Expand Down Expand Up @@ -611,7 +611,7 @@ struct RaycastingScene::Impl {
rh->ray.dir_z = r[5];
rh->ray.tnear = 0;
rh->ray.tfar = std::numeric_limits<float>::infinity();
rh->ray.mask = 0;
rh->ray.mask = -1;
rh->ray.flags = 0;
rh->ray.id = i;
rh->hit.geomID = RTC_INVALID_GEOMETRY_ID;
Expand Down Expand Up @@ -753,6 +753,7 @@ uint32_t RaycastingScene::AddTriangles(const core::Tensor& vertex_positions,
memcpy(index_buffer, data.GetDataPtr(),
sizeof(uint32_t) * 3 * num_triangles);
}
rtcSetGeometryEnableFilterFunctionFromArguments(geom, true);
rtcCommitGeometry(geom);

uint32_t geom_id = rtcAttachGeometry(impl_->scene_, geom);
Expand Down

0 comments on commit 67dc399

Please sign in to comment.