| 1 | // Copyright 2009-2021 Intel Corporation |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "bvh.h" |
| 7 | #include "../common/ray.h" |
| 8 | #include "../common/point_query.h" |
| 9 | |
| 10 | namespace embree |
| 11 | { |
| 12 | namespace isa |
| 13 | { |
| 14 | /*! BVH single ray intersector. */ |
| 15 | template<int N, int types, bool robust, typename PrimitiveIntersector1> |
| 16 | class BVHNIntersector1 |
| 17 | { |
| 18 | /* shortcuts for frequently used types */ |
| 19 | typedef typename PrimitiveIntersector1::Precalculations Precalculations; |
| 20 | typedef typename PrimitiveIntersector1::Primitive Primitive; |
| 21 | typedef BVHN<N> BVH; |
| 22 | typedef typename BVH::NodeRef NodeRef; |
| 23 | typedef typename BVH::AABBNode AABBNode; |
| 24 | typedef typename BVH::AABBNodeMB4D AABBNodeMB4D; |
| 25 | |
| 26 | static const size_t stackSize = 1+(N-1)*BVH::maxDepth+3; // +3 due to 16-wide store |
| 27 | |
| 28 | public: |
| 29 | static void intersect (const Accel::Intersectors* This, RayHit& ray, IntersectContext* context); |
| 30 | static void occluded (const Accel::Intersectors* This, Ray& ray, IntersectContext* context); |
| 31 | static bool pointQuery(const Accel::Intersectors* This, PointQuery* query, PointQueryContext* context); |
| 32 | }; |
| 33 | } |
| 34 | } |
| 35 | |