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: PfBasicSimulator.h,v $ 00027 * Date modified: $Date: 2003/07/10 23:59:15 $ 00028 * Version: $Revision: 1.2 $ 00029 * ----------------------------------------------------------------- 00030 * 00031 *************** <auto-copyright.pl END do not edit this line> ***************/ 00032 00033 #ifndef _VRJ_PF_BASIC_SIMULATOR_H_ 00034 #define _VRJ_PF_BASIC_SIMULATOR_H_ 00035 00036 #include <vrj/vrjConfig.h> 00037 00038 #include <vrj/Draw/Pf/PfSimInterface.h> 00039 00040 #include <gadget/Type/PositionInterface.h> 00041 00042 #include <jccl/Config/ConfigElementPtr.h> 00043 00044 #include <gmtl/Matrix.h> 00045 #include <gmtl/Vec.h> 00046 00047 00048 namespace vrj 00049 { 00054 class PfBasicSimulator : public PfSimInterface 00055 { 00056 public: 00057 PfBasicSimulator(); 00058 00059 virtual ~PfBasicSimulator() {} 00060 00061 /* 00062 * Configure the basic simulator config 00063 * @pre element is a valid configuration element. 00064 * @post It should be configured 00065 */ 00066 virtual bool config(jccl::ConfigElementPtr element); 00067 00068 static std::string getElementType() 00069 { 00070 return std::string("default_simulator"); 00071 } 00072 00073 virtual void initialize(SimViewport* simVp) 00074 { 00075 mSimViewport = simVp; 00076 } 00077 00081 virtual void setEventWindow(gadget::EventWindowInterface ewInterface); 00082 00083 public: 00084 gmtl::Matrix44f getCameraPos() 00085 { return mCameraPos; } 00086 00087 gmtl::Matrix44f getHeadPos() 00088 { return mHeadPos; } 00089 00090 gmtl::Matrix44f getWandPos() 00091 { return mWandPos; } 00092 00093 virtual void updateProjectionData(const float positionScale, 00094 Projection* leftProj, Projection* rightProj); 00095 00097 void updateInternalData(float positionScale); 00098 00099 public: // Sim Drawing parameters 00100 /* 00101 bool shouldDrawProjections() 00102 { return mDrawProjections; } 00103 00104 gmtl::Vec3f getSurfaceColor() 00105 { return mSurfaceColor; } 00106 */ 00107 virtual void updateSimulatorSceneGraph(); 00108 bool configPerformerAPI(jccl::ConfigElementPtr element); 00109 void initSimulatorGraph(); 00110 00111 protected: 00112 SimViewport* mSimViewport; 00113 00114 // Drawing attributes 00115 bool mDrawProjections; 00116 gmtl::Vec3f mSurfaceColor; 00118 gadget::PositionInterface mCamera; 00119 gadget::PositionInterface mWand; 00120 00121 gmtl::Matrix44f mCameraPos; 00122 gmtl::Matrix44f mHeadPos; 00123 gmtl::Matrix44f mWandPos; 00124 00125 pfScene* mRootWithSim; 00129 pfGroup* mSimTree; 00130 pfDCS* mHeadDCS; 00131 pfDCS* mWandDCS; 00132 std::string mHeadModel; 00133 std::string mWandModel; 00135 00136 }; 00137 00138 } 00139 00140 #endif 00141
1.2.14 written by Dimitri van Heesch,
© 1997-2002