Viewpoint.h

Go to the documentation of this file.
00001 
00002 //    Copyright 2004, SenseGraphics AB
00003 //
00004 //    This file is part of H3D API.
00005 //
00006 //    H3D API is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    H3D API is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with H3D API; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 //
00020 //    A commercial license is also available. Please contact us at 
00021 //    www.sensegraphics.com for more information.
00022 //
00023 //
00027 //
00029 #ifndef __VIEWPOINT_H__
00030 #define __VIEWPOINT_H__
00031 
00032 #include "X3DBindableNode.h"
00033 #include "FieldTemplates.h"
00034 #include "Exception.h"
00035 #include "SFVec3f.h"
00036 #include "SFString.h"
00037 #include "SFFloat.h"
00038 #include "SFRotation.h"
00039 #include "SFMatrix4f.h"
00040 
00041 namespace H3D {
00226   class H3DAPI_API Viewpoint : public X3DBindableNode {
00227   public:
00229     Viewpoint( 
00230               Inst< SFSetBind >  _set_bind         = 0,
00231               Inst< SFVec3f   >  _centerOfRotation = 0,
00232               Inst< SFString  >  _description      = 0,
00233               Inst< SFFloat   >  _fieldOfView      = 0,
00234               Inst< SFBool    >  _jump             = 0,
00235               Inst< SFNode    >  _metadata         = 0,
00236               Inst< SFRotation>  _orientation      = 0,
00237               Inst< SFVec3f   >  _position         = 0,
00238               Inst< SFTime    >  _bindTime         = 0,
00239               Inst< SFBool    >  _isBound          = 0,
00240               Inst< SFMatrix4f > _accForwardMatrix = 0,
00241               Inst< SFMatrix4f > _accInverseMatrix = 0 );
00242 
00243     #ifdef USE_HAPTICS
00247     virtual void traverseSG( TraverseInfo &ti ) {
00248       accInverseMatrix->setValue( ti.getAccInverseMatrix(), id );
00249       accForwardMatrix->setValue( ti.getAccForwardMatrix(), id );
00250     }
00251                 #endif
00252 
00254     static inline Viewpoint *getActive() {
00255       return static_cast< Viewpoint * >( X3DBindableNode::getActive( "Viewpoint" ) );
00256     }
00257 
00263     auto_ptr< SFVec3f    > centerOfRotation;
00264 
00270     auto_ptr< SFString   > description;
00271 
00279     auto_ptr< SFFloat    > fieldOfView;
00280 
00287     auto_ptr< SFBool     > jump;
00288 
00296     auto_ptr< SFRotation > orientation;
00297     
00302     auto_ptr< SFVec3f    > position;
00303 
00307     auto_ptr< SFMatrix4f > accForwardMatrix;
00308 
00313     auto_ptr< SFMatrix4f > accInverseMatrix;
00314     
00315     static H3DNodeDatabase database;
00316   };
00317 }
00318 
00319 #endif

Generated on Thu Aug 24 12:38:35 2006 for H3D API by  doxygen 1.4.5