Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 337


Ignore:
Timestamp:
Nov 28, 2007, 6:13:04 PM (16 years ago)
Author:
bknecht
Message:

merged merger to FICN branch

Location:
code/branches/FICN
Files:
6 edited
161 copied

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/CMakeLists.txt

    r142 r337  
    55#Create some verbose output
    66SET(CMAKE_VERBOSE_MAKEFILE TRUE)
     7
     8# set eNet search path
     9SET(Boost_INCLUDE_DIR "/usr/include/boost/")
    710
    811#force-set the compile on tardis machines, as default points to g++-3.3
     
    2326        MESSAGE("ERROR: uname terminated unclean.")
    2427  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
    25   # check wheter we are on a tardis machine
     28# check wheter we are on a tardis INCLUDEmachine
    2629  IF ("${UNAME_OV}" MATCHES "tardis")
    2730    SET (IS_TARDIS "tardis")
     
    2932  # if on tardis change compiler
    3033  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")
    3338  ENDIF(IS_TARDIS)
    3439ENDIF (UNIX)
     
    3742#This sets where to look for "Find*.cmake" files
    3843SET(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
    3947#Performs the search and sets the variables
    4048FIND_PACKAGE(OGRE)
     
    4250FIND_PACKAGE(CEGUI)
    4351FIND_PACKAGE(CEGUI_OGRE)
     52FIND_PACKAGE(ENet)
     53FIND_PACKAGE(Boost)
    4454
    4555#Sets the search paths for the linking
    46 LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR})
     56LINK_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
    4758#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})
     59INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
     60
    5061
    5162#add main source dir
    5263ADD_SUBDIRECTORY(src)
    5364
    54 
  • code/branches/FICN/INSTALL

    r148 r337  
    55ois-1.0
    66cegui-0.5.0b
    7 enet-1.0
    8 
    9 cmake (used version 2.4.7)
     7enet-1.1
     8boost-1.34.1
     9cmake-2.4.7
     10(all named version were tested. lower version requirement may be possible)
    1011
    1112
  • code/branches/FICN/bin/resources.cfg

    r135 r337  
    99FileSystem=../Media/fonts
    1010#FileSystem=../Media/materials/programs
    11 #FileSystem=../Media/materials/scripts
    12 #FileSystem=../Media/materials/textures
    13 #FileSystem=../Media/models
    14 #FileSystem=../Media/overlays
     11FileSystem=../Media/materials/scripts
     12FileSystem=../Media/materials/textures
     13FileSystem=../Media/models
     14FileSystem=../Media/overlay
    1515#FileSystem=../Media/particle
    1616FileSystem=../Media/gui
    17 #FileSystem=../Media/DeferredShadingMedia
    18 #Zip=../Media/packs/cubemap.zip
     17Zip=../Media/packs/cubemap.zip
    1918#Zip=../Media/packs/cubemapsJS.zip
    2019#Zip=../Media/packs/dragon.zip
     
    2221#Zip=../Media/packs/ogretestmap.zip
    2322Zip=../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  
    11PROJECT(Orxonox)
    22
    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)
     3ADD_SUBDIRECTORY(orxonox)
     4ADD_SUBDIRECTORY(loader)
     5ADD_SUBDIRECTORY(network)
     6ADD_SUBDIRECTORY(class_hierarchy)
    67
    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__
    33
    44namespace orxonox
  • code/branches/FICN/src/orxonox/orxonox.cc

    r265 r337  
    3939#include <iostream>
    4040
    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"
     45SpaceshipSteering* steering;
    4346
    4447
     
    7679namespace orxonox
    7780{
    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
     82using namespace Ogre;
     83
     84class 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
    95175
    96176  class OrxApplication
     
    174254      {
    175255        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()");
    177257      }
    178258
     
    184264      void initializeResourceGroups()
    185265      {
    186         Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    187         Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     266        TextureManager::getSingleton().setDefaultNumMipmaps(5);
     267        ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    188268      }
    189269
     
    191271      {
    192272
    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
    203314
    204315      void setupInputSystem()
     
    217328        {
    218329          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));
    220331        }
    221332        catch (const OIS::Exception &e)
     
    237348      }
    238349
    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    }
    245356      void startRenderLoop()
    246357      {
Note: See TracChangeset for help on using the changeset viewer.