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

Method intersect

kernels/common/accelset.h:145–172  ·  view source on GitHub ↗

! Intersects a single ray with the scene. */

Source from the content-addressed store, hash-verified

143
144 /*! Intersects a single ray with the scene. */
145 __forceinline bool intersect (RayHit& ray, unsigned int geomID, unsigned int primID, RayQueryContext* context)
146 {
147 assert(primID < size());
148
149 int mask = -1;
150 IntersectFunctionNArguments args;
151 args.valid = &mask;
152 args.geometryUserPtr = userPtr;
153 args.context = context->user;
154 args.rayhit = (RTCRayHitN*)&ray;
155 args.N = 1;
156 args.geomID = geomID;
157 args.primID = primID;
158 args.geometry = this;
159 args.forward_scene = nullptr;
160 args.args = context->args;
161
162 IntersectFuncN intersectFunc = nullptr;
163 intersectFunc = intersectorN.intersect;
164
165 if (context->getIntersectFunction())
166 intersectFunc = context->getIntersectFunction();
167
168 assert(intersectFunc);
169 intersectFunc(&args);
170
171 return mask != 0;
172 }
173
174 /*! Tests if single ray is occluded by the scene. */
175 __forceinline bool occluded (Ray& ray, unsigned int geomID, unsigned int primID, RayQueryContext* context)

Callers

nothing calls this directly

Calls 3

getIntersectFunctionMethod · 0.80
sizeFunction · 0.70
mask32Method · 0.45

Tested by

no test coverage detected