00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VRS_RAYINTERSECTOR_H
00021 #define VRS_RAYINTERSECTOR_H
00022
00023 #include <vrs/handler.h>
00024 #include <vrs/engine.h>
00025 #include <vrs/raytracingtechnique.h>
00026
00027 namespace VRS {
00028
00033 class VRS_CORE_API RayIntersector : public Handler {
00034 public:
00035 virtual ID service() const;
00039 virtual bool intersect(
00040 Engine* ctx,
00041 const Matrix& mv, const Matrix& ori, const Matrix& pr,
00042 const Shape* S, const Ray& r, RayTracingTechnique* tracer
00043 ) = 0;
00048 VRS_TYPEINFO(RayIntersector, Handler);
00049
00050 public:
00051 static bool intersectTriangle(
00052 const Vector& rayorigin, const Vector& raydirection,
00053 const Vector& V0, const Vector& V1, const Vector& V2,
00054 const Vector& normal, Vector& pointRet
00055 );
00056
00057 protected:
00058 static bool intersectTriangle(
00059 const Vector& rayorigin, const Vector& raydirection,
00060 const Vector& V0, const Vector& V1, const Vector& V2,
00061 const Matrix& mv, const Matrix& ori, const Matrix& pr,
00062 const Shape* S,
00063 RayTracingTechnique* tracer,
00064 int hint = 0,
00065 unsigned int instanceInfo = 0,
00066 UINT32 id = 0
00067 );
00068
00069 };
00070
00071 }
00072
00073 #endif // VRS_RAYINTERSECTOR_H