1 | #ifndef _IntelRayCaster_H__
|
---|
2 | #define _IntelRayCaster_H__
|
---|
3 |
|
---|
4 | #include "RayCaster.h"
|
---|
5 | #include <vector>
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace GtpVisibilityPreprocessor {
|
---|
9 |
|
---|
10 |
|
---|
11 | class Intersectable;
|
---|
12 | class VssRay;
|
---|
13 | class KdTree;
|
---|
14 | class Ray;
|
---|
15 | class SimpleRayContainer;
|
---|
16 | class AxisAlignedBox3;
|
---|
17 | class Vector3;
|
---|
18 | struct VssRayContainer;
|
---|
19 | class Preprocessor;
|
---|
20 | struct SimpleRay;
|
---|
21 |
|
---|
22 |
|
---|
23 | /** This class provides an interface for ray casting.
|
---|
24 | */
|
---|
25 | class IntelRayCaster: public RayCaster
|
---|
26 | {
|
---|
27 | public:
|
---|
28 | /** Default constructor initialising e.g., KD tree and BSP tree.
|
---|
29 | */
|
---|
30 | IntelRayCaster(const Preprocessor &preprocessor,
|
---|
31 | const std::string externKdTree);
|
---|
32 |
|
---|
33 | virtual ~IntelRayCaster();
|
---|
34 |
|
---|
35 | int Type() const
|
---|
36 | {
|
---|
37 | return INTEL_RAYCASTER;
|
---|
38 | }
|
---|
39 |
|
---|
40 | // Using packet of 4 rays supposing that these are coherent
|
---|
41 | // We give a box to which each ray is clipped to before the
|
---|
42 | // ray shooting is computed !
|
---|
43 | virtual void CastRaysPacket4(const Vector3 &minBox,
|
---|
44 | const Vector3 &maxBox,
|
---|
45 | const Vector3 origin4[],
|
---|
46 | const Vector3 direction4[],
|
---|
47 | int result4[],
|
---|
48 | float dist4[]);
|
---|
49 |
|
---|
50 | virtual int CastRay(const SimpleRay &simpleRay,
|
---|
51 | VssRayContainer &vssRays,
|
---|
52 | const AxisAlignedBox3 &box,
|
---|
53 | const bool castDoubleRay,
|
---|
54 | const bool pruneInvalidRays = true);
|
---|
55 |
|
---|
56 | virtual void CastRays16(
|
---|
57 | SimpleRayContainer &rays,
|
---|
58 | VssRayContainer &vssRays,
|
---|
59 | const AxisAlignedBox3 &sbox,
|
---|
60 | const bool castDoubleRay,
|
---|
61 | const bool pruneInvalidRays = true);
|
---|
62 |
|
---|
63 | virtual void CastRays16(
|
---|
64 | SimpleRayContainer &rays,
|
---|
65 | const int offset,
|
---|
66 | VssRayContainer &vssRays,
|
---|
67 | const AxisAlignedBox3 &sbox,
|
---|
68 | const bool castDoubleRay,
|
---|
69 | const bool pruneInvalidRays = true);
|
---|
70 |
|
---|
71 |
|
---|
72 | void
|
---|
73 | CastSimpleForwardRays(
|
---|
74 | SimpleRayContainer &rays,
|
---|
75 | const AxisAlignedBox3 &sbox
|
---|
76 | );
|
---|
77 |
|
---|
78 | virtual void CastRays(
|
---|
79 | SimpleRayContainer &rays,
|
---|
80 | VssRayContainer &vssRays,
|
---|
81 | const AxisAlignedBox3 &sbox,
|
---|
82 | const bool castDoubleRay,
|
---|
83 | const bool pruneInvalidRays = true);
|
---|
84 |
|
---|
85 | virtual void AddDynamicObjecs(const ObjectContainer &objects, const Matrix4x4 &m) {};
|
---|
86 | virtual void UpdateDynamicObjects(const Matrix4x4 &m) {};
|
---|
87 | virtual void DeleteDynamicObjects() {};
|
---|
88 |
|
---|
89 | protected:
|
---|
90 |
|
---|
91 | bool InitRayCast(const std::string externKdTree);
|
---|
92 | };
|
---|
93 |
|
---|
94 |
|
---|
95 | }
|
---|
96 |
|
---|
97 | #endif
|
---|