Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4555 in orxonox.OLD


Ignore:
Timestamp:
Jun 8, 2005, 2:17:00 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: small diffs

Location:
orxonox/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/configure.ac

    r4529 r4555  
    1 ########################################################################## 
    2 #   orxonox - the future of 3D-vertical-scrollers                        #
    3 #                                                                        #
    4 #   Copyright (C) 2004 orx                                              #
    5 #                                                                        #
     1##########################################################################
     2#   orxonox - the future of 3D-vertical-scrollers                        #
     3#                                                                        #
     4#   Copyright (C) 2004 orx                                              #
     5#                                                                        #
    66#   This program is free software; you can redistribute it and/or modify #
    77#   it under the terms of the GNU General Public License as published by #
    88#   the Free Software Foundation; either version 2, or (at your option)  #
    9 #   any later version.                                                  #
    10 #                                                                        #
    11 #   ### File Specific:                                                  #
    12 #   main-programmer: Benjamin Grauer                                    #
    13 #   co-programmer: ...                                                  #
    14 #                                                                        #
    15 #   This is the main configuration File of autoconf.                    #
     9#   any later version.                                                  #
     10#                                                                        #
     11#   ### File Specific:                                                  #
     12#   main-programmer: Benjamin Grauer                                    #
     13#   co-programmer: ...                                                  #
     14#                                                                        #
     15#   This is the main configuration File of autoconf.                    #
    1616#   Please edit this file only, if you exactly know what you are doing.  #
    1717#   It is quite fragile, and compiling orxonox on different Platforms    #
     
    5151DEBUG=no
    5252AC_MSG_CHECKING([if DEBUG-mode should be enabled])
    53 AC_ARG_ENABLE([debug], 
    54         AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),
    55         DEBUG=$enableval)
    56 
    57 if test x$DEBUG = xno; then 
    58         echo "no"
    59         echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed."
    60         DEBUG=4
     53AC_ARG_ENABLE([debug],
     54        AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),
     55        DEBUG=$enableval)
     56
     57if test x$DEBUG = xno; then
     58        echo "no"
     59        echo " -> Setting debuglevel to 4. (orxonox is still in Development. It really is needed."
     60        DEBUG=4
    6161elif test x$DEBUG = xyes; then
    62         echo "yes"
    63         echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
    64         DEBUG=4
    65 else       
    66         echo "yes: setting debuglevel to to $DEBUG"
    67 fi
    68         AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
     62        echo "yes"
     63        echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
     64        DEBUG=4
     65else
     66        echo "yes: setting debuglevel to to $DEBUG"
     67fi
     68        AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
    6969
    7070AC_SUBST(DEBUG)
     
    7575MODULAR_DEBUG=yes
    7676AC_MSG_CHECKING([if Modular-DEBUG-mode should be ebabled])
    77 AC_ARG_ENABLE([modular-debug], 
    78         AC_HELP_STRING( [--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]),
    79         MODULAR_DEBUG=$enableval)
    80 
    81 if test x$MODULAR_DEBUG = xno; then 
    82         echo "no"
     77AC_ARG_ENABLE([modular-debug],
     78        AC_HELP_STRING( [--disable-modular-debug], [compiles in modular-debug mode, that logs differently on the many modules of orxonox.]),
     79        MODULAR_DEBUG=$enableval)
     80
     81if test x$MODULAR_DEBUG = xno; then
     82        echo "no"
    8383elif test x$MODULAR_DEBUG = xyes; then
    84         echo "yes"
    85         AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled])
     84        echo "yes"
     85        AC_DEFINE_UNQUOTED(MODULAR_DEBUG, 1, [if Modular-DUBUG mode is enabled])
    8686fi
    8787
     
    9090#--------------#
    9191AC_MSG_CHECKING([if gtk should be enabled])
    92 AC_ARG_WITH([gtk], 
    93         AC_HELP_STRING( [--without-gtk],
    94         [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
    95 if test x$def_gtk = xyes; then 
     92AC_ARG_WITH([gtk],
     93        AC_HELP_STRING( [--without-gtk],
     94        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
     95if test x$def_gtk = xyes; then
    9696  echo "yes"
    97 fi 
    98 if test x$def_gtk = xno; then 
     97fi
     98if test x$def_gtk = xno; then
    9999  echo "no"
    100100fi
     
    104104#------------------#
    105105AC_MSG_CHECKING([if libcURL should be enabled])
    106 AC_ARG_WITH([curl], 
    107         AC_HELP_STRING( [--without-curl],
    108         [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
    109 if test x$def_curl = xyes; then 
     106AC_ARG_WITH([curl],
     107        AC_HELP_STRING( [--without-curl],
     108        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
     109if test x$def_curl = xyes; then
    110110  echo "yes"
    111 fi 
    112 if test x$def_curl = xno; then 
     111fi
     112if test x$def_curl = xno; then
    113113  echo "no"
    114114fi
     
    119119def_sub_projects=no
    120120AC_MSG_CHECKING([if the SubProjects should be built])
    121 AC_ARG_ENABLE([sub-projects], 
    122         AC_HELP_STRING( [--enable-sub-projects],
    123         [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
     121AC_ARG_ENABLE([sub-projects],
     122        AC_HELP_STRING( [--enable-sub-projects],
     123        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
    124124if test x$def_sub_projects = xyes; then
    125125  echo "yes"
    126 fi 
     126fi
    127127if test x$def_sub_projects = xno; then
    128128  echo "no"
     
    135135def_profiling=no
    136136AC_MSG_CHECKING([if Profiling should be enabled])
    137 AC_ARG_ENABLE([profile], 
    138         AC_HELP_STRING( [--enable-profile],
    139         [builds orxonox with profiling support]), [def_profiling=yes])
     137AC_ARG_ENABLE([profile],
     138        AC_HELP_STRING( [--enable-profile],
     139        [builds orxonox with profiling support]), [def_profiling=yes])
    140140if test x$def_profiling = xyes; then
    141141  echo "yes"
    142142  CXXFLAGS="$CXXFLAGS -pg"
    143 fi 
     143fi
    144144if test x$def_profiling = xno; then
    145145  echo "no"
     
    151151def_efence=no
    152152AC_MSG_CHECKING([if efence should be enabled])
    153 AC_ARG_ENABLE([efence], 
    154         AC_HELP_STRING( [--enable-efence],
    155         [builds orxonox with efence support]), [def_efence=yes])
     153AC_ARG_ENABLE([efence],
     154        AC_HELP_STRING( [--enable-efence],
     155        [builds orxonox with efence support]), [def_efence=yes])
    156156if test x$def_efence = xyes; then
    157157  echo "yes"
    158 fi 
     158fi
    159159if test x$def_efence = xno; then
    160160  echo "no"
     
    166166def_documentation=no
    167167AC_MSG_CHECKING([if the Documentation should be build by default])
    168 AC_ARG_ENABLE([documentation], 
    169         AC_HELP_STRING( [--enable-documentation],
    170         [also builds the sDocumentation while make from srcdir]), [def_documentation=yes])
     168AC_ARG_ENABLE([documentation],
     169        AC_HELP_STRING( [--enable-documentation],
     170        [also builds the sDocumentation while make from srcdir]), [def_documentation=yes])
    171171if test x$def_documentation = xyes; then
    172172  echo "yes"
    173 fi 
     173fi
    174174if test x$def_documentation = xno; then
    175175  echo "no"
     
    222222
    223223# checking gl header
    224         #done before loop
     224        #done before loop
    225225
    226226# checking gl header
     
    230230    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
    231231    if test x$FOUND_opengl32 = xyes ; then
    232         LIBS="$LIBS -lopengl32"
     232        LIBS="$LIBS -lopengl32"
    233233    else
    234         echo "------------------"
    235         echo "opengl not found."
    236         echo "please install the opengl package which can be found at http://www.opengl.org"
    237         echo "------------------"
    238         exit -1
     234        echo "------------------"
     235        echo "opengl not found."
     236        echo "please install the opengl package which can be found at http://www.opengl.org"
     237        echo "------------------"
     238        exit -1
    239239    fi
    240240
     
    246246    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
    247247    if test x$FOUND_glu32 = xyes ; then
    248         LIBS="$LIBS -lGLU32"
     248        LIBS="$LIBS -lGLU32"
    249249    else
    250         echo "------------------"
    251         echo "GLU library not found."
    252         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
    253         echo "------------------"
    254         exit -1
     250        echo "------------------"
     251        echo "GLU library not found."
     252        echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
     253        echo "------------------"
     254        exit -1
    255255    fi
    256256
    257257# checking for mingw32
    258258    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
    259     if test x$FOUND_mingw32 = xyes; then 
    260         LIBS="$LIBS -lmingw32"
     259    if test x$FOUND_mingw32 = xyes; then
     260        LIBS="$LIBS -lmingw32"
    261261    fi
    262262# checking for SDL-headers
     
    306306     LIBS="$LIBS -lGL"
    307307   else
    308         echo "------------------"
    309         echo "opengl not found."
    310         echo "please install the opengl package which can be found at http://www.opengl.org"
    311         echo "------------------"
    312         exit -1
     308        echo "------------------"
     309        echo "opengl not found."
     310        echo "please install the opengl package which can be found at http://www.opengl.org"
     311        echo "------------------"
     312        exit -1
    313313   fi
    314314
     
    321321      LIBS="$LIBS -lGLU"
    322322    else
    323         echo "------------------"
    324         echo "GLU library not found."
    325         echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
    326         echo "------------------"
    327         exit -1
    328     fi   
     323        echo "------------------"
     324        echo "GLU library not found."
     325        echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
     326        echo "------------------"
     327        exit -1
     328    fi
    329329
    330330# checking for SDL-headers
     
    339339        echo "------------------"
    340340        echo "SDL library not found."
    341         echo "please install the SDL library, which can be found at http://www.libsdl.org"
     341        echo "please install the SDL library, which can be found at http://www.libsdl.org"
    342342        echo "------------------"
    343343        exit -1
    344      fi   
     344     fi
    345345
    346346
     
    415415        echo "------------------"
    416416        echo "openal library not found."
    417         echo "please install the openal library, which can be found at http://www.openal.org"
     417        echo "please install the openal library, which can be found at http://www.openal.org"
    418418        echo "------------------"
    419419        exit -1
     
    433433        echo "------------------"
    434434        echo "ogg library not found."
    435         echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
     435        echo "please install the ogg library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
    436436        echo "------------------"
    437437        exit -1
     
    448448        echo "------------------"
    449449        echo "vorbis library not found."
    450         echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
     450        echo "please install the vorbis library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
    451451        echo "------------------"
    452452        exit -1
     
    466466        echo "------------------"
    467467        echo "vorbisfile library not found."
    468         echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
     468        echo "please install the vorbisfile library, which can be found at http://www.xiph.org/ogg/vorbis/index.html"
    469469        echo "------------------"
    470470        exit -1
     
    485485        echo "------------------"
    486486        echo "SDL_ttf library not found."
    487         echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
     487        echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
    488488        echo "------------------"
    489489        exit -1
    490      fi   
     490     fi
    491491
    492492
     
    512512# GTK #
    513513#-----#
    514 if test x$def_gtk = xyes; then 
    515         #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
    516         AC_MSG_CHECKING([for gtk2.0])
    517         if `$PKG_CONFIG --exists gtk+-2.0`; then
    518                 echo "yes"
    519                 have_gtk2=yes
    520                 GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
    521                 GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
    522                 AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
    523                 if test $DEBUG -ge 3; then
    524                 echo "cflags: $GTK2_CFLAGS"
    525                 echo "libs: $GTK2_LIBS"
    526                 fi
    527         else
    528                 echo "no"
    529         fi
     514if test x$def_gtk = xyes; then
     515        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     516        AC_MSG_CHECKING([for gtk2.0])
     517        if `$PKG_CONFIG --exists gtk+-2.0`; then
     518                echo "yes"
     519                have_gtk2=yes
     520                GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
     521                GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
     522                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
     523                if test $DEBUG -ge 3; then
     524                echo "cflags: $GTK2_CFLAGS"
     525                echo "libs: $GTK2_LIBS"
     526                fi
     527        else
     528                echo "no"
     529        fi
    530530
    531531fi
     
    537537# libcURL #
    538538#---------#
    539 if test x$def_curl = xyes; then 
     539if test x$def_curl = xyes; then
    540540
    541541 AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"])
     
    563563      LIBS="$LIBS -lefence"
    564564   fi
    565  
     565
    566566fi
    567567
     
    569569 AC_CHECK_LIB([m], [main])
    570570
    571  
     571
    572572# Checks for header files.
    573573AC_HEADER_STDC
     
    586586AC_CONFIG_FILES([Makefile
    587587                 src/Makefile
    588                 src/lib/Makefile
    589                 src/lib/graphics/Makefile
    590                 src/lib/graphics/importer/Makefile
    591                 src/lib/sound/Makefile
    592                 src/lib/event/Makefile
    593                 src/lib/physics/Makefile
    594                 src/lib/particles/Makefile
    595                 src/lib/collision_detection/Makefile
    596                 src/lib/gui/Makefile
     588                src/lib/Makefile
     589                src/lib/graphics/Makefile
     590                src/lib/graphics/importer/Makefile
     591                src/lib/sound/Makefile
     592                src/lib/event/Makefile
     593                src/lib/physics/Makefile
     594                src/lib/particles/Makefile
     595                src/lib/collision_detection/Makefile
     596                src/lib/gui/Makefile
    597597                 src/lib/tinyxml/Makefile
    598                 src/subprojects/Makefile
    599                 src/subprojects/testmain/Makefile
    600                 src/subprojects/importer/Makefile
    601                 src/subprojects/particles/Makefile
    602                 src/subprojects/collision_detection/Makefile
    603                 src/subprojects/gui/Makefile
    604                 ])
     598                src/subprojects/Makefile
     599                src/subprojects/testmain/Makefile
     600                src/subprojects/importer/Makefile
     601                src/subprojects/particles/Makefile
     602                src/subprojects/collision_detection/Makefile
     603                src/subprojects/gui/Makefile
     604                ])
    605605
    606606AC_OUTPUT
  • orxonox/trunk/orxonox.kdevelop

    r4540 r4555  
    88    <primarylanguage>C++</primarylanguage>
    99    <ignoreparts/>
    10     <projectdirectory>/home/bensch/svn/orxonox/trunk</projectdirectory>
    11     <absoluteprojectpath>true</absoluteprojectpath>
     10    <projectdirectory>.</projectdirectory>
     11    <absoluteprojectpath>false</absoluteprojectpath>
    1212    <description></description>
    1313    <secondaryLanguages/>
     
    2222      <directoryradio>executable</directoryradio>
    2323      <customdirectory>/</customdirectory>
    24       <programargs></programargs>
     24      <programargs/>
    2525      <terminal>false</terminal>
    2626      <autocompile>true</autocompile>
     
    159159  <kdevdocumentation>
    160160    <projectdoc>
    161       <docsystem></docsystem>
    162       <docurl></docurl>
    163       <usermanualurl></usermanualurl>
     161      <docsystem/>
     162      <docurl/>
     163      <usermanualurl/>
    164164    </projectdoc>
    165165  </kdevdocumentation>
  • orxonox/trunk/src/lib/physics/physics_interface.cc

    r4480 r4555  
    11
    22
    3 /* 
     3/*
    44   orxonox - the future of 3D-vertical-scrollers
    55
     
    1414   main-programmer: Patrick Boenzli
    1515   co-programmer: Benjamin Grauer
    16    
     16
    1717   bensch: renamed the file
    1818*/
     
    3636   \brief standard constructor
    3737*/
    38 PhysicsInterface::PhysicsInterface (void* objectPointer) 
     38PhysicsInterface::PhysicsInterface (void* objectPointer)
    3939{
    4040  this->objectPointer = objectPointer;
     
    5050/**
    5151   \brief standard deconstructor
    52 
    5352*/
    54 PhysicsInterface::~PhysicsInterface () 
     53PhysicsInterface::~PhysicsInterface ()
    5554{
    5655   PhysicsEngine::getInstance()->removePhysicsInterface(this);
     
    6766    PNode* massCalcPNode = dynamic_cast<PNode*>(this);  //! \todo not sure if this will work ....
    6867    float massSum = 0;
    69    
     68
    7069    tIterator<PNode>* iterator = massCalcPNode->children->getIterator();
    7170    PNode* pn = iterator->nextElement();
    72     while( pn != NULL) 
    73     { 
     71    while( pn != NULL)
     72    {
    7473    // todo: find out if children are PhysicsInterface in an efficient way
    7574    if (strcmp( pn->getClassName(), "PhysicsInterface")) {
     
    7978    }
    8079    delete iterator;
    81    
     80
    8281    if (massSum != this->massChildren ) {
    8382    this->massChildren = massSum;
     
    8988  */
    9089}
    91        
     90
    9291/**
    9392   \brief applyes a field to this Object
     
    9796{
    9897  PNode* tmp = (PNode*) objectPointer;
    99   this->forceSum += field->calcForce(tmp->getAbsCoor()); 
     98  this->forceSum += field->calcForce(tmp->getAbsCoor());
    10099}
    101100
  • orxonox/trunk/src/lib/physics/physics_interface.h

    r4480 r4555  
    1 /*! 
     1/*!
    22    \file physics_interface.h
    33    \brief a physics interface simulating a body with a mass
     
    4545  virtual void recalcMass();
    4646
    47  
     47
    4848 private:
    4949  void*          objectPointer;         //!< A Pointer to the object we handel (actually should be this)
    50   float          mass;                  //!< Mass of this object
    51   float          massChildren;          //!< Sum of the masses of the children nodes
    52   Vector         forceSum;              //!< Total central force for this tick
    53   Quaternion     momentumSum;           //!< Total momentum in this tick
    54        
    55 
     50  float          mass;                  //!< Mass of this object
     51  float          massChildren;          //!< Sum of the masses of the children nodes
     52  Vector         forceSum;              //!< Total central force for this tick
     53  Quaternion     momentumSum;           //!< Total momentum in this tick
    5654};
    5755
  • orxonox/trunk/src/story_entities/world.cc

    r4518 r4555  
    11
    22
    3 /* 
     3/*
    44   orxonox - the future of 3D-vertical-scrollers
    55
     
    107107   \param reference to the world
    108108
    109    if the worldinterface is not initilizes, there wont be any 
     109   if the worldinterface is not initilizes, there wont be any
    110110   useable interface
    111111*/
     
    139139  this->constuctorInit("", -1);
    140140  this->path = NULL;
    141  
     141
    142142  this->loadParams(root);
    143143}
    144144
    145 /** 
     145/**
    146146    \brief create a new World
    147    
     147
    148148    This creates a new empty world!
    149149*/
     
    165165}
    166166
    167 /** 
     167/**
    168168    \brief remove the World from memory
    169    
     169
    170170    delete everything explicitly, that isn't contained in the parenting tree!
    171171    things contained in the tree are deleted automaticaly
     
    197197
    198198/**
    199    \brief initializes the world. 
     199   \brief initializes the world.
    200200
    201201   set all stuff here that is world generic and does not use to much memory
    202202   because the real init() function StoryEntity::init() will be called
    203    shortly before start of the game. 
     203   shortly before start of the game.
    204204   since all worlds are initiated/referenced before they will be started.
    205205   NO LEVEL LOADING HERE - NEVER!
     
    232232
    233233
    234   /* 
     234  /*
    235235  // identifier
    236236  string = grabParameter( root, "identifier");
     
    250250  }
    251251  else setNextStoryID( id);
    252  
     252
    253253
    254254  // path
     
    295295  this->localCamera = new Camera();
    296296  this->localCamera->setName ("Camera");
    297  
     297
    298298  State::getInstance()->setCamera(this->localCamera, this->localCamera->getTarget());
    299299
     
    306306*/
    307307ErrorMessage World::load()
    308 {       
     308{
    309309  PRINTF(3)("> Loading world: '%s'\n", getPath());
    310310  TiXmlElement* element;
    311311  GameLoader* loader = GameLoader::getInstance();
    312  
     312
    313313  if( getPath() == NULL)
    314314    {
     
    317317      return (ErrorMessage){213,"Path not specified","World::load()"};
    318318    }
    319  
     319
    320320  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
    321321  // load the campaign document
    322   if( !XMLDoc->LoadFile()) 
     322  if( !XMLDoc->LoadFile())
    323323  {
    324324    // report an error
     
    327327    return (ErrorMessage){213,"XML File parsing error","World::load()"};
    328328  }
    329  
     329
    330330  // check basic validity
    331331  TiXmlElement* root = XMLDoc->RootElement();
    332332  assert( root != NULL);
    333  
     333
    334334  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
    335335    {
     
    339339      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
    340340    }
    341  
     341
    342342  // load the parameters
    343343  // name
     
    378378  // find WorldEntities
    379379  element = root->FirstChildElement("WorldEntities");
    380  
     380
    381381  if( element == NULL)
    382382    {
     
    389389      PRINTF(4)("Loading WorldEntities\n");
    390390      while( element != NULL)
    391         {
    392           WorldEntity* created = dynamic_cast<WorldEntity*>( loader->fabricate( element));
    393           if( created != NULL) this->spawn( created);
    394           // if we load a 'Player' we use it as localPlayer
    395           //todo do this more elegant
    396           if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
    397           if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
    398           element = element->NextSiblingElement();
    399           glmis->step(); //! \todo temporary
    400         }
     391        {
     392          WorldEntity* created = dynamic_cast<WorldEntity*>( loader->fabricate( element));
     393          if( created != NULL) this->spawn( created);
     394          // if we load a 'Player' we use it as localPlayer
     395          //todo do this more elegant
     396          if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
     397          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
     398          element = element->NextSiblingElement();
     399          glmis->step(); //! \todo temporary
     400        }
    401401      PRINTF(4)("Done loading WorldEntities\n");
    402402    }
    403  
     403
    404404  // find Track
    405405  element = root->FirstChildElement( "Track");
     
    409409    }
    410410  else
    411     {   
     411    {
    412412      //load track
    413413      PRINTF(4)("Loading Track\n");
     
    416416      trackManager->finalize();
    417417    }
    418  
     418
    419419  // free the XML data
    420420
    421421  delete XMLDoc;
    422422  /* GENERIC LOADING PROCESS FINISHED */
    423  
     423
    424424  // bind input
    425425  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
     
    430430  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
    431431  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
    432  
     432
    433433  // bind camera
    434434  //this->localCamera->bind (localPlayer);
    435435  this->localPlayer->addChild (this->localCamera);
    436      
     436
    437437
    438438  lightMan->setAmbientColor(.1,.1,.1);
     
    445445  //lightMan->debug();
    446446  lightMan->setPosition(-5.0, 10.0, -40.0);
    447  
    448   //        trackManager->setBindSlave(env);
     447
     448  //        trackManager->setBindSlave(env);
    449449  PNode* tn = trackManager->getTrackNode();
    450450  tn->addChild(this->localPlayer);
    451  
     451
    452452  //localCamera->setParent(TrackNode::getInstance());
    453453  tn->addChild(this->localCamera);
     
    463463  objectList = glGenLists(1);
    464464  glNewList (objectList, GL_COMPILE);
    465  
     465
    466466  //trackManager->drawGraph(.01);
    467467  //trackManager->debug(2);
     
    488488  system->setColor(1.0, 0,0,0,0);
    489489
     490
    490491  // Creating a Test Particle Emitter
    491492  ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_4, 400, .5);
     
    498499  gravity->setMagnitude(10.0);
    499500  //  gravity->setParent(this->localCamera->getTarget());
    500  
     501
    501502  // Add the Flow from the Emitter into the System
    502503  particleEngine->addConnection(emitter, system);
     
    504505  new PhysicsConnection(system, gravity);
    505506  //    new PhysicsConnection(this->localPlayer, gravity);
    506  
     507
    507508
    508509  TestEntity* testEntity = new TestEntity();
     
    547548  trackManager->addPointV(Vector(570, 20, -10));
    548549  trackManager->setDuration(2);
    549      
     550
    550551  trackManager->forkS("testFork1,testFork2");
    551552  trackManager->workOnS("testFork1");
     
    572573
    573574  trackManager->setDuration(4);
    574      
    575      
     575
     576
    576577  trackManager->joinS("testFork1,testFork2");
    577        
     578
    578579  trackManager->addPointV(Vector(1200, 60, -50));
    579580  trackManager->addPointV(Vector(1300, 50, -50));
     
    586587  trackManager->addPointV(Vector(1800, 100, -40));
    587588  trackManager->setDuration(10);
    588  
     589
    589590  trackManager->finalize();
    590  
     591
    591592
    592593  // LIGHT initialisation
     
    598599    {
    599600      /*
    600         this loads the hard-coded debug world. this only for simplicity and will be
    601         removed by a reald world-loader, which interprets a world-file.
    602         if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
    603         make whatever you want...
     601        this loads the hard-coded debug world. this only for simplicity and will be
     602        removed by a reald world-loader, which interprets a world-file.
     603        if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
     604        make whatever you want...
    604605      */
    605606    case DEBUG_WORLD_0:
    606607      {
    607         lightMan->setPosition(-5.0, 10.0, -40.0);
    608 
    609 
    610         this->localPlayer = new Player ();
    611         this->localPlayer->setName ("player");
    612         this->spawn (this->localPlayer);
    613         this->localPlayer->setRelCoor(Vector(5,0,0));
    614         /*monitor progress*/
    615         this->glmis->step();
    616 
    617 
    618         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
    619         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
    620         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
    621 
    622         /*
    623         Field* testField = new Gravity();
    624         testField->setMagnitude(10);
    625         new PhysicsConnection(this->localPlayer, testField);
    626         */
    627 
    628         // bind camera
    629         this->localCamera = new Camera();
    630         this->localCamera->setName ("camera");
    631         /*monitor progress*/
    632         this->glmis->step();
    633 
    634 
    635         // Create SkySphere
    636         this->sky = new Skysphere("pictures/sky-replace.jpg");
    637         this->sky->setName("SkySphere");
    638         this->spawn(this->sky);
    639         this->localCamera->addChild(this->sky);
    640         this->sky->setParentMode(PNODE_MOVEMENT);
    641         /*monitor progress*/
    642         this->glmis->step();
    643 
    644 
    645         terrain = new Terrain("worlds/newGround.obj");
    646         terrain->setRelCoor(Vector(0,-10,0));
    647         this->spawn(terrain);
    648         /*monitor progress*/
    649         this->glmis->step();
    650 
    651         this->pilotNode = new PilotNode();
    652         this->spawn(this->pilotNode);
    653         this->pilotNode->setAbsCoor(Vector(150, -35, 5));
    654         this->pilotNode->addChild(this->localPlayer);
    655         this->pilotNode->addChild(this->localCamera);
    656         this->localCamera->lookAt(this->localPlayer);
    657 
    658         this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);
    659         this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);
    660         this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);
    661         this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);
    662         this->eventHandler->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);
    663 
    664         // bind input
    665         Orxonox *orx = Orxonox::getInstance ();
    666         //orx->getLocalInput()->bind (this->pilotNode);     
    667        
    668         /*
    669         PNode* tn = trackManager->getTrackNode();
    670         tn->addChild(this->localPlayer);
    671         this->localCamera->lookAt(tn);
    672        
    673         tn->addChild(this->localCamera);
    674         this->localPlayer->setParentMode(PNODE_ALL);
    675         trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    676         */
    677         this->glmis->step();
    678         break;
     608        lightMan->setPosition(-5.0, 10.0, -40.0);
     609
     610
     611        this->localPlayer = new Player ();
     612        this->localPlayer->setName ("player");
     613        this->spawn (this->localPlayer);
     614        this->localPlayer->setRelCoor(Vector(5,0,0));
     615        /*monitor progress*/
     616        this->glmis->step();
     617
     618
     619        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
     620        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
     621        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
     622
     623        /*
     624        Field* testField = new Gravity();
     625        testField->setMagnitude(10);
     626        new PhysicsConnection(this->localPlayer, testField);
     627        */
     628
     629        // bind camera
     630        this->localCamera = new Camera();
     631        this->localCamera->setName ("camera");
     632        /*monitor progress*/
     633        this->glmis->step();
     634
     635
     636        // Create SkySphere
     637        this->sky = new Skysphere("pictures/sky-replace.jpg");
     638        this->sky->setName("SkySphere");
     639        this->spawn(this->sky);
     640        this->localCamera->addChild(this->sky);
     641        this->sky->setParentMode(PNODE_MOVEMENT);
     642        /*monitor progress*/
     643        this->glmis->step();
     644
     645
     646        terrain = new Terrain("worlds/newGround.obj");
     647        terrain->setRelCoor(Vector(0,-10,0));
     648        this->spawn(terrain);
     649        /*monitor progress*/
     650        this->glmis->step();
     651
     652        this->pilotNode = new PilotNode();
     653        this->spawn(this->pilotNode);
     654        this->pilotNode->setAbsCoor(Vector(150, -35, 5));
     655        this->pilotNode->addChild(this->localPlayer);
     656        this->pilotNode->addChild(this->localCamera);
     657        this->localCamera->lookAt(this->localPlayer);
     658
     659        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);
     660        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);
     661        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);
     662        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);
     663        this->eventHandler->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);
     664
     665        // bind input
     666        Orxonox *orx = Orxonox::getInstance ();
     667        //orx->getLocalInput()->bind (this->pilotNode);
     668
     669        /*
     670        PNode* tn = trackManager->getTrackNode();
     671        tn->addChild(this->localPlayer);
     672        this->localCamera->lookAt(tn);
     673
     674        tn->addChild(this->localCamera);
     675        this->localPlayer->setParentMode(PNODE_ALL);
     676        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     677        */
     678        this->glmis->step();
     679        break;
    679680      }
    680681    case DEBUG_WORLD_1:
    681682      {
    682683
    683         break;
     684        break;
    684685      }
    685686    case DEBUG_WORLD_2:
    686687      {
    687688
    688         break;
     689        break;
    689690      }
    690691    default:
     
    698699   \brief initializes a new World shortly before start
    699700
    700    this is the function, that will be loaded shortly before the world is 
     701   this is the function, that will be loaded shortly before the world is
    701702   started
    702703*/
     
    759760void World::displayLoadScreen ()
    760761{
    761   PRINTF(3)("World::displayLoadScreen - start\n"); 
    762  
    763   //GLMenuImageScreen* 
     762  PRINTF(3)("World::displayLoadScreen - start\n");
     763
     764  //GLMenuImageScreen*
    764765  this->glmis = new GLMenuImageScreen();
    765766  this->glmis->init();
    766767  this->glmis->setMaximum(8);
    767768  //  this->glmis->draw();
    768  
    769   PRINTF(3)("World::displayLoadScreen - end\n"); 
     769
     770  PRINTF(3)("World::displayLoadScreen - end\n");
    770771}
    771772
     
    777778void World::releaseLoadScreen ()
    778779{
    779   PRINTF(3)("World::releaseLoadScreen - start\n"); 
     780  PRINTF(3)("World::releaseLoadScreen - start\n");
    780781  this->glmis->setValue(this->glmis->getMaximum());
    781   PRINTF(3)("World::releaseLoadScreen - end\n"); 
     782  PRINTF(3)("World::releaseLoadScreen - end\n");
    782783  delete this->glmis;
    783784}
     
    804805
    805806
    806 /** 
     807/**
    807808    \brief checks for collisions
    808    
    809     This method runs through all WorldEntities known to the world and checks for collisions 
    810     between them. In case of collisions the collide() method of the corresponding entities 
     809
     810    This method runs through all WorldEntities known to the world and checks for collisions
     811    between them. In case of collisions the collide() method of the corresponding entities
    811812    is called.
    812813*/
     
    816817  List *a, *b;
    817818  WorldEntity *aobj, *bobj;
    818    
     819
    819820  a = entities;
    820  
     821
    821822  while( a != NULL)
    822823    {
    823824      aobj = a->nextElement();
    824825      if( aobj->bCollide && aobj->collisioncluster != NULL)
    825         {
    826           b = a->nextElement();
    827           while( b != NULL )
    828             {
    829               bobj = b->nextElement();
    830               if( bobj->bCollide && bobj->collisioncluster != NULL )
    831                 {
    832                   unsigned long ahitflg, bhitflg;
    833                   if( check_collision ( &aobj->place, aobj->collisioncluster,
    834                                         &ahitflg, &bobj->place, bobj->collisioncluster,
    835                                         &bhitflg) );
    836                   {
    837                     aobj->collide (bobj, ahitflg, bhitflg);
    838                     bobj->collide (aobj, bhitflg, ahitflg);
    839                   }
    840                 }
    841               b = b->nextElement();
    842             }
    843         }
     826        {
     827          b = a->nextElement();
     828          while( b != NULL )
     829            {
     830              bobj = b->nextElement();
     831              if( bobj->bCollide && bobj->collisioncluster != NULL )
     832                {
     833                  unsigned long ahitflg, bhitflg;
     834                  if( check_collision ( &aobj->place, aobj->collisioncluster,
     835                                        &ahitflg, &bobj->place, bobj->collisioncluster,
     836                                        &bhitflg) );
     837                  {
     838                    aobj->collide (bobj, ahitflg, bhitflg);
     839                    bobj->collide (aobj, bhitflg, ahitflg);
     840                  }
     841                }
     842              b = b->nextElement();
     843            }
     844        }
    844845      a = a->enumerate();
    845846    }
     
    847848}
    848849
    849 /** 
     850/**
    850851    \brief runs through all entities calling their draw() methods
    851852*/
     
    859860  tIterator<WorldEntity>* iterator = this->entities->getIterator();
    860861  entity = iterator->nextElement();
    861   while( entity != NULL ) 
    862     { 
     862  while( entity != NULL )
     863    {
    863864      if( entity->bDraw ) entity->draw();
    864865      //entity = this->entities->nextElement();
     
    866867    }
    867868  delete iterator;
    868  
     869
    869870  glCallList (objectList);
    870871
     
    900901  p3->debug ();
    901902  p4->debug ();
    902  
     903
    903904  p1->update (0);
    904905
     
    928929
    929930  delete p1;
    930  
    931  
     931
     932
    932933  /*
    933934  WorldEntity* entity;
    934935  printf("counting all entities\n");
    935936  printf("World::debug() - enumerate()\n");
    936   entity = entities->enumerate(); 
    937   while( entity != NULL ) 
    938     { 
     937  entity = entities->enumerate();
     938  while( entity != NULL )
     939    {
    939940      if( entity->bDraw ) printf("got an entity\n");
    940941      entity = entities->nextElement();
     
    963964      this->handleInput ();
    964965      if( this->bQuitCurrentGame || this->bQuitOrxonox)
    965           break;
     966          break;
    966967      // Process time
    967968      this->tick ();
    968969      // Update the state
    969       this->update ();     
     970      this->update ();
    970971      // Process collision
    971972      this->collide ();
     
    10211022    {
    10221023      this->dt = currentFrame - this->lastFrame;
    1023      
     1024
    10241025      if( this->dt > 0)
    1025         {
    1026           float fps = 1000/dt;
    1027 
    1028           // temporary, only for showing how fast the text-engine is
    1029           char tmpChar[20];
    1030           sprintf(tmpChar, "fps: %4.0f", fps);
    1031         }
     1026        {
     1027          float fps = 1000/dt;
     1028
     1029          // temporary, only for showing how fast the text-engine is
     1030          char tmpChar[20];
     1031          sprintf(tmpChar, "fps: %4.0f", fps);
     1032        }
    10321033      else
    1033         {
    1034           /* the frame-rate is limited to 100 frames per second, all other things are for
    1035              nothing.
    1036           */
    1037           PRINTF(2)("fps = 1000 - frame rate is adjusted\n");
    1038           SDL_Delay(10);
    1039           this->dt = 10;
    1040         }
     1034        {
     1035          /* the frame-rate is limited to 100 frames per second, all other things are for
     1036             nothing.
     1037          */
     1038          PRINTF(2)("fps = 1000 - frame rate is adjusted\n");
     1039          SDL_Delay(10);
     1040          this->dt = 10;
     1041        }
    10411042      //this->timeSlice (dt);
    1042      
     1043
    10431044      /* function to let all entities tick (iterate through list) */
    1044       this->dtS = (float)this->dt / 1000.0;     
     1045      this->dtS = (float)this->dt / 1000.0;
    10451046      this->gameTime += this->dtS;
    1046       //entity = entities->enumerate(); 
     1047      //entity = entities->enumerate();
    10471048      tIterator<WorldEntity>* iterator = this->entities->getIterator();
    10481049      WorldEntity* entity = iterator->nextElement();
    1049       while( entity != NULL) 
    1050         {
    1051           entity->tick (this->dtS);
    1052           entity = iterator->nextElement();
    1053         }
     1050      while( entity != NULL)
     1051        {
     1052          entity->tick (this->dtS);
     1053          entity = iterator->nextElement();
     1054        }
    10541055      delete iterator;
    10551056
     
    10631064      particleEngine->tick(this->dtS);
    10641065      this->garbageCollector->tick(this->dtS);
    1065          
     1066
    10661067      /* actualy the Graphics Engine should tick the world not the other way around...
    1067         but since we like the things not too complicated we got it this way around
    1068         until there is need or time to do it the other way around.
    1069         \todo: GraphicsEngine ticks world: separation of processes and data...
     1068        but since we like the things not too complicated we got it this way around
     1069        until there is need or time to do it the other way around.
     1070        \todo: GraphicsEngine ticks world: separation of processes and data...
    10701071      */
    10711072      GraphicsEngine::getInstance()->tick(this->dtS);
     
    10921093/**
    10931094   \brief render the current frame
    1094    
     1095
    10951096   clear all buffers and draw the world
    10961097*/
     
    11471148   \param In which relative direction should it look.
    11481149*/
    1149 void World::spawn(WorldEntity* entity, PNode* parentNode, 
    1150                   Vector* relCoor, Quaternion* relDir,
    1151                   int parentingMode)
     1150void World::spawn(WorldEntity* entity, PNode* parentNode,
     1151                  Vector* relCoor, Quaternion* relDir,
     1152                  int parentingMode)
    11521153{
    11531154  this->nullParent = NullParent::getInstance();
     
    11551156    {
    11561157      parentNode->addChild (entity);
    1157      
     1158
    11581159      entity->setRelCoor (*relCoor);
    11591160      entity->setRelDir (*relDir);
    11601161      entity->setParentMode(parentingMode);
    1161      
     1162
    11621163      this->entities->add (entity);
    1163      
     1164
    11641165      entity->postSpawn ();
    11651166    }
  • orxonox/trunk/src/subprojects/particles/particle_fun.cc

    r4554 r4555  
    5252  system->setRadius(PINIT_START_RADIUS, PINIT_END_RADIUS ,0 ,0);
    5353  system->setLifeSpan(PINIT_LIFESPAN);
     54
    5455  system->setConserve(PINIT_CONSERVE_FACTOR);
     56  system->setMass(5,3,6);
    5557
    5658  // Creating a Test Particle Emitter
Note: See TracChangeset for help on using the changeset viewer.