source: trunk/VUT/GtpVisibilityPreprocessor/src/RayInfo.h @ 420

Revision 420, 1.4 KB checked in by mattausch, 19 years ago (diff)
Line 
1#ifndef __RAYINFO_H__
2#define __RAYINFO_H__
3
4#include <vector>
5using namespace std;
6
7class VssRay;
8class RayInfo;
9
10typedef vector<RayInfo> RayInfoContainer;
11/** Structure holding additional info about
12        the ray during traversal.
13*/
14class RayInfo
15{
16public:
17        /// pointer to the actual ray
18        VssRay *mRay;
19       
20        // endpoints  - do we need them?
21#if USE_FIXEDPOINT_T
22        short mMinT, mMaxT;
23#else
24        float mMinT, mMaxT;
25#endif
26       
27        RayInfo();
28       
29        RayInfo(VssRay *r);
30       
31        RayInfo(VssRay *r, const float _min, const float _max);
32       
33        RayInfo(VssRay *r, const short _min, const float _max);
34       
35        RayInfo(VssRay *r, const float _min, const short _max);
36               
37        friend bool operator<(const RayInfo &a, const RayInfo &b)
38        {
39                return a.mRay < b.mRay;
40        }
41       
42       
43        float ExtrapOrigin(const int axis) const;
44       
45        float ExtrapTermination(const int axis) const;
46       
47        float GetMinT () const;
48        float GetMaxT () const;
49       
50        void SetMinT (const float t);
51       
52        void SetMaxT (const float t);
53
54        /** Computes intersection of this ray with the axis aligned split plane.
55                @param axis axis of the split plane
56                @param position position of the split plane
57                @param t returns the t value of the ray intersection
58
59                @returns 0 if ray intersects plane, -1 if on back side of plane, 1 if on front side
60        */
61        int ComputeRayIntersection(const int axis, const float position, float &t) const;
62};
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.