#ifndef _RayCaster_H__ #define _RayCaster_H__ #include "Containers.h" #include using namespace std; namespace GtpVisibilityPreprocessor { class Intersectable; class VssRay; class SimpleRayContainer; class AxisAlignedBox3; class Vector3; struct VssRayContainer; class Preprocessor; /** This class provides an interface for ray casting. */ class RayCaster { public: enum { INTERNAL_RAYCASTER = 0, INTEL_RAYCASTER }; RayCaster(const Preprocessor &preprocessor); virtual ~RayCaster(); virtual int Type() const = 0; /** Wrapper for casting single ray. */ VssRay *CastSingleRay( const Vector3 &viewPoint, const Vector3 &direction, const float probability, const AxisAlignedBox3 &box ); virtual int CastRay( const Vector3 &viewPoint, const Vector3 &direction, const float probability, VssRayContainer &vssRays, const AxisAlignedBox3 &box, const bool castDoubleRay ) = 0; virtual void CastRays16( const int i, SimpleRayContainer &rays, VssRayContainer &vssRays, const AxisAlignedBox3 &sbox, const bool castDoubleRay ) = 0; protected: int ProcessRay( const Vector3 &viewPoint, const Vector3 &direction, Intersectable *objectA, Vector3 &pointA, const Vector3 &normalA, Intersectable *objectB, Vector3 &pointB, const Vector3 &normalB, const float probability, VssRayContainer &vssRays, const AxisAlignedBox3 &box ); const Preprocessor &mPreprocessor; }; } #endif