Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

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

Location:
trunk/src/story_entities
Files:
2 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
  • trunk/src/story_entities/game_world.h

    r6992 r7004  
    4848    /**  returns the track path of this world @returns the track path */
    4949
    50     /** toggles the PNode visibility in the world (drawn as boxes) */
    51     void togglePNodeVisibility() { this->showPNodes = !this->showPNodes; };
    52     /** toggles the bounding volume (BV) visibility */
    53     void toggleBVVisibility() { this->showBV = !this->showBV; };
     50    static void togglePNodeVisibility();
     51    static void toggleBVVisibility();
    5452
    5553
Note: See TracChangeset for help on using the changeset viewer.