My Project
rayGroup.h
1 #ifndef GROUP_INCLUDED
2 #define GROUP_INCLUDED
3 #include <Util/geometry.h>
4 #include "rayShape.h"
5 #include "rayScene.h"
6 
7 
8 
11 public:
13  float t;
16 
21  static int Compare(const void* v1,const void* v2);
22 };
23 
24 
26 class RayGroup : public RayShape{
27 public:
29  int sNum;
33  class RayShapeHit* hits;
34 
35  RayGroup(void);
36  ~RayGroup(void);
37 
39  void addShape(RayShape* shape);
41  int shapeNum(void);
42 
43  void write(int indent,FILE* fp=stdout);
44 
46  virtual void writeBegin(int indent,FILE* fp=stdout)=0;
48  virtual void writeEnd(int indent, FILE* fp=stdout)=0;
49 
51  virtual Matrix4D getMatrix(void)=0;
53  virtual Matrix4D getInverseMatrix(void)=0;
55  virtual Matrix4D getNormalMatrix(void)=0;
56 
57  BoundingBox3D setBoundingBox(void);
58 
59  double intersect(Ray3D ray,struct RayIntersectionInfo& iInfo,double mx=-1);
60 
62  // OpenGL stuff //
64  void setUpOpenGL(int cplx);
65 
66  int drawOpenGL(int materialIndex);
67 };
68 
70 class StaticRayGroup : public RayGroup{
72  Matrix4D inverseTransform;
74  Matrix4D normalTransform;
75 public:
78 
79  StaticRayGroup(void);
80 
82  int set(Matrix4D xForm);
84  int read(FILE* fp);
85 
87  int set(void);
88 
89  Matrix4D getMatrix(void);
90  Matrix4D getInverseMatrix(void);
91  Matrix4D getNormalMatrix(void);
92  void writeBegin(int indent,FILE* fp=stdout);
93  void writeEnd(int indent,FILE* fp=stdout);
94 
96  // OpenGL stuff //
98 
100  int isStatic(void);
101 };
102 
105 public:
106  char pName[100];
107  virtual Matrix4D getMatrix(void)=0;
108  Matrix4D getInverseMatrix(void);
109  Matrix4D getNormalMatrix(void);
110 
112  void writeBegin(int indent,FILE* fp=stdout);
114  void writeEnd(int indent,FILE* fp=stdout);
115 
117  // OpenGL stuff //
119 
120  int isStatic(void);
121 };
122 
125 public:
126  const Matrix4D* value;
127  Matrix4D getMatrix(void);
128 };
132 public:
134  Matrix4D getMatrix(void);
135 };
140 public:
141  RotationAndTranslation* value;
142  Matrix4D getMatrix(void);
143 };
148 public:
150  Matrix4D getMatrix(void);
151 };
156 public:
158  Matrix4D getMatrix(void);
159 };
160 
161 
162 #endif // GROUP_INCLUDED
Definition: geometry.h:597
Definition: rayGroup.h:104
RayShape ** shapes
Definition: rayGroup.h:31
Definition: geometry.h:562
Definition: geometry.h:421
static int Compare(const void *v1, const void *v2)
Definition: rayGroup.cpp:10
Definition: geometry.h:525
Definition: rayGroup.h:10
Definition: rayScene.h:16
Definition: rayGroup.h:26
Definition: rayGroup.h:70
float t
Definition: rayGroup.h:13
Definition: geometry.h:182
int sNum
Definition: rayGroup.h:29
Definition: geometry.h:312
Definition: rayGroup.h:131
Matrix4D localTransform
Definition: rayGroup.h:77
Definition: rayShape.h:9
Definition: rayGroup.h:124
RayShape * shape
Definition: rayGroup.h:15
class RayShapeHit * hits
Definition: rayGroup.h:33
Definition: geometry.h:634
Definition: rayGroup.h:155