Open PaperOpt
OpenPaperOpt/RayTag.h
Go to the documentation of this file.
00001 #ifndef RAYTAG_H
00002 #define RAYTAG_H
00003 
00004 #include <float.h>
00005 
00006 
00007 #define FLT_QNAN   0xffc00000
00008 
00009 namespace p3d{
00010 
00011         class RayTag {
00012 
00013         public:
00014 
00015                 RayTag()        {Reset();}
00016 
00017                 void Reset()    {rayNo=0;SetNohit();}
00018                 void SetNohit() {*(int*)&t=FLT_QNAN;}
00019                 int  IsNoHit()  {return _isnan(t);}
00020 
00021                 int   rayNo;
00022                 float t;     //nan->NoHit
00023         };
00024 }
00025 #endif