bvh_intersector1.h 1.1 KB

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