Rev | Line | |
---|
[420] | 1 | #ifndef __RAYINFO_H__
|
---|
| 2 | #define __RAYINFO_H__
|
---|
| 3 |
|
---|
| 4 | #include <vector>
|
---|
| 5 | using namespace std;
|
---|
| 6 |
|
---|
| 7 | class VssRay;
|
---|
| 8 | class RayInfo;
|
---|
| 9 |
|
---|
| 10 | typedef vector<RayInfo> RayInfoContainer;
|
---|
| 11 | /** Structure holding additional info about
|
---|
| 12 | the ray during traversal.
|
---|
| 13 | */
|
---|
| 14 | class RayInfo
|
---|
| 15 | {
|
---|
| 16 | public:
|
---|
| 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.