Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7739 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
May 20, 2006, 11:24:22 AM (19 years ago)
Author:
patrick
Message:

trunk: tried to add the command for bvvisibility toggling with depth level. execution results in segfault :(

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/cd_engine.cc

    r7711 r7739  
    131131
    132132
    133 void CDEngine::drawBV(const ObjectManager::EntityList& drawList ) const
     133void CDEngine::drawBV(const ObjectManager::EntityList& drawList, int level) const
    134134{
    135135  ObjectManager::EntityList::const_iterator entity;
    136136  for (entity = drawList.begin(); entity != drawList.end(); entity++)
    137     (*entity)->drawBVTree(3, 226);
     137    (*entity)->drawBVTree(level, 226);
    138138}
    139139
  • trunk/src/lib/collision_detection/cd_engine.h

    r7713 r7739  
    5353  void checkCollisions(std::list<WorldEntity*>& list1, std::list<WorldEntity*>& list2);
    5454
    55   void drawBV(const std::list<WorldEntity*>& drawList ) const;
     55  void drawBV(const std::list<WorldEntity*>& drawList, int level) const;
    5656  void debug();
    5757
  • trunk/src/story_entities/game_world.cc

    r7723 r7739  
    6767->completionPlugin(0, OrxShell::CompletorStringArray(Playable::playmodeNames, Playable::PlaymodeCount));
    6868
    69 SHELL_COMMAND(togglePNodeVisibility, GameWorld, GameWorld::togglePNodeVisibility);
    70 SHELL_COMMAND(toggleBVVisibility, GameWorld, GameWorld::toggleBVVisibility);
     69SHELL_COMMAND(togglePNodeVisibility, GameWorld, togglePNodeVisibility);
     70SHELL_COMMAND(showBVLevel, GameWorld, toggleBVVisibility);
    7171
    7272
     
    8484  this->showPNodes = false;
    8585  this->showBV = false;
     86  this->showBVLevel = 3;
    8687
    8788  this->dataXML = NULL;
     
    484485    CDEngine* engine = CDEngine::getInstance();
    485486    for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
    486       engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
     487      engine->drawBV(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]), this->showBVLevel);
    487488  }
    488489
     
    533534 * @brief toggles the bounding volume (BV) visibility
    534535*/
    535 void GameWorld::toggleBVVisibility()
    536 {
    537   this->showBV = !this->showBV;
     536void GameWorld::toggleBVVisibility(int level)
     537{
     538  if( level < 1)
     539    this->showBV = false;
     540  else
     541  {
     542    this->showBV = true;
     543    this->showBVLevel = level;
     544  }
     545
    538546};
    539547
  • trunk/src/story_entities/game_world.h

    r7723 r7739  
    5555
    5656    void togglePNodeVisibility();
    57     void toggleBVVisibility();
     57    void toggleBVVisibility(int level);
    5858
    5959    inline void setSky(WorldEntity* sky) { this->dataTank->sky = sky; }
     
    8686    bool                showPNodes;                   //!< if the PNodes should be visible.
    8787    bool                showBV;                       //!< if the Bounding Volumes should be visible.
     88    int                 showBVLevel;                  //!< the depth level of the displayed bounding volumes
    8889
    8990    /* world timing */
Note: See TracChangeset for help on using the changeset viewer.