! Tests if single ray is occluded by the scene. */
| 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) |
| 176 | { |
| 177 | assert(primID < size()); |
| 178 | |
| 179 | int mask = -1; |
| 180 | OccludedFunctionNArguments args; |
| 181 | args.valid = &mask; |
| 182 | args.geometryUserPtr = userPtr; |
| 183 | args.context = context->user; |
| 184 | args.ray = (RTCRayN*)&ray; |
| 185 | args.N = 1; |
| 186 | args.geomID = geomID; |
| 187 | args.primID = primID; |
| 188 | args.geometry = this; |
| 189 | args.forward_scene = nullptr; |
| 190 | args.args = context->args; |
| 191 | |
| 192 | OccludedFuncN occludedFunc = nullptr; |
| 193 | occludedFunc = intersectorN.occluded; |
| 194 | |
| 195 | if (context->getOccludedFunction()) |
| 196 | occludedFunc = context->getOccludedFunction(); |
| 197 | |
| 198 | assert(occludedFunc); |
| 199 | occludedFunc(&args); |
| 200 | |
| 201 | return mask != 0; |
| 202 | } |
| 203 | |
| 204 | /*! Intersects a single ray with the scene. */ |
| 205 | __forceinline bool intersect (RayHit& ray, unsigned int geomID, unsigned int primID, RayQueryContext* context, RTCScene& forward_scene) |
nothing calls this directly
no test coverage detected