Skip to content

Commit 1e9d966

Browse files
committed
Add fix for Embree 4
1 parent f233fb5 commit 1e9d966

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/common/embree_intersector.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ bool EmbreeIntersector::intersectRay(
160160

161161
// shot ray
162162
{
163-
RTCIntersectContext context;
164-
rtcInitIntersectContext(&context);
165-
rtcIntersect1(scene,&context,&ray);
163+
rtcIntersect1(scene,&ray);
166164
ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
167165
ray.hit.Ng_y = -ray.hit.Ng_y;
168166
ray.hit.Ng_z = -ray.hit.Ng_z;
@@ -271,9 +269,7 @@ ::intersectRay(
271269
ray.hit.instID[0] = RTC_INVALID_GEOMETRY_ID;
272270
num_rays++;
273271
{
274-
RTCIntersectContext context;
275-
rtcInitIntersectContext(&context);
276-
rtcIntersect1(scene,&context,&ray);
272+
rtcIntersect1(scene,&ray);
277273
ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
278274
ray.hit.Ng_y = -ray.hit.Ng_y;
279275
ray.hit.Ng_z = -ray.hit.Ng_z;
@@ -353,9 +349,7 @@ ::intersectSegment(const Eigen::RowVector3f& a, const Eigen::RowVector3f& ab, Hi
353349
createRay(ray,a,ab,0,1.0,mask);
354350

355351
{
356-
RTCIntersectContext context;
357-
rtcInitIntersectContext(&context);
358-
rtcIntersect1(scene,&context,&ray);
352+
rtcIntersect1(scene,&ray);
359353
ray.hit.Ng_x = -ray.hit.Ng_x; // EMBREE_FIXME: only correct for triangles,quads, and subdivision surfaces
360354
ray.hit.Ng_y = -ray.hit.Ng_y;
361355
ray.hit.Ng_z = -ray.hit.Ng_z;

0 commit comments

Comments
 (0)