Rev | Line | |
---|
[1520] | 1 | #ifndef _RayCaster_H__
|
---|
| 2 | #define _RayCaster_H__
|
---|
| 3 |
|
---|
| 4 | #include "Containers.h"
|
---|
| 5 | #include <string>
|
---|
| 6 | using namespace std;
|
---|
| 7 |
|
---|
| 8 |
|
---|
| 9 | namespace GtpVisibilityPreprocessor {
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | class Intersectable;
|
---|
| 13 | class VssRay;
|
---|
| 14 | class SimpleRayContainer;
|
---|
| 15 | class AxisAlignedBox3;
|
---|
| 16 | class Vector3;
|
---|
| 17 | struct VssRayContainer;
|
---|
| 18 | class Preprocessor;
|
---|
| 19 |
|
---|
| 20 | /** This class provides an interface for ray casting.
|
---|
| 21 | */
|
---|
| 22 | class RayCaster
|
---|
| 23 | {
|
---|
| 24 | public:
|
---|
| 25 |
|
---|
| 26 | enum {
|
---|
| 27 | INTERNAL_RAYCASTER = 0,
|
---|
| 28 | INTEL_RAYCASTER
|
---|
| 29 | };
|
---|
| 30 |
|
---|
| 31 | RayCaster(const Preprocessor &preprocessor);
|
---|
| 32 |
|
---|
[1521] | 33 | virtual ~RayCaster();
|
---|
[1520] | 34 |
|
---|
| 35 | virtual int Type() const = 0;
|
---|
| 36 |
|
---|
[1521] | 37 | /** Wrapper for casting single ray.
|
---|
| 38 | */
|
---|
| 39 | VssRay *CastSingleRay(
|
---|
| 40 | const Vector3 &viewPoint,
|
---|
| 41 | const Vector3 &direction,
|
---|
| 42 | const float probability,
|
---|
| 43 | const AxisAlignedBox3 &box
|
---|
| 44 | );
|
---|
| 45 |
|
---|
[1520] | 46 | virtual int CastRay(
|
---|
| 47 | const Vector3 &viewPoint,
|
---|
| 48 | const Vector3 &direction,
|
---|
| 49 | const float probability,
|
---|
| 50 | VssRayContainer &vssRays,
|
---|
| 51 | const AxisAlignedBox3 &box,
|
---|
| 52 | const bool castDoubleRay
|
---|
| 53 | ) = 0;
|
---|
| 54 |
|
---|
| 55 | virtual void CastRays16(
|
---|
| 56 | const int i,
|
---|
| 57 | SimpleRayContainer &rays,
|
---|
| 58 | VssRayContainer &vssRays,
|
---|
| 59 | const AxisAlignedBox3 &sbox,
|
---|
| 60 | const bool castDoubleRay
|
---|
| 61 | ) = 0;
|
---|
| 62 |
|
---|
| 63 |
|
---|
| 64 | protected:
|
---|
| 65 |
|
---|
| 66 | int ProcessRay(
|
---|
| 67 | const Vector3 &viewPoint,
|
---|
| 68 | const Vector3 &direction,
|
---|
| 69 | Intersectable *objectA,
|
---|
| 70 | Vector3 &pointA,
|
---|
| 71 | const Vector3 &normalA,
|
---|
| 72 | Intersectable *objectB,
|
---|
| 73 | Vector3 &pointB,
|
---|
| 74 | const Vector3 &normalB,
|
---|
| 75 | const float probability,
|
---|
| 76 | VssRayContainer &vssRays,
|
---|
| 77 | const AxisAlignedBox3 &box
|
---|
| 78 | );
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 | const Preprocessor &mPreprocessor;
|
---|
| 82 | };
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.