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