#ifndef __RAYINFO_H__ #define __RAYINFO_H__ #include using namespace std; class VssRay; class RayInfo; typedef vector RayInfoContainer; /** Structure holding additional info about the ray during traversal. */ class RayInfo { public: /// pointer to the actual ray VssRay *mRay; // endpoints - do we need them? #if USE_FIXEDPOINT_T short mMinT, mMaxT; #else float mMinT, mMaxT; #endif RayInfo(); RayInfo(VssRay *r); RayInfo(VssRay *r, const float _min, const float _max); RayInfo(VssRay *r, const short _min, const float _max); RayInfo(VssRay *r, const float _min, const short _max); friend bool operator<(const RayInfo &a, const RayInfo &b) { return a.mRay < b.mRay; } float ExtrapOrigin(const int axis) const; float ExtrapTermination(const int axis) const; float GetMinT () const; float GetMaxT () const; void SetMinT (const float t); void SetMaxT (const float t); /** Computes intersection of this ray with the axis aligned split plane. @param axis axis of the split plane @param position position of the split plane @param t returns the t value of the ray intersection @returns 0 if ray intersects plane, -1 if on back side of plane, 1 if on front side */ int ComputeRayIntersection(const int axis, const float position, float &t) const; }; #endif