Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7739 in orxonox.OLD for trunk/src/story_entities


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/story_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.