/* ray.h -*-C++-*- * by Will Wagner * last updated 20 Sep 1997, 17:33:50 wwagner * * This file contains the Intersection and Ray primitives for POVRay. * * Changes * 11 Aug 1997 * - Added this comment block * * 20 Sep 1997 * - Minor changes. * * Things to do * */ #ifndef __INC_RAY_H__ #define __INC_RAY_H__ #include #include #include "frame.h" #include "vector.h" #include "object.h" class Intersection { private: DBL depth; pov_vector ipoint, inormal; Object *object; int i1, i2; DBL d1, d2; void *pointer; public: Intersection(); Intersection(DBL, pov_vector&, Object *, pov_vector&); Intersection(DBL, pov_vector&, Object *, void *); Intersection(DBL, pov_vector&, Object *, int, DBL = 0.0); Intersection(DBL, pov_vector&, Object *, int, int, DBL = 0.0); Intersection(DBL, pov_vector&, Object *, DBL); ~Intersection(); }; /* We can use a normal STL list and a stack adapter for the IStack. */ typedef stack< list > IStack; /* The following defines control the initial size and overflow * expansion factor of the vector containing member of Ray. The * Ray object will never overflow as before; if you've got the memory * and the time, we've got the code. */ #define INITIAL_CONTAINING_OBJECTS 100 #define CONTAINING_OBJECTS_FACTOR 2 class Ray { private: pov_vector initial, direction; typedef struct ray_containing_struct { Texture *texture; Object *object; DBL ior; } ray_struct; vector containing; static int ray_struct_compare(ray_struct&, Texture *); public: Ray(); Ray(const pov_vector&, const pov_vector&); Ray(const Ray&); ~Ray(); void Enter(Object *, Texture *); void Exit(int); int TextureInRay(Texture *); }; #endif /* __INC_RAY_H__ */