00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_OPENGL_PRIMITIVEQUADTREEDISTANCERAYINTERSECTORGL_H
00019 #define VRS_OPENGL_PRIMITIVEQUADTREEDISTANCERAYINTERSECTORGL_H
00020
00021 #include <vrs/rayintersector.h>
00022 #include <vector>
00023
00024 namespace VRS {
00025
00026 class VRS_CORE_API PrimitiveQuadTreeDistanceRayIntersectorGL :
00027 public RayIntersector
00028 {
00029 public:
00030 VRS_TYPEINFO(PrimitiveQuadTreeDistanceRayIntersectorGL, RayIntersector);
00031
00032 virtual ID target() const;
00034
00035 virtual bool intersect(
00036 Engine* engine,
00037 const Matrix& mv, const Matrix& ori, const Matrix& pr,
00038 const Shape* shape,
00039 const Ray& ray,
00040 RayTracingTechnique* tracer
00041 );
00043
00044 private:
00045 typedef VertexData<3, float> Vertex3f;
00046 static void intersectTriangles(
00047 const std::vector<Vertex3f>& vertices,
00048 const std::vector<unsigned int>& indices,
00049 const unsigned int startIndex,
00050 const unsigned int endIndex,
00051 const Matrix& mv,
00052 const Matrix& ori,
00053 const Matrix& pr,
00054 const Shape* shape,
00055 const Ray& ray,
00056 RayTracingTechnique* tracer
00057 );
00058
00059 };
00060
00061 }
00062
00063 #endif // VRS_OPENGL_PRIMITIVEQUADTREEDISTANCERAYINTERSECTORGL_H