MCPcopy Create free account
hub / github.com/RenderKit/embree / castRay

Function castRay

tests/integration/test_embree_release/test.cpp:21–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19};
20
21inline Hit castRay(RTCScene scene,
22 float ox, float oy, float oz,
23 float dx, float dy, float dz)
24{
25 Hit result;
26 struct RTCRayHit rayhit;
27 rayhit.ray.org_x = ox;
28 rayhit.ray.org_y = oy;
29 rayhit.ray.org_z = oz;
30 rayhit.ray.dir_x = dx;
31 rayhit.ray.dir_y = dy;
32 rayhit.ray.dir_z = dz;
33 rayhit.ray.tnear = 0;
34 rayhit.ray.tfar = std::numeric_limits<float>::infinity();
35 rayhit.ray.mask = -1;
36 rayhit.ray.flags = 0;
37 rayhit.hit.geomID = RTC_INVALID_GEOMETRY_ID;
38 rayhit.hit.instID[0] = RTC_INVALID_GEOMETRY_ID;
39 rayhit.hit.instPrimID[0] = RTC_INVALID_GEOMETRY_ID;
40
41 rtcIntersect1(scene, &rayhit);
42
43 printf("%f, %f, %f: ", ox, oy, oz);
44 if (rayhit.hit.geomID != RTC_INVALID_GEOMETRY_ID)
45 {
46 result.found_hit = true;
47 result.geomID = rayhit.hit.geomID;
48 result.primID = rayhit.hit.primID;
49 result.tfar = rayhit.ray.tfar;
50 printf("Found intersection on geometry %d, primitive %d at tfar=%f\n", rayhit.hit.geomID, rayhit.hit.primID, rayhit.ray.tfar);
51 }
52 else
53 printf("Did not find any intersection\n");
54
55 return result;
56}
57
58
59TEST_CASE("Minimal test", "[minimal]")

Callers 1

test.cppFile · 0.70

Calls 1

rtcIntersect1Function · 0.85

Tested by

no test coverage detected