本文整理汇总了C++中ogre::scenemanager::MovableObjectIterator::moveNext方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObjectIterator::moveNext方法的具体用法?C++ MovableObjectIterator::moveNext怎么用?C++ MovableObjectIterator::moveNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::scenemanager::MovableObjectIterator
的用法示例。
在下文中一共展示了MovableObjectIterator::moveNext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void RttManager::CDepthReflectionListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
{
Hydrax *mHydrax = mRttManager->mHydrax;
Ogre::SceneManager::MovableObjectIterator EntityIterator = mHydrax->getSceneManager()->getMovableObjectIterator("Entity");
Ogre::Entity* CurrentEntity;
unsigned int k;
while (EntityIterator.hasMoreElements()) {
CurrentEntity = static_cast<Ogre::Entity*>(EntityIterator.peekNextValue());
for (k = 0; k < CurrentEntity->getNumSubEntities(); k++) {
CurrentEntity->getSubEntity(k)->setMaterialName(mMaterials.front());
mMaterials.pop();
}
EntityIterator.moveNext();
}
mHydrax->getMesh()->getEntity()->setVisible(true);
if (mCameraPlaneDiff != 0) {
mRttManager->mPlanes[RTT_DEPTH_REFLECTION]->getParentNode()->translate(0, mCameraPlaneDiff, 0);
}
mRttManager->mPlanes[RTT_DEPTH_REFLECTION]->getParentNode()->translate(0, mHydrax->getPlanesError(), 0);
mHydrax->getCamera()->disableReflection();
mHydrax->getCamera()->disableCustomNearClipPlane();
}
示例2: updateOGRE
void MainWindow::updateOGRE()
{
QMutexLocker locker(&mutex);
static bool updateGUI=true;
Ogre::Root* mRoot = Ogre::Root::getSingletonPtr();
mRoot->_fireFrameStarted();
// loop through ogre widgets and update animation
QList<OgreWidget*> rendlist = this->findChildren<OgreWidget*>();
foreach (OgreWidget* w, rendlist)
{
// update animation for OgreWidget's sceneManager
if (w->mRenderWindow && w->updatesEnabled())
{
// update OgreWidget
w->update();
//emit w->paintEvent(new QPaintEvent(w->rect()));
for (Ogre::SceneManager::MovableObjectIterator mit = w->getSceneManager()->getMovableObjectIterator("Entity");
mit.hasMoreElements(); mit.moveNext() )
{
Ogre::Entity *entity = static_cast<Ogre::Entity*>(mit.peekNextValue());
if (updateGUI) {
updateGUI = false;
}
// check has skeleton to avoid crash for non animable entities
if (entity->hasSkeleton())
{
for (Ogre::AnimationStateIterator animIt = entity->getAllAnimationStates()->getAnimationStateIterator();
animIt.hasMoreElements(); animIt.moveNext() )
{
Ogre::AnimationState *animState = animIt.peekNextValue();
if ( animState->getEnabled() )
{
//std::cout << entity->getName() << " ZZZZZZZZZZZ " << animState->getAnimationName();
animState->addTime(w->getRenderWindow()->getBestFPS()/10000);
}
}
}
}
}
}
mRoot->_fireFrameRenderingQueued();
mRoot->_fireFrameEnded();
}
示例3: while
void RttManager::CDepthReflectionListener::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
{
Hydrax *mHydrax = mRttManager->mHydrax;
mHydrax->getMesh()->getEntity()->setVisible(false);
Ogre::SceneManager::MovableObjectIterator EntityIterator =
mHydrax->getSceneManager()->getMovableObjectIterator("Entity");
Ogre::Entity* CurrentEntity;
unsigned int k;
mMaterials.empty();
while (EntityIterator.hasMoreElements())
{
CurrentEntity = static_cast<Ogre::Entity*>(EntityIterator.peekNextValue());
for(k = 0; k < CurrentEntity->getNumSubEntities(); k++)
{
mMaterials.push(CurrentEntity->getSubEntity(k)->getMaterialName());
CurrentEntity->getSubEntity(k)->setMaterialName(mHydrax->getMaterialManager()->getMaterial(MaterialManager::MAT_DEPTH)->getName());
}
EntityIterator.moveNext();
}
mRttManager->mPlanes[RTT_DEPTH_REFLECTION]->getParentNode()->translate(0,-mHydrax->getPlanesError(),0);
bool IsInUnderwaterError = false;
if (mHydrax->getCamera()->getDerivedPosition().y > mRttManager->mPlanes[RTT_DEPTH_REFLECTION]->getParentNode()->getPosition().y)
{
mCameraPlaneDiff = 0;
IsInUnderwaterError = true;
}
else
{
mCameraPlaneDiff = 0;
}
mHydrax->getCamera()->enableReflection(mRttManager->mPlanes[RTT_DEPTH_REFLECTION]);
if (!IsInUnderwaterError)
{
mHydrax->getCamera()->enableCustomNearClipPlane(mRttManager->mPlanes[RTT_DEPTH_REFLECTION]);
}
}
示例4: while
void GodRaysManager::DepthMapListener::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt)
{
Ogre::SceneManager::MovableObjectIterator EntityIterator = mGodRaysManager->mHydrax->getSceneManager()->getMovableObjectIterator("Entity");
Ogre::Entity * CurrentEntity = NULL;
unsigned int k = 0;
mGodRaysManager->mHydrax->getMesh()->getEntity()->setVisible(true);
while(EntityIterator.hasMoreElements())
{
CurrentEntity = static_cast<Ogre::Entity *>(EntityIterator.peekNextValue());
for(k = 0; k < CurrentEntity->getNumSubEntities(); k++)
{
CurrentEntity->getSubEntity(k)->setMaterialName(mMaterials.front());
mMaterials.pop();
}
EntityIterator.moveNext();
}
}
示例5: update
void DemoGameLogic::update(void)
{
mLastFrameTime = mCurrentTime;
mCurrentTime = mTime->elapsed();
float timeElapsedInSeconds = (mCurrentTime - mLastFrameTime) / 1000.0f;
for (Ogre::SceneManager::MovableObjectIterator moi = mSceneManager->getMovableObjectIterator("Entity"); moi.hasMoreElements(); moi.moveNext())
{
Ogre::Entity *entity = static_cast<Ogre::Entity*>(moi.peekNextValue());
Ogre::AnimationStateSet* animationStateSet = entity->getAllAnimationStates();
if(animationStateSet && animationStateSet->hasAnimationState("Walk"))
{
Ogre::AnimationState* walkAnimationState = animationStateSet->getAnimationState("Walk");
walkAnimationState->addTime(timeElapsedInSeconds);
}
}
float distance = mCameraSpeed * timeElapsedInSeconds;
if(mKeyStates[Qt::Key_W] == KS_PRESSED)
{
mCamera->setPosition(mCamera->getPosition() + mCamera->getDirection() * distance);
}
if(mKeyStates[Qt::Key_S] == KS_PRESSED)
{
mCamera->setPosition(mCamera->getPosition() - mCamera->getDirection() * distance);
}
if(mKeyStates[Qt::Key_A] == KS_PRESSED)
{
mCamera->setPosition(mCamera->getPosition() - mCamera->getRight() * distance);
}
if(mKeyStates[Qt::Key_D] == KS_PRESSED)
{
mCamera->setPosition(mCamera->getPosition() + mCamera->getRight() * distance);
}
if(!mIsFirstFrame)
{
QPoint mouseDelta = mCurrentMousePos - mLastFrameMousePos;
mCamera->yaw(Ogre::Radian(-mouseDelta.x() * timeElapsedInSeconds));
mCamera->pitch(Ogre::Radian(-mouseDelta.y() * timeElapsedInSeconds));
int wheelDelta = mCurrentWheelPos - mLastFrameWheelPos;
Ogre::Radian fov = mCamera->getFOVy();
fov += Ogre::Radian(-wheelDelta * 0.001);
fov = (std::min)(fov, Ogre::Radian(2.0f));
fov = (std::max)(fov, Ogre::Radian(0.5f));
mCamera->setFOVy(fov);
}
mLastFrameMousePos = mCurrentMousePos;
mLastFrameWheelPos = mCurrentWheelPos;
mIsFirstFrame = false;
}
示例6: initialise
void DemoGameLogic::initialise(void)
{
//qApp->setStyleSheet(qApp->settings()->value("UI/StyleFile").toString());
mDemoLog = mApplication->createLog("Demo");
mApplication->showLogManager();
mDemoLog->logMessage("A demonstration debug message", LL_DEBUG);
mDemoLog->logMessage("A demonstration info message", LL_INFO);
mDemoLog->logMessage("A demonstration warning message", LL_WARNING);
mDemoLog->logMessage("A demonstration error message", LL_ERROR);
//Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// Create the generic scene manager
mSceneManager = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, "GenericSceneManager");
//Set up scene
loadScene("media/scenes/test.scene");
//mApplication->ogreRenderWindow()->addViewport(mCamera)->setBackgroundColour(Ogre::ColourValue::Black);
mSceneManager->setAmbientLight( Ogre::ColourValue( 1, 1, 1 ) );
//Create the MainMenu
mMainMenu = new MainMenu(qApp, qApp->mainWidget());
//Create widget to choose between models
//mChooseMeshWidget = new ChooseMeshWidget(mJaiquaEntity, mRobotEntity, qApp->mainWidget());
//mChooseMeshWidget->setWindowOpacity(qApp->settings()->value("System/DefaultWindowOpacity", 1.0).toDouble());
//mChooseMeshWidget->move(qApp->mainWidget()->geometry().left() + qApp->mainWidget()->geometry().width() - mChooseMeshWidget->frameGeometry().width() - 10, qApp->mainWidget()->geometry().top() + 10);
//mChooseMeshWidget->show();
mTime = new QTime;
mTime->start();
mIsFirstFrame = true;
mCameraSpeed = 10.0;
for (Ogre::SceneManager::MovableObjectIterator moi = mSceneManager->getMovableObjectIterator("Entity"); moi.hasMoreElements(); moi.moveNext())
{
Ogre::Entity *entity = static_cast<Ogre::Entity*>(moi.peekNextValue());
Ogre::AnimationStateSet* animationStateSet = entity->getAllAnimationStates();
if(animationStateSet && animationStateSet->hasAnimationState("Walk"))
{
Ogre::AnimationState* walkAnimationState = animationStateSet->getAnimationState("Walk");
walkAnimationState->setLoop(true);
walkAnimationState->setEnabled(true);
}
}
mApplication->showFPSCounter();
mStyleSettingsWidget = new StyleSettingsWidget;
mApplication->addSettingsWidget("Style", mStyleSettingsWidget);
}
示例7: paintGL
/**
* @brief render a frame
* @author Kito Berg-Taylor
*/
void THIS::paintGL()
{
if (!initialised)
initializeOgre();
for (Ogre::SceneManager::MovableObjectIterator mit = mSceneMgr->getMovableObjectIterator("Entity");mit.hasMoreElements(); mit.moveNext() )
{
Ogre::Entity *entity = static_cast<Ogre::Entity*>(mit.peekNextValue());
if (entity->hasSkeleton() )
{
for (Ogre::AnimationStateIterator animIt = entity->getAllAnimationStates()->getAnimationStateIterator(); animIt.hasMoreElements(); animIt.moveNext() )
{
Ogre::AnimationState *animState = animIt.peekNextValue();
if ( animState->getEnabled() )
{
animState->addTime(mWindow->getBestFPS()/10000);
}
}
}
}
//Ogre::WindowEventUtilities::messagePump();
mRoot->renderOneFrame();
}