| 668 | } |
| 669 | |
| 670 | RTC_API void rtcIntersect4 (const int* valid, RTCScene hscene, RTCRayHit4* rayhit, RTCIntersectArguments* args) |
| 671 | { |
| 672 | Scene* scene = (Scene*) hscene; |
| 673 | RTC_CATCH_BEGIN; |
| 674 | RTC_TRACE(rtcIntersect4); |
| 675 | |
| 676 | #if defined(DEBUG) |
| 677 | RTC_VERIFY_HANDLE(hscene); |
| 678 | if (scene->isModified()) throw_RTCError(RTC_ERROR_INVALID_OPERATION,"scene not committed"); |
| 679 | if (((size_t)valid) & 0x0F) throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "mask not aligned to 16 bytes"); |
| 680 | if (((size_t)rayhit) & 0x0F) throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "rayhit not aligned to 16 bytes"); |
| 681 | #endif |
| 682 | STAT(size_t cnt=0; for (size_t i=0; i<4; i++) cnt += ((int*)valid)[i] == -1;); |
| 683 | STAT3(normal.travs,cnt,cnt,cnt); |
| 684 | |
| 685 | RTCIntersectArguments defaultArgs; |
| 686 | if (unlikely(args == nullptr)) { |
| 687 | rtcInitIntersectArguments(&defaultArgs); |
| 688 | args = &defaultArgs; |
| 689 | } |
| 690 | RTCRayQueryContext* user_context = args->context; |
| 691 | |
| 692 | RTCRayQueryContext defaultContext; |
| 693 | if (unlikely(user_context == nullptr)) { |
| 694 | rtcInitRayQueryContext(&defaultContext); |
| 695 | user_context = &defaultContext; |
| 696 | } |
| 697 | RayQueryContext context(scene,user_context,args); |
| 698 | |
| 699 | if (likely(scene->intersectors.intersector4)) |
| 700 | scene->intersectors.intersect4(valid,*rayhit,&context); |
| 701 | |
| 702 | else { |
| 703 | RayHit4* ray4 = (RayHit4*) rayhit; |
| 704 | for (size_t i=0; i<4; i++) { |
| 705 | if (!valid[i]) continue; |
| 706 | RayHit ray1; ray4->get(i,ray1); |
| 707 | scene->intersectors.intersect((RTCRayHit&)ray1,&context); |
| 708 | ray4->set(i,ray1); |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | RTC_CATCH_END2(scene); |
| 713 | } |
| 714 | |
| 715 | template<int N> void copy(float* dst, float* src); |
| 716 |
no test coverage detected