Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10618 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Apr 4, 2007, 12:13:53 PM (18 years ago)
Author:
bknecht
Message:

merged cleanup into trunk (only improvements)

Location:
trunk
Files:
7 deleted
37 edited
10 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1616OrxonoxPlayability.kdevses
        1717OrxonoxPlayability.kdevelop.pcs
         18orxonox.backtrace
         19orxonox.kdevses
         20orxonox.kdevelop.pcs
  • trunk/src/lib/collision_detection/cd_engine.cc

    r10033 r10618  
    2222#include "model.h"
    2323#include "world_entity.h"
    24 #include "terrain.h"
     24#include "environments/terrain.h"
    2525// #include "player.h"
    2626
     
    3030
    3131#include "bsp/bsp_manager.h"
    32 #include "bsp_entity.h"
     32#include "environments/bsp_entity.h"
    3333
    3434
  • trunk/src/lib/collision_detection/obb_tree_node.cc

    r10033 r10618  
    629629    PRINTF(5)("s = %f, rA+rB = %f\n", fabs(t.dot(l)), rA+rB);
    630630
     631    //TODO valgrind complains about uninitialised value here
    631632    if( (rA + rB) < fabs(t.dot(l)))
    632633    {
  • trunk/src/lib/collision_reaction

    • Property svn:ignore set to
      .deps
      *.a
      Makefile.in
      Makefile
  • trunk/src/lib/collision_reaction/cr_engine.h

    r10013 r10618  
    6262      CR_COLLISION_TYPE_AXIS_Z,            //!< collision on z axis
    6363      CR_COLLISION_TYPE_AXIS_Z_NEG,        //!< collision on negative z axis
     64      CR_COLLISION_TYPE_WAY,               //!< collision on the way from last to current position
    6465      CR_COLLISION_TYPE_OBB,               //!< object aligned bounding box collide
    6566
  • trunk/src/lib/collision_reaction/cr_physics_full_walk.cc

    r10013 r10618  
    163163
    164164
     165 case CoRe::CREngine::CR_COLLISION_TYPE_WAY:
     166          // calulate the height above ground
     167          height = collPos.len() - box->halfLength[1];
     168
     169
     170          // object is beneath the plane (ground)
     171          //         if(height >= 0.0f && height <= 0.0001f) break ;// Do nothing
     172          if( height < 0.0f  )
     173          {
     174            entity->shiftCoor(Vector(0.0f, -height + 0.5f, 0.0f));
     175            entity->setOnGround(true);
     176          }
     177          // object is already in the wall
     178          else if( ce->isInWall())
     179          {
     180            entity->setAbsCoor(entity->getLastAbsCoor());
     181            PRINTF(0)("ground collision: reset pos\n");
     182          }
     183          else
     184          {
     185            // entity is not on ground
     186            entity->setOnGround(false);
     187          }
     188          break;
     189
     190
    165191          /* collision in the Z-AXIS */
    166192        case CoRe::CREngine::CR_COLLISION_TYPE_AXIS_Z:
  • trunk/src/lib/event/key_mapper.cc

    r9880 r10618  
    2323#include "event_def.h"
    2424
    25 #include "globals.h"
     25#include "orxonox_globals.h"
    2626#include "parser/ini_parser/ini_parser.h"
    2727#include "parser/preferences/preferences.h"
  • trunk/src/lib/graphics/Makefile.am

    r9869 r10618  
    2525
    2626noinst_HEADERS =\
     27                glincl.h \
    2728                graphics_engine.h \
    2829                graphics_effect.h \
     
    4647
    4748
     49
    4850SUBDIRS =       importer \
    4951                spatial_separation
  • trunk/src/lib/graphics/graphics_engine.cc

    r10320 r10618  
    3131#include "text.h"
    3232
    33 #include "globals.h"
     33#include "orxonox_globals.h"
    3434#include "texture.h"
    3535
  • trunk/src/lib/graphics/importer/bsp/bsp_manager.cc

    r10519 r10618  
    3030#include "debug.h"
    3131#include "material.h"
    32 #include "camera.h"
     32#include "tools/camera.h"
    3333#include "vertex_array_model.h"
    3434#include "world_entities/player.h"
     
    982982  float endDistance = end->dot(node->plane) - node->d;
    983983  float startDistance = start->dot(node->plane) - node->d;
    984 
    985 
     984 
    986985  if( node->isLeaf) {
    987986    leaf& curLeaf = this->bspFile->leaves[node->leafIndex];
     
    999998  }
    1000999
    1001 
     1000  //TODO valgrind complains about uninitialised value here
    10021001  if (startDistance >= 0 && endDistance >= 0)     // A
    10031002  {   // both points are in front of the plane
     
    11021101  this->outputFraction = 1.0f;
    11031102
    1104 
    11051103  this->checkCollisionX(worldEntity);
    1106   this->checkCollisionY(worldEntity);
    11071104  this->checkCollisionZ(worldEntity);
     1105
     1106  if(!(this->checkCollisionY(worldEntity)))
     1107  this->checkCollisionWay(worldEntity);
    11081108
    11091109
     
    12881288 * check the collision in the x direction (forward, backward)
    12891289 */
    1290 void BspManager::checkCollisionX(WorldEntity* entity)
     1290bool BspManager::checkCollisionX(WorldEntity* entity)
    12911291{
    12921292  // Retrieve Bounding box
     
    13981398                              SolidFlag);
    13991399  }
     1400
     1401 return (xCollisionBackward || xCollisionForward);
    14001402}
    14011403
     
    14041406 * check the collision in the z direction (up, down)
    14051407 */
    1406 void BspManager::checkCollisionY(WorldEntity* entity)
     1408bool BspManager::checkCollisionY(WorldEntity* entity)
    14071409{
    14081410
     
    15461548                              collPos, SolidFlag);
    15471549  }
     1550
     1551 return (yCollisionUp || yCollisionDown);
    15481552}
    15491553
     
    15541558 * check the collision in the z direction (left, right)
    15551559 */
    1556 void BspManager::checkCollisionZ(WorldEntity* entity)
     1560bool BspManager::checkCollisionZ(WorldEntity* entity)
    15571561{
    15581562  // Retrieve Bounding box
     
    16641668                               collPos , SolidFlag);
    16651669  }
     1670
     1671 return (zCollisionLeft || zCollisionRight);
     1672
     1673}
     1674
     1675
     1676
     1677
     1678/**
     1679 * check wether a collision occured on the way from the last position to the current position
     1680 */
     1681bool BspManager::checkCollisionWay(WorldEntity* entity)
     1682{
     1683
     1684
     1685 
     1686  plane*            testPlane          = NULL;  //!< the collision test plane
     1687  Vector            to;
     1688  Vector            collPos;                    //!< the collision position
     1689
     1690  bool              yCollisionUp       = false; //!< flag true if right collision
     1691  bool              SolidFlag          = false; //!< flag set true if solid
     1692
     1693  Vector            from;                   //!< current position of the entity
     1694  Vector            dirY;                       //!< direction x
     1695
     1696  from = entity->getLastAbsCoor();
     1697  to    = entity->getAbsCoor();
     1698  collPos = from;
     1699  dirY =  Vector(0.0, 1.0, 0.0);
     1700
     1701
     1702
     1703
     1704  /*   Y Ray up */
     1705  // init some member variables before collision check
     1706  this->inputStart = from;
     1707  this->inputEnd   = to;
     1708  this->checkCollisionRayN(this->root,0.0f,1.0f, &from, &to );
     1709
     1710  if( !this->outputStartsOut )
     1711  {
     1712    this->collPlane = new plane;
     1713    this->collPlane->x = 0.0f;
     1714    this->collPlane->y = 0.0f;
     1715    this->collPlane->z = 0.0f;
     1716    yCollisionUp = true;
     1717  }
     1718  else
     1719  {
     1720    if( this->outputFraction == 1.0f)
     1721    {
     1722      if( this->outputAllSolid )
     1723      {
     1724        this->collPlane = new plane;
     1725        this->collPlane->x = 0.0f;
     1726        this->collPlane->y = 0.0f;
     1727        this->collPlane->z = 0.0f;
     1728        yCollisionUp = true;
     1729        SolidFlag = true;
     1730      }
     1731      else
     1732      {
     1733        yCollisionUp = false;
     1734        collPos = to;
     1735      }
     1736    }
     1737    else
     1738    {
     1739      yCollisionUp = true;
     1740      collPos = from + (to - from) * this->outputFraction;
     1741      this->out = collPos;        // why this????
     1742    }
     1743  }
     1744  testPlane = this->collPlane;
     1745
     1746  // collision registration
     1747  if( yCollisionUp)
     1748  {
     1749    CoRe::CollisionTube::getInstance()->registerCollisionEvent( CoRe::CREngine::CR_COLLISION_TYPE_WAY,
     1750                              entity, this->parent,
     1751                              Vector(testPlane->x, testPlane->y, testPlane->z),
     1752                              collPos, SolidFlag);
     1753  }
     1754
     1755 return yCollisionUp;
    16661756
    16671757}
  • trunk/src/lib/graphics/importer/bsp/bsp_manager.h

    r10519 r10618  
    8888  void  checkCollisionRayN(BspTreeNode * node,float startFraction, float endFraction, Vector* start, Vector* end);
    8989
    90   void checkCollisionX(WorldEntity* entity);
    91   void checkCollisionY(WorldEntity* entity);
    92   void checkCollisionZ(WorldEntity* entity);
     90  bool checkCollisionX(WorldEntity* entity);
     91  bool checkCollisionY(WorldEntity* entity);
     92  bool checkCollisionZ(WorldEntity* entity);
     93  bool checkCollisionWay(WorldEntity* entity);
    9394
    9495  void  checkCollisionBox(void);
  • trunk/src/lib/graphics/light.h

    r9869 r10618  
    102102  void setAmbientColor(GLfloat r, GLfloat g, GLfloat b);
    103103  // HACK: Assuming r = g = b values
    104 inline GLfloat getAmbientColor() {  return this->ambientColor[0]; }
     104  // SOLVED: nobody uses it anyway
     105  // inline GLfloat getAmbientColor() {  return this->ambientColor[0]; }
    105106
    106107  Light* getLight(int lightNumber) const;
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r9869 r10618  
    2424#include "state.h"
    2525#include "p_node.h"
    26 #include "camera.h"
     26#include "tools/camera.h"
    2727///////////////////////////
    2828
  • trunk/src/lib/gui/qt/gui_audio.cc

    r8145 r10618  
    3030#include <QtGui/QLCDNumber>
    3131#include "debug.h"
    32 #include "globals.h"
     32#include "orxonox_globals.h"
    3333
    3434#include "qt_gui_elements.h"
  • trunk/src/lib/gui/qt/gui_control.cc

    r8495 r10618  
    3535#include "lib/event/key_names.h"
    3636
    37 #include "globals.h"
     37#include "orxonox_globals.h"
    3838#include "debug.h"
    3939#include "qt_gui_elements.h"
  • trunk/src/lib/gui/qt/gui_general.cc

    r8145 r10618  
    3131
    3232#include "debug.h"
    33 #include "globals.h"
     33#include "orxonox_globals.h"
    3434
    3535#include "qt_gui_elements.h"
  • trunk/src/lib/gui/qt/gui_video.cc

    r9406 r10618  
    2828
    2929#include <QtGui/QLayout>
    30 #include "globals.h"
     30#include "orxonox_globals.h"
    3131#include "debug.h"
    3232
  • trunk/src/lib/lang

    • Property svn:ignore set to
      *.a
      .deps
      Makefile.in
      Makefile

  • trunk/src/lib/math/curve.h

    r10368 r10618  
    1010#define _CURVE_H
    1111
     12#include <list>
    1213#include "vector.h"
    1314#include "quaternion.h"
    14 
    15 template<class T> class tList;
    16 template<class T> class tIterator;
    1715
    1816//! An Enumerator that defines what sort of Curves are availible
     
    7371  Curve*                dirCurve;        //!< The derivation-curve of this Curve.
    7472
    75   tList<PathNode>*      nodeList;        //!< A list of all the Nodes of a Curve.
    76   tIterator<PathNode>*  nodeIterator;    //!< An iterator that should point to the current Node
     73  std::list<PathNode>   nodeList;        //!< A list of all the Nodes of a Curve.
    7774  PathNode*             firstNode;       //!< First node of the curve.
    7875  PathNode*             currentNode;     //!< The node we are working with (the Last node).
     
    105102
    106103
    107 //! B-Spline
    108 /**
    109    class to handle b-spline in 3d space
    110 */
    111 class BSplieCurve : public Curve
    112 {
    113 
    114 
    115 };
    116 
    117104#endif /* _CURVE_H */
  • trunk/src/lib/parser/cmdline_parser

    • Property svn:ignore
      •  

        old new  
        22Makefile.in
        33.deps
        4 libORX*
         4*.a
  • trunk/src/lib/physics/physics_interface.cc

    r9869 r10618  
    2727
    2828#include "string.h"
    29 #include "stdincl.h"
    3029
    3130
  • trunk/src/lib/script_engine

    • Property svn:ignore set to
      *.a
      Makefile.in
      Makefile
      .deps

  • trunk/src/lib/script_engine/Makefile.am

    r9916 r10618  
    2828                script_method.h \
    2929                executor_lua_state.h
    30 
    31 
    32 
    33 
    34 check_PROGRAMS = example
    35 example_DEPENDENCIES = \
    36                 $(MAINSRCDIR)/world_entities/libORXwe.a \
    37                 $(libORXlibs_a_LIBRARIES_) \
    38                 $(MAINSRCDIR)/util/libORXutils.a
    39 example_LDADD = \
    40                 $(MAINSRCDIR)/util/libORXutils.a \
    41                 $(libORXlibs_a_LIBRARIES_) \
    42                 libORXscript.a -L../../../extern_libs @LUA_LIBS@ \
    43                 $(MAINSRCDIR)/world_entities/libORXwe.a \
    44                 $(libORXlibs_a_LIBRARIES_) \
    45                 $(MAINSRCDIR)/util/libORXutils.a
    46 
    47 example_SOURCES= \
    48                 example.cc \
    49                 \
    50                 ../util/executor/executor_lua.cc
  • trunk/src/lib/script_engine/script_manager.cc

    r9869 r10618  
    2525
    2626#include "script.h"
    27 #include "script_trigger.h"
     27#include "tools/script_trigger.h"
    2828#include "luaincl.h"
    2929#include "loading/load_param_xml.h"
  • trunk/src/lib/shell/shell_input.cc

    r9916 r10618  
    2424#include "compiler.h"
    2525#include "key_names.h"
     26
     27#include "game_world.h"
     28#include "state.h"
    2629
    2730
     
    284287  {
    285288    if (this->delayed > 0.0)
    286       this->delayed -= dt;
     289    {
     290      StoryEntity* storyEntity = State::getCurrentStoryEntity();
     291      float speed = 1;
     292      if ( storyEntity && storyEntity->isA( GameWorld::staticClassID() ) )
     293      {
     294        speed = ((GameWorld*)storyEntity)->getSpeed();
     295      }
     296      this->delayed -= dt / speed;
     297    }
    287298    else if (this->pressedKey != SDLK_FIRST )
    288299    {
  • trunk/src/lib/sound/Makefile.am

    r9869 r10618  
    1111                        ogg_player.cc
    1212
    13 noinst_HEADERS = sound_engine.h \
    14                  sound_source.h \
    15                  sound_buffer.h \
    16                  sound_buffer_data.h \
    17                  resource_sound_buffer.h \
    18                  ogg_player.h
     13noinst_HEADERS = \
     14                alincl.h \
     15                sound_engine.h \
     16                sound_source.h \
     17                sound_buffer.h \
     18                sound_buffer_data.h \
     19                resource_sound_buffer.h \
     20                ogg_player.h
  • trunk/src/lib/sound/ogg_player.cc

    r9869 r10618  
    7979  bool OggPlayer::open(const std::string& fileName)
    8080  {
    81     OrxThread::MutexLock musicLock(&this->musicMutex);
     81    OrxThread::MutexLocker musicLock(&this->musicMutex);
    8282    // release old Ogg-File (if loaded)
    8383    if (this->state & OggPlayer::FileOpened)
     
    212212    if (this->state & OggPlayer::FileOpened)
    213213    {
    214       OrxThread::MutexLock musicLock(&this->musicMutex);
     214      OrxThread::MutexLocker musicLock(&this->musicMutex);
    215215      ov_time_seek(&this->oggStream, timeCode);
    216216    }
     
    263263    {
    264264      {
    265         OrxThread::MutexLock musicLock(&ogg->musicMutex);
     265        OrxThread::MutexLocker musicLock(&ogg->musicMutex);
    266266        ogg->update();
    267267      }
     
    286286    this->state |= OggPlayer::Playing;
    287287
    288     OrxThread::MutexLock musicLock(&this->musicMutex);
     288    OrxThread::MutexLocker musicLock(&this->musicMutex);
    289289    if(!this->stream(this->buffers[0]) || !this->stream(this->buffers[1]))
    290290    {
  • trunk/src/lib/sound/ogg_player.h

    r9869 r10618  
    1313#include <ogg/ogg.h>
    1414#include <vorbis/vorbisfile.h>
    15 #include "util/threading.h"
     15#include "util/threads/mutex_locker.h"
    1616
    1717struct File;
  • trunk/src/lib/sound/sound_engine.cc

    r9869 r10618  
    2424#include "debug.h"
    2525#include "parser/preferences/preferences.h"
    26 #include "globals.h"
     26#include "orxonox_globals.h"
    2727#include "resource_sound_buffer.h"
    2828
  • trunk/src/lib/sound/sound_engine.h

    r9869 r10618  
    1515#include <list>
    1616#include <stack>
    17 #include "threading.h"
     17#include "threads/mutex.h"
    1818
    1919#define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
  • trunk/src/lib/util

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      *.a
  • trunk/src/lib/util/Makefile.am

    r9869 r10618  
    2929                filesys/net_link.cc \
    3030                \
    31                 threading.cc \
     31                threads/thread.cc \
    3232                timer.cc
    3333
     
    6363                filesys/net_link.h \
    6464                \
    65                 threading.h \
     65                threads/threading.h \
     66                threads/thread.h \
     67                threads/mutex.h \
     68                threads/mutex_locker.h \
     69                \
    6670                timer.h \
    6771                \
     
    7781                loading/dynamic_loader.h \
    7882                \
    79                 count_pointer.h \
    80                 list.h
     83                count_pointer.h
  • trunk/src/lib/util/debug_buffer.cc

    r9869 r10618  
    2020#include "debug.h"
    2121#include "compiler.h"
    22 #include "threading.h"
     22#include "threads/mutex_locker.h"
    2323
    2424/**
     
    6464  static OrxThread::Mutex DebugBuffer__bufferMutex;
    6565
    66   OrxThread::MutexLock bufferLock(&DebugBuffer__bufferMutex);
     66  OrxThread::MutexLocker bufferLock(&DebugBuffer__bufferMutex);
    6767
    6868  va_list arguments;
  • trunk/src/lib/util/filesys/net_link.cc

    r9406 r10618  
    1717#include "debug.h"
    1818
     19#include "threads/mutex_locker.h"
    1920
    2021#ifdef __OSX__
     
    4546int NetLink::openupInBrowser(void* url)
    4647{
    47   OrxThread::MutexLock lock(&NetLink::_mutex);
     48  OrxThread::MutexLocker lock(&NetLink::_mutex);
    4849
    4950  std::string URL = *(std::string*)url;
     
    6970void NetLink::setDefaultBrowser(const std::string& browserName)
    7071{
    71   OrxThread::MutexLock lock(&NetLink::_mutex);
     72  OrxThread::MutexLocker lock(&NetLink::_mutex);
    7273  NetLink::_defaultBrowser = browserName;
    7374}
  • trunk/src/lib/util/filesys/net_link.h

    r9406 r10618  
    1919#include <list>
    2020
    21 #include "threading.h"
     21#include "threads/mutex.h"
    2222
    2323//! NetLink is a File and Link executer for Internet Links
  • trunk/src/lib/util/loading/game_loader.cc

    r9869 r10618  
    2323#include "debug.h"
    2424#include "campaign.h"
     25#include "compiler.h"
    2526
    2627#include "key_mapper.h"
  • trunk/src/lib/util/loading/game_loader.h

    r9869 r10618  
    99//#include "stdincl.h"
    1010#include "story_def.h"
    11 #include "comincl.h"
    1211#include "event_listener.h"
    1312
Note: See TracChangeset for help on using the changeset viewer.