#ifndef I_LOG_H
#define I_LOG_H

#include "logentry.h"
#include "log.h"

#ifdef DISABLE_I_LOG
#define ILOG(event, entry)
#else
#define ILOG(event, entry) LOG(I_LOG_ON, event,entry)
#endif

class Int_ObjList_Start_Entry {
public:
  MPObjList *_list; // list of all objs to test
  int _x, _y; // screen space coords of ray intersect
  Vec4 _R, _D;
  
  Int_ObjList_Start_Entry (const Ray &ray, int x, int y, MPObjList *list) : _x (x), _y(y), _list (list), _R (ray.R()), _D (ray.D()) {}
  
};

class Int_ObjList_End_Entry {
public:
  MPObjList *_list;
  int _x, _y;
  
  Int_ObjList_End_Entry (int x, int y, MPObjList *list) : _list (list), _x (x), _y(y) {}
  
};

enum WhyIntAvoided {AlreadyChecked, SentToGL, BboxTFartherThanHit, BboxAxisFartherThanHit};

class Int_Avoided_Entry {
public:
  RayCastable *_obj;
  WhyIntAvoided _why; // why was this obj avoided
  
  Int_Avoided_Entry (RayCastable *obj, WhyIntAvoided why) : _obj (obj), _why (why) {}
  
};

class Int_Obj_Entry {
public:
  RayCastable *_obj;
  int _bbox_used; // was it tested agst the bb of the object
  int _ray_hit_bbox; // did it hit the bb
  int _ray_hit_obj; // did it hit the obj
  int _obj_is_nearest; // is this the closest obj so far
  int _was_axis_checked; //did we do an axis check (and fail?)
  int _did_check_t; //did we compare the obj's bbox T val to the current intersection t?
  
  Int_Obj_Entry (RayCastable *obj, int bboxused, int rayhitbbox, int rayhitobj, int objisnearest, int wasaxischecked, int didcheckt) : _obj (obj), _bbox_used (bboxused), _ray_hit_bbox (rayhitbbox), _ray_hit_obj (rayhitobj), _obj_is_nearest (objisnearest), _was_axis_checked (wasaxischecked), _did_check_t (didcheckt) {}
  
};


#endif
