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

Method occluded

kernels/geometry/instance_intersector.cpp:40–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 }
39
40 bool InstanceIntersector1::occluded(const Precalculations& pre, Ray& ray, RayQueryContext* context, const InstancePrimitive& prim)
41 {
42 const Instance* instance = prim.instance;
43
44 /* perform ray mask test */
45#if defined(EMBREE_RAY_MASK)
46 if ((ray.mask & instance->mask) == 0)
47 return false;
48#endif
49
50 RTCRayQueryContext* user_context = context->user;
51 bool occluded = false;
52 if (likely(instance_id_stack::push(user_context, prim.instID_, 0)))
53 {
54 const AffineSpace3fa world2local = instance->getWorld2Local();
55 const Vec3ff ray_org = ray.org;
56 const Vec3ff ray_dir = ray.dir;
57 ray.org = Vec3ff(xfmPoint(world2local, ray_org), ray.tnear());
58 ray.dir = Vec3ff(xfmVector(world2local, ray_dir), ray.time());
59 RayQueryContext newcontext((Scene*)instance->object, user_context, context->args);
60 instance->object->intersectors.occluded((RTCRay&)ray, &newcontext);
61 ray.org = ray_org;
62 ray.dir = ray_dir;
63 occluded = ray.tfar < 0.0f;
64 instance_id_stack::pop(user_context);
65 }
66 return occluded;
67 }
68
69 bool InstanceIntersector1::pointQuery(PointQuery* query, PointQueryContext* context, const InstancePrimitive& prim)
70 {

Callers

nothing calls this directly

Calls 8

pushFunction · 0.85
popFunction · 0.85
tnearMethod · 0.80
timeMethod · 0.80
xfmPointFunction · 0.50
xfmVectorFunction · 0.50
noneFunction · 0.50
getWorld2LocalMethod · 0.45

Tested by

no test coverage detected