Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Frustum.h

Go to the documentation of this file.
00001 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00002  *
00003  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Christopher Just,
00007  *   Patrick Hartling, Kevin Meinert,
00008  *   Carolina Cruz-Neira, Albert Baker
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Library General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Library General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Library General Public
00021  * License along with this library; if not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023  * Boston, MA 02111-1307, USA.
00024  *
00025  * -----------------------------------------------------------------
00026  * File:          $RCSfile: Frustum.h,v $
00027  * Date modified: $Date: 2003/03/06 17:11:07 $
00028  * Version:       $Revision: 1.19 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _VRJ_FRUSTUM_H_
00034 #define _VRJ_FRUSTUM_H_
00035 
00036 #include <vrj/vrjConfig.h>
00037 
00038 #include <iostream>
00039 
00040 
00041 namespace vrj
00042 {
00043 
00049 class VJ_CLASS_API Frustum
00050 {
00051 public:
00052    enum entry
00053    {VJ_LEFT = 0, VJ_RIGHT = 1, VJ_BOTTOM, VJ_TOP, VJ_NEAR, VJ_FAR};
00054 
00055    Frustum()
00056    {
00057       frust[0] = frust[1] = frust[2] = 0.0f;
00058       frust[3] = frust[4] = frust[5] = 0.0f;
00059    }
00060 
00061    void setBottomLeftTopRight(float bot_val, float left_val, float top_val, float right_val)
00062    {
00063       frust[VJ_BOTTOM] = bot_val;
00064       frust[VJ_LEFT] = left_val;
00065       frust[VJ_TOP] = top_val;
00066       frust[VJ_RIGHT] = right_val;
00067    }
00068 
00069    void setNearFar(float near_val, float far_val)
00070    {
00071       frust[VJ_NEAR] = near_val;
00072       frust[VJ_FAR] = far_val;
00073    }
00074 
00075    void set(float left_val, float right_val, float bottom_val, float top_val, float near_val, float far_val)
00076    {
00077       frust[VJ_LEFT] = left_val;
00078       frust[VJ_RIGHT] = right_val;
00079       frust[VJ_BOTTOM] = bottom_val;
00080       frust[VJ_TOP] = top_val;
00081       frust[VJ_NEAR] = near_val;
00082       frust[VJ_FAR] = far_val;
00083    }
00084 
00085    float& operator[](int elt)
00086    {
00087       return frust[elt];
00088    }
00089 
00090 public:
00091    float frust[6];  
00092 };
00093 
00094 // ---- FRIEND FUNCTIONS ---- //
00095 std::ostream& operator<<(std::ostream& out, Frustum& _frust);
00096 
00097 }
00098 
00099 #endif

Generated on Sun May 2 15:10:16 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002