本文整理汇总了C++中ogre::Overlay::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ Overlay::isVisible方法的具体用法?C++ Overlay::isVisible怎么用?C++ Overlay::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Overlay
的用法示例。
在下文中一共展示了Overlay::isVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleInput
void PendulumTest::handleInput(opal::real elapsedRealTime,
const SimulationEngine& engine)
{
OIS::Keyboard* keyboard = engine.getKeyboard();
// This variable can be used to keep keys from repeating too fast.
static Ogre::Real toggleTimer = 0;
if (toggleTimer >= 0)
{
toggleTimer -= elapsedRealTime;
}
// Toggle GUI.
if (keyboard->isKeyDown(OIS::KC_G) && toggleTimer <= 0)
{
Ogre::Overlay* debugOverlay = Ogre::OverlayManager::getSingleton().
getByName("Verve/TrialNumber");
if (debugOverlay->isVisible())
{
debugOverlay->hide();
mAgentDebugger->setDisplayEnabled(false);
}
else
{
debugOverlay->show();
mAgentDebugger->setDisplayEnabled(true);
}
toggleTimer = 0.5;
}
}
示例2: handleInput
void handleInput(Ogre::Real elapsedRealTime)
{
// This variable can be used to keep keys from repeating too fast.
static Ogre::Real toggleTimer = 0;
if (toggleTimer >= 0)
{
toggleTimer -= elapsedRealTime;
}
OIS::Keyboard* keyboard = gEngine.getKeyboard();
if (keyboard->isKeyDown(OIS::KC_W))
{
gCar->forward();
}
else if (keyboard->isKeyDown(OIS::KC_S))
{
gCar->reverse();
}
else
{
gCar->idle();
}
if (keyboard->isKeyDown(OIS::KC_A))
{
gCar->setSteering(-1);
}
else if (keyboard->isKeyDown(OIS::KC_D))
{
gCar->setSteering(1);
}
else
{
gCar->setSteering(0);
}
// If available, get data from the game controller.
if (gGamePad)
{
// Update the game controller state.
SDL_JoystickUpdate();
Ogre::Real joy0X = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 0) /
(Ogre::Real)32768;
Ogre::Real joy0Y = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 1) /
(Ogre::Real)32768;
Ogre::Real joy1X = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 4) /
(Ogre::Real)32768;
Ogre::Real joy1Y = (Ogre::Real)SDL_JoystickGetAxis(gGamePad, 3) /
(Ogre::Real)32768;
if (fabs(joy0Y) > 0.1)
{
gCar->setThrottle(-joy0Y);
}
else
{
gCar->idle();
}
if (fabs(joy0X) > 0.1)
{
gCar->setSteering(joy0X);
}
else
{
gCar->setSteering(0);
}
if (joy1X > 0.2 || joy1X < -0.2)
{
Ogre::Degree rotAroundY = -Ogre::Degree(joy1X);
gEngine.getCamera()->yawRelative(rotAroundY.valueDegrees());
}
if (joy1Y > 0.2 || joy1Y < -0.2)
{
Ogre::Degree rotAroundX = -Ogre::Degree(joy1Y);
gEngine.getCamera()->pitchRelative(rotAroundX.valueDegrees());
}
}
// Toggle GUI.
if (keyboard->isKeyDown(OIS::KC_G) && toggleTimer <= 0)
{
Ogre::Overlay* debugOverlay = Ogre::OverlayManager::getSingleton().
getByName("Verve/Debug");
if (debugOverlay->isVisible())
{
debugOverlay->hide();
gAgentDebugger->setDisplayEnabled(false);
}
else
{
debugOverlay->show();
gAgentDebugger->setDisplayEnabled(true);
}
//.........这里部分代码省略.........