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

Revision 437, 2.2 KB checked in by mattausch, 19 years ago (diff)

detected leak in BspTree?
added specialised fast view cell bsp tree called VspBspTree?

Line 
1#ifndef __RAYINFO_H__
2#define __RAYINFO_H__
3
4#include <vector>
5using namespace std;
6
7class VssRay;
8class RayInfo;
9class Plane3;
10class Vector3;
11
12typedef vector<RayInfo> RayInfoContainer;
13/** Structure holding additional info about
14        the ray during traversal.
15*/
16class RayInfo
17{
18public:
19        /// pointer to the actual ray
20        VssRay *mRay;
21       
22        // endpoints  - do we need them?
23#if USE_FIXEDPOINT_T
24        short mMinT, mMaxT;
25#else
26        float mMinT, mMaxT;
27#endif
28       
29        RayInfo();
30       
31        RayInfo(VssRay *r);
32       
33        RayInfo(VssRay *r, const float _min, const float _max);
34       
35        RayInfo(VssRay *r, const short _min, const float _max);
36       
37        RayInfo(VssRay *r, const float _min, const short _max);
38               
39        friend bool operator<(const RayInfo &a, const RayInfo &b)
40        {
41                return a.mRay < b.mRay;
42        }
43       
44        /** Extracts the scalar of the starting point of the ray segment
45                that lies in the axis.
46        */
47        float ExtrapOrigin(const int axis) const;
48        /** Extracts the scalar of the termination point of the ray segment
49                that lies in the axis.
50        */
51        float ExtrapTermination(const int axis) const;
52       
53        /** Extracts the starting point of the ray segment.
54        */
55        Vector3 ExtrapOrigin() const;
56       
57        /** Extracts the end point of the ray segment.
58        */
59        Vector3 ExtrapTermination() const;
60       
61        float GetMinT () const;
62        float GetMaxT () const;
63       
64        void SetMinT (const float t);
65       
66        void SetMaxT (const float t);
67
68        float SegmentLength() const;
69        float SqrSegmentLength() const;
70
71        /** Computes intersection of this ray with the axis aligned split plane.
72       
73                @param axis axis of the split plane
74                @param position scalar position of the split plane for the chosen axis
75                @param t returns the t parameter value of the ray intersection
76
77                @returns 0 if ray intersects plane, -1 if on back side of plane, 1 if on front side
78        */
79        int ComputeRayIntersection(const int axis, const float position, float &t) const;
80
81        /** Computes intersection of this ray with the split plane.
82
83                @param splitPlane the split plane
84                @param t returns the t parameter value of the ray intersection
85
86                @returns 0 if ray intersects plane, -1 if on back side of plane, 1 if on front side
87        */
88        int ComputeRayIntersection(const Plane3 &splitPlane, float &t) const;
89};
90
91#endif
92
Note: See TracBrowser for help on using the repository browser.