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

camera_c.cpp

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2003 Koblenz University
00006    $Id: camera_c.cpp,v 1.5 2004/03/22 11:01:03 rollmark Exp $
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; version 2 of the License.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; if not, write to the Free Software
00019    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 */
00021 
00022 #include "camera.h"
00023 
00024 using namespace boost;
00025 using namespace oxygen;
00026 using namespace zeitgeist;
00027 
00028 FUNCTION(Camera,setViewport)
00029 {
00030     int inX;
00031     int inY;
00032     int inWidth;
00033     int inHeight;
00034 
00035     if (
00036         (in.GetSize() != 4) ||
00037         (! in.GetValue(in[0],inX)) ||
00038         (! in.GetValue(in[1],inY)) ||
00039         (! in.GetValue(in[2],inWidth)) ||
00040         (! in.GetValue(in[3],inHeight))
00041         )
00042         {
00043             return false;
00044         }
00045 
00046     obj->SetViewport(inX,inY,inWidth,inHeight);
00047     return true;
00048 }
00049 
00050 FUNCTION(Camera,getViewportX)
00051 {
00052     return obj->GetViewportX();
00053 }
00054 
00055 FUNCTION(Camera,getViewportY)
00056 {
00057     return obj->GetViewportY();
00058 }
00059 
00060 FUNCTION(Camera,getViewportWidth)
00061 {
00062     return obj->GetViewportWidth();
00063 }
00064 
00065 FUNCTION(Camera,getViewportHeight)
00066 {
00067     return obj->GetViewportHeight();
00068 }
00069 
00070 FUNCTION(Camera,setFOV)
00071 {
00072     float inFov;
00073 
00074     if (
00075         (in.GetSize() != 1) ||
00076         (! in.GetValue(in.begin(), inFov))
00077         )
00078         {
00079             return false;
00080         }
00081 
00082     obj->SetFOV(inFov);
00083     return true;
00084 }
00085 
00086 FUNCTION(Camera,getFOV)
00087 {
00088     return obj->GetFOV();
00089 }
00090 
00091 FUNCTION(Camera,setZNear)
00092 {
00093     float inZNear;
00094 
00095     if (
00096         (in.GetSize() != 1) ||
00097         (! in.GetValue(in.begin(), inZNear))
00098         )
00099         {
00100             return false;
00101         }
00102 
00103     obj->SetZNear(inZNear);
00104     return true;
00105 }
00106 
00107 FUNCTION(Camera,adjustZNear)
00108 {
00109     float inZNear;
00110 
00111     if (
00112         (in.GetSize() != 1) ||
00113         (! in.GetValue(in.begin(), inZNear))
00114         )
00115         {
00116             return false;
00117         }
00118 
00119     obj->AdjustZNear(inZNear);
00120     return true;
00121 }
00122 
00123 FUNCTION(Camera,getZNear)
00124 {
00125     return obj->GetZNear();
00126 }
00127 
00128 FUNCTION(Camera,setZFar)
00129 {
00130     float inZFar;
00131 
00132     if (
00133         (in.GetSize() != 1) ||
00134         (! in.GetValue(in.begin(), inZFar))
00135         )
00136         {
00137             return false;
00138         }
00139 
00140     obj->SetZFar(inZFar);
00141     return true;
00142 }
00143 
00144 FUNCTION(Camera,adjustZFar)
00145 {
00146     float inZFar;
00147 
00148     if (
00149         (in.GetSize() != 1) ||
00150         (! in.GetValue(in.begin(), inZFar))
00151         )
00152         {
00153             return false;
00154         }
00155 
00156     obj->AdjustZFar(inZFar);
00157     return true;
00158 }
00159 
00160 FUNCTION(Camera,getZFar)
00161 {
00162     return obj->GetZFar();
00163 }
00164 
00165 void CLASS(Camera)::DefineClass()
00166 {
00167     DEFINE_BASECLASS(oxygen/BaseNode);
00168     DEFINE_FUNCTION(setViewport);
00169     DEFINE_FUNCTION(getViewportX);
00170     DEFINE_FUNCTION(getViewportY);
00171     DEFINE_FUNCTION(getViewportWidth);
00172     DEFINE_FUNCTION(getViewportHeight);
00173     DEFINE_FUNCTION(setFOV);
00174     DEFINE_FUNCTION(getFOV);
00175     DEFINE_FUNCTION(setZNear);
00176     DEFINE_FUNCTION(adjustZNear);
00177     DEFINE_FUNCTION(getZNear);
00178     DEFINE_FUNCTION(setZFar);
00179     DEFINE_FUNCTION(adjustZFar);
00180     DEFINE_FUNCTION(getZFar);
00181 }

Generated on Thu Apr 6 15:25:37 2006 for rcssserver3d by  doxygen 1.4.4