Changeset 337 for code/branches/FICN
- Timestamp:
- Nov 28, 2007, 6:13:04 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 6 edited
- 161 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/CMakeLists.txt
r142 r337 5 5 #Create some verbose output 6 6 SET(CMAKE_VERBOSE_MAKEFILE TRUE) 7 8 # set eNet search path 9 SET(Boost_INCLUDE_DIR "/usr/include/boost/") 7 10 8 11 #force-set the compile on tardis machines, as default points to g++-3.3 … … 23 26 MESSAGE("ERROR: uname terminated unclean.") 24 27 ENDIF (NOT "${UNAME_RV}" STREQUAL "0") 25 # check wheter we are on a tardismachine28 # check wheter we are on a tardis INCLUDEmachine 26 29 IF ("${UNAME_OV}" MATCHES "tardis") 27 30 SET (IS_TARDIS "tardis") … … 29 32 # if on tardis change compiler 30 33 IF (IS_TARDIS) 31 MESSAGE("System is a TARDIS: Setting Compiler to g++-3.4.3") 32 SET(CMAKE_CXX_COMPILER "g++-3.4.3") 34 MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1") 35 SET(CMAKE_CXX_COMPILER "g++-4.1.1") 36 # reset eNet serach path 37 SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1") 33 38 ENDIF(IS_TARDIS) 34 39 ENDIF (UNIX) … … 37 42 #This sets where to look for "Find*.cmake" files 38 43 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 44 # SET(BOOST_LIBDIR /usr/pack/boost-1.33.1-mo/i686-debian-linux3.1/lib/) 45 # SET(BOOST_INCDIR /usr/pack/boost-1.33.1-mo/i686-debian-linux3.1/include/) 46 39 47 #Performs the search and sets the variables 40 48 FIND_PACKAGE(OGRE) … … 42 50 FIND_PACKAGE(CEGUI) 43 51 FIND_PACKAGE(CEGUI_OGRE) 52 FIND_PACKAGE(ENet) 53 FIND_PACKAGE(Boost) 44 54 45 55 #Sets the search paths for the linking 46 LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR}) 56 LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${Boost_LIBRARY_DIRS} core objects loader network weapon classHierarchy) 57 47 58 #Sets the search path for include files 48 #INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} -I/usr/include/enet)49 INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR}) 59 INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) 60 50 61 51 62 #add main source dir 52 63 ADD_SUBDIRECTORY(src) 53 64 54 -
code/branches/FICN/INSTALL
r148 r337 5 5 ois-1.0 6 6 cegui-0.5.0b 7 enet-1.0 8 9 cmake (used version 2.4.7) 7 enet-1.1 8 boost-1.34.1 9 cmake-2.4.7 10 (all named version were tested. lower version requirement may be possible) 10 11 11 12 -
code/branches/FICN/bin/resources.cfg
r135 r337 9 9 FileSystem=../Media/fonts 10 10 #FileSystem=../Media/materials/programs 11 #FileSystem=../Media/materials/scripts12 #FileSystem=../Media/materials/textures13 #FileSystem=../Media/models14 #FileSystem=../Media/overlays 11 FileSystem=../Media/materials/scripts 12 FileSystem=../Media/materials/textures 13 FileSystem=../Media/models 14 FileSystem=../Media/overlay 15 15 #FileSystem=../Media/particle 16 16 FileSystem=../Media/gui 17 #FileSystem=../Media/DeferredShadingMedia 18 #Zip=../Media/packs/cubemap.zip 17 Zip=../Media/packs/cubemap.zip 19 18 #Zip=../Media/packs/cubemapsJS.zip 20 19 #Zip=../Media/packs/dragon.zip … … 22 21 #Zip=../Media/packs/ogretestmap.zip 23 22 Zip=../Media/packs/skybox.zip 23 24 # # Resource locations to be added to the 'boostrap' path 25 # # This also contains the minimum you need to use the Ogre example framework 26 # [Bootstrap] 27 # Zip=../Media/packs/OgreCore.zip 28 # 29 # # Resource locations to be added to the default path 30 # [General] 31 # FileSystem=../Media 32 # FileSystem=../Media/fonts 33 # FileSystem=../Media/materials/programs 34 # FileSystem=../Media/materials/scripts 35 # FileSystem=../Media/materials/textures 36 # FileSystem=../Media/models 37 # FileSystem=../Media/overlays 38 # FileSystem=../Media/particle 39 # FileSystem=../Media/gui 40 # FileSystem=../Media/DeferredShading../Media 41 # Zip=../Media/packs/cubemap.zip 42 # Zip=../Media/packs/cubemapsJS.zip 43 # Zip=../Media/packs/dragon.zip 44 # Zip=../Media/packs/fresneldemo.zip 45 # Zip=../Media/packs/ogretestmap.zip 46 # Zip=../Media/packs/skybox.zip -
code/branches/FICN/src/CMakeLists.txt
r258 r337 1 1 PROJECT(Orxonox) 2 2 3 # create a few variables to simplify life 4 SET(SRC_FILES orxonox/orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc orxonox/core/IdentifierList.cc orxonox/core/Identifier.cc orxonox/core/MetaObjectList.cc orxonox/core/Factory.cc orxonox/core/OrxonoxClass.cc orxonox/objects/BaseObject.cc orxonox/objects/test1.cc orxonox/objects/test2.cc orxonox/objects/test3.cc) 5 SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h orxonox/core/IdentifierIncludes.h orxonox/core/Identifier.h orxonox/core/Factory.h orxonox/core/ClassFactory.h orxonox/core/IdentifierList.h orxonox/core/ObjectList.h orxonox/core/MetaObjectList.h orxonox/core/Iterator.h orxonox/core/OrxonoxClass.h orxonox/objects/BaseObject.h orxonox/objects/Test.h orxonox/objects/test1.h orxonox/objects/test2.h orxonox/objects/test3.h) 3 ADD_SUBDIRECTORY(orxonox) 4 ADD_SUBDIRECTORY(loader) 5 ADD_SUBDIRECTORY(network) 6 ADD_SUBDIRECTORY(class_hierarchy) 6 7 7 #Creates an executable 8 ADD_EXECUTABLE(../bin/main ${SRC_FILES} ${INC_FILES}) 9 #Links the executable against OGRE and OIS 10 TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES}) 11 8 # ======= 9 # PROJECT(Orxonox) 10 # 11 # # create a few variables to simplify life 12 # 13 # SET(SRC_FILES orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc spaceship_steering.cc) 14 # SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h spaceship_steering.h ) 15 # 16 # #Creates an executable 17 # ADD_EXECUTABLE(../bin/main ${SRC_FILES} ${INC_FILES}) 18 # #Links the executable against OGRE and OIS 19 # TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES}) 20 # 21 # >>>>>>> .merge-right.r318 -
code/branches/FICN/src/orxonox/core/Iterator.h
r258 r337 1 #ifndef _Iterator_H __2 #define _Iterator_H __1 #ifndef _Iterator_H2__ 2 #define _Iterator_H2__ 3 3 4 4 namespace orxonox -
code/branches/FICN/src/orxonox/orxonox.cc
r265 r337 39 39 #include <iostream> 40 40 41 #include "../xml/xmlParser.h" 42 #include "../loader/LevelLoader.h" 41 #include "xml/xmlParser.h" 42 #include "loader/LevelLoader.h" 43 44 #include "spaceship_steering.h" 45 SpaceshipSteering* steering; 43 46 44 47 … … 76 79 namespace orxonox 77 80 { 78 class OrxExitListener : public Ogre::FrameListener 79 { 80 public: 81 OrxExitListener(OIS::Keyboard *keyboard) 82 : mKeyboard(keyboard) 83 { 84 } 85 86 bool frameStarted(const Ogre::FrameEvent& evt) 87 { 88 mKeyboard->capture(); 89 return !mKeyboard->isKeyDown(OIS::KC_ESCAPE); 90 } 91 92 private: 93 OIS::Keyboard *mKeyboard; 94 }; 81 82 using namespace Ogre; 83 84 class OrxExitListener : public FrameListener, public OIS::MouseListener 85 { 86 public: 87 OrxExitListener(OIS::Keyboard *keyboard, OIS::Mouse *mouse) 88 : mKeyboard(keyboard), mMouse(mouse) 89 { 90 speed = 250; 91 loop = 100; 92 rotate = 10; 93 mouseX = 0; 94 mouseY = 0; 95 maxMouseX = 0; 96 minMouseX = 0; 97 moved = false; 98 steering->brakeRotate(rotate*10); 99 steering->brakeLoop(loop); 100 mMouse->setEventCallback(this); 101 } 102 bool frameStarted(const FrameEvent& evt) 103 { 104 mKeyboard->capture(); 105 mMouse->capture(); 106 if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W)) 107 steering->moveForward(speed); 108 else 109 steering->moveForward(0); 110 if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S)) 111 steering->brakeForward(speed); 112 else 113 steering->brakeForward(speed/10); 114 if (mKeyboard->isKeyDown(OIS::KC_RIGHT) || mKeyboard->isKeyDown(OIS::KC_D)) 115 steering->loopRight(loop); 116 else 117 steering->loopRight(0); 118 if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A)) 119 steering->loopLeft(loop); 120 else 121 steering->loopLeft(0); 122 123 if(moved) { 124 if (mouseY<0) 125 steering->rotateUp(-mouseY*rotate); 126 if (mouseY>0) 127 steering->rotateDown(mouseY*rotate); 128 if (mouseX>0) 129 steering->rotateRight(mouseX*rotate); 130 if (mouseX<0) 131 steering->rotateLeft(-mouseX*rotate); 132 moved = false; 133 } 134 else { 135 steering->rotateUp(0); 136 steering->rotateDown(0); 137 steering->rotateRight(0); 138 steering->rotateLeft(0); 139 } 140 141 steering->tick(evt.timeSinceLastFrame); 142 // scenemanager->spacehip->tick(evt.timesincelastframe); 143 if(mKeyboard->isKeyDown(OIS::KC_ESCAPE)) 144 cout << "maximal MouseX: " << maxMouseX << "\tminMouseX: " << minMouseX << endl; 145 return !mKeyboard->isKeyDown(OIS::KC_ESCAPE); 146 } 147 148 bool mouseMoved(const OIS::MouseEvent &e) 149 { 150 mouseX = e.state.X.rel; 151 mouseY = e.state.Y.rel; 152 if(mouseX>maxMouseX) maxMouseX = mouseX; 153 if(mouseX<minMouseX) minMouseX = mouseX; 154 cout << "mouseX: " << mouseX << "\tmouseY: " << mouseY << endl; 155 moved = true; 156 return true; 157 } 158 159 bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; } 160 bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; } 161 162 private: 163 float speed; 164 float rotate; 165 float loop; 166 float mouseY; 167 float mouseX; 168 float maxMouseX; 169 float minMouseX; 170 bool moved; 171 OIS::Keyboard *mKeyboard; 172 OIS::Mouse *mMouse; 173 }; 174 95 175 96 176 class OrxApplication … … 174 254 { 175 255 if (!mRoot->restoreConfig() && !mRoot->showConfigDialog()) 176 throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");256 throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()"); 177 257 } 178 258 … … 184 264 void initializeResourceGroups() 185 265 { 186 Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);187 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();266 TextureManager::getSingleton().setDefaultNumMipmaps(5); 267 ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 188 268 } 189 269 … … 191 271 { 192 272 193 string levelFile = "sp_level_moonstation.oxw"; 194 loader::LevelLoader* loader = new loader::LevelLoader(levelFile); 195 } 196 197 void setupScene() 198 { 199 Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager"); 200 Ogre::Camera *cam = mgr->createCamera("Camera"); 201 Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam); 202 } 273 string levelFile = "sp_level_moonstation.oxw"; 274 loader::LevelLoader* loader = new loader::LevelLoader(levelFile); 275 } 276 277 void setupScene() 278 { 279 SceneManager *mgr = mRoot->createSceneManager(ST_GENERIC, "Default SceneManager"); 280 Camera *cam = mgr->createCamera("Camera"); 281 cam->setPosition(Vector3(0,0,-250)); 282 cam->lookAt(Vector3(0,0,0)); 283 Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam); 284 285 286 mgr->setAmbientLight(ColourValue(1,1,1)); 287 Entity* head = mgr->createEntity("head", "ogrehead.mesh"); 288 SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode", Vector3(0,0,0)); 289 node->attachObject(head); 290 node->attachObject(cam); 291 mgr->setSkyBox(true, "Examples/SceneSkyBox2"); 292 293 Entity* head1 = mgr->createEntity("head1", "ogrehead.mesh"); 294 SceneNode *node1 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode1", Vector3(200,0,0)); 295 node1->attachObject(head1); 296 Entity* head2 = mgr->createEntity("head2", "ogrehead.mesh"); 297 SceneNode *node2 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode2", Vector3(200,400,-100)); 298 node2->attachObject(head2); 299 Entity* head3 = mgr->createEntity("head3", "ogrehead.mesh"); 300 SceneNode *node3 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode3", Vector3(0,400,200)); 301 node3->attachObject(head3); 302 Entity* head4 = mgr->createEntity("head4", "ogrehead.mesh"); 303 SceneNode *node4 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode4", Vector3(-400,-200,600)); 304 node4->attachObject(head4); 305 Entity* head5 = mgr->createEntity("head5", "ogrehead.mesh"); 306 SceneNode *node5 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode5", Vector3(0,0,-400)); 307 node5->attachObject(head5); 308 309 steering = new SpaceshipSteering(500, 200, 200, 200); 310 steering->addNode(node); 311 312 } 313 203 314 204 315 void setupInputSystem() … … 217 328 { 218 329 mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false)); 219 mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));330 mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true)); 220 331 } 221 332 catch (const OIS::Exception &e) … … 237 348 } 238 349 239 void createFrameListener() 240 {241 mListener = new OrxExitListener(mKeyboard);242 mRoot->addFrameListener(mListener);243 }244 350 351 void createFrameListener() 352 { 353 mListener = new OrxExitListener(mKeyboard, mMouse); 354 mRoot->addFrameListener(mListener); 355 } 245 356 void startRenderLoop() 246 357 {
Note: See TracChangeset
for help on using the changeset viewer.