Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7004 in orxonox.OLD for trunk/src/story_entities/game_world.cc


Ignore:
Timestamp:
Feb 3, 2006, 3:03:59 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: togglePNodeVisibility as it can be …. cool :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/game_world.cc

    r6992 r7004  
    6969
    7070SHELL_COMMAND(speed, GameWorld, setSpeed);
    71 SHELL_COMMAND(togglePNodeVisibility, GameWorld, togglePNodeVisibility);
    72 SHELL_COMMAND(toggleBVVisibility, GameWorld, toggleBVVisibility);
     71SHELL_COMMAND_STATIC(togglePNodeVisibility, GameWorld, GameWorld::togglePNodeVisibility);
     72SHELL_COMMAND_STATIC(toggleBVVisibility, GameWorld, GameWorld::toggleBVVisibility);
    7373
    7474
     
    379379{
    380380  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_00),
    381   this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
     381      this->dataTank->objectManager->getObjectList(OM_GROUP_01_PROJ));
    382382  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
    383   this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
     383      this->dataTank->objectManager->getObjectList(OM_GROUP_00_PROJ));
    384384
    385385  CDEngine::getInstance()->checkCollisions(this->dataTank->objectManager->getObjectList(OM_GROUP_01),
     
    462462}
    463463
     464
     465
     466/**
     467 * @brief toggles the PNode visibility in the world (drawn as boxes)
     468 */
     469void GameWorld::togglePNodeVisibility()
     470{
     471  if (State::getCurrentStoryEntity() != NULL &&
     472      State::getCurrentStoryEntity()->isA(CL_GAME_WORLD))
     473  {
     474    dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showPNodes = !dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showPNodes;
     475  }
     476  else
     477    PRINTF(2)("The Current Story entity is not a GameWorld\n");
     478};
     479
     480
     481/**
     482 * @brief toggles the bounding volume (BV) visibility
     483*/
     484void GameWorld::toggleBVVisibility()
     485{
     486  if (State::getCurrentStoryEntity() != NULL &&
     487      State::getCurrentStoryEntity()->isA(CL_GAME_WORLD))
     488  {
     489    dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showBV = !dynamic_cast<GameWorld*>(State::getCurrentStoryEntity())->showBV;
     490  }
     491  else
     492    PRINTF(2)("The Current Story entity is not a GameWorld\n");
     493};
     494
Note: See TracChangeset for help on using the changeset viewer.