Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

glfrustrum.h

00001 /***************************************************************************
00002                           glfrustrum.h  -  description
00003                              -------------------
00004     begin                : Thu Oct 9 2003
00005     copyright            : (C) 2003 by Jacques Gasselin de Richebourg
00006     email                : jacquesgasselin"hotmal.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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; //z axis aligned
00042       GLfloat left, right; // x axis
00043       GLfloat top, bottom; // y axis
00044       GLfloat znear; //y axis angle
00045       
00046    public:
00047       GLFrustrum();
00048       ~GLFrustrum();
00049 
00050       SML_TAG(frustrum);
00051       
00052    /*   virtual GLVector getVectorToFurthestPoint(const GLVector& fromPoint)
00053       { return GLVector(0,0,0); };
00054       virtual GLVector getVectorToNearestPoint(const GLVector& fromPoint)
00055       { return GLVector(0,0,0); }; */
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       void loadFromStream(std::istream&);
00088       void saveToStream(std::ostream&);
00089       */
00090    };
00091 
00092 };
00093 
00094 #endif

Generated on Wed Feb 4 23:11:33 2004 by doxygen 1.3.3