00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GLFRUSTRUM_H
00019 #define GLFRUSTRUM_H
00020
00021 #include <vector>
00022 #include "glgeometricobject.h"
00023 #include "gllocalcoordinatesystem.h"
00024 #include "glplane.h"
00025 #include "glsphere.h"
00026
00031 namespace GLScene
00032 {
00033
00034 class GLFrustrum : public GLGeometricObject,
00035 public GLLocalCoordinateSystem,
00036 public GLSurfaceGenerator
00037 {
00038 static char surfaceSide;
00039 static GLSurface surfaces[6];
00040
00041 GLfloat depth;
00042 GLfloat left, right;
00043 GLfloat top, bottom;
00044 GLfloat znear;
00045
00046 public:
00047 GLFrustrum();
00048 ~GLFrustrum();
00049
00050 SML_TAG(frustrum);
00051
00052
00053
00054
00055
00056
00057 virtual bool intersection( GLGeometricObject* obj ) { return obj->intersection(this); };
00058 virtual bool intersection( GLSphere* sp );
00059
00060 virtual bool inclusion( GLGeometricObject* ) { return false;};
00061
00063 void getVertecies(const GLfloat u, const GLuint nOfV, GLfloat* const verts3) const;
00065 void getNormals(const GLfloat u, const GLuint nOfN, GLfloat* const normals3) const;
00066
00067 inline GLfloat getLeft() { return left; };
00068 inline GLfloat getRight() { return right; };
00069 inline GLfloat getTop() { return top; };
00070 inline GLfloat getBottom() { return bottom; };
00071 inline GLfloat getDepth() { return depth; };
00072 inline GLfloat getZNear() { return znear; };
00073
00074 void setLeft(GLfloat);
00075 void setRight(GLfloat);
00076 void setTop(GLfloat);
00077 void setBottom(GLfloat);
00078 void setDepth(GLfloat);
00079 void setZNear(GLfloat);
00080
00081 GLPlane* const getPlanes();
00082 void compileVertexArray() { };
00083 void render( );
00084 void renderForSelection(GLuint&) { };
00085
00086
00087
00088
00089
00090 };
00091
00092 };
00093
00094 #endif