本文整理汇总了C++中ogre::SceneManager::getEntity方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneManager::getEntity方法的具体用法?C++ SceneManager::getEntity怎么用?C++ SceneManager::getEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneManager
的用法示例。
在下文中一共展示了SceneManager::getEntity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTimer
void CSceletalAnimationView::OnTimer(UINT_PTR nIDEvent)
{
CEngine *Engine = ((CSceletalAnimationApp*)AfxGetApp())->m_Engine;
Ogre::Root *Root = Engine->GetRoot();
Ogre::SceneManager *SceneManager = Root->getSceneManager("Animation");
Ogre::Entity *Entity = SceneManager->getEntity("Animation");
Ogre::Skeleton *Skeleton = Entity->getSkeleton();
m_AnimationState->addTime(0.1);
Root->renderOneFrame();
CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:13,代码来源:SceletalAnimationView.cpp
示例2: UpdateVisualEffects
void EC_OgreEnvironment::UpdateVisualEffects(f64 frametime)
{
if (renderer_.expired())
return;
RendererPtr renderer = renderer_.lock();
Ogre::Camera *camera = renderer->GetCurrentCamera();
Ogre::Viewport *viewport = renderer->GetViewport();
Ogre::SceneManager *sceneManager = renderer->GetSceneManager();
#ifdef CAELUM
// Set sunlight attenuation using diffuse multiplier.
// Seems to be working ok, but feel free to fix if you find better logic and/or values.
Ogre::ColourValue diffuseMultiplier(sunColorMultiplier_, sunColorMultiplier_, sunColorMultiplier_, 1);
caelumSystem_->getSun()->setDiffuseMultiplier(diffuseMultiplier);
Ogre::Light* sun = caelumSystem_->getSun()->getMainLight();
Ogre::Light* moon = caelumSystem_->getMoon()->getMainLight();
float sunDirZaxis = caelumSystem_->getSun()->getMainLight()->getDirection().z;
if (sunDirZaxis > 0)
{
sunColorMultiplier_ -= 0.005f;
if (sunColorMultiplier_ <= 0.05f)
sunColorMultiplier_ = 0.05f;
}
else if(sunDirZaxis < 0)
{
sunColorMultiplier_ += 0.010f;
if (sunColorMultiplier_ >= MAX_SUNLIGHT_MULTIPLIER)
sunColorMultiplier_ = MAX_SUNLIGHT_MULTIPLIER;
}
if ( !fog_color_override_)
fogColor_ = caelumSystem_->getGroundFog()->getColour();
#endif
#ifdef CAELUM
// Update Caelum system.
caelumSystem_->notifyCameraChanged(camera);
caelumSystem_->updateSubcomponents(frametime);
// Disable specular from the sun & moon for now, because it easily leads to too strong results
sun->setSpecularColour(0.0f, 0.0f, 0.0f);
moon->setSpecularColour(0.0f, 0.0f, 0.0f);
#endif
#ifdef HYDRAX
// Update Hydrax system.
hydraxSystem_->update(frametime);
sunPos = camera->getPosition();
sunPos -= caelumSystem_->getSun()->getLightDirection() * 80000;
hydraxSystem_->setSunPosition(sunPos);
#endif
Ogre::Entity* water = 0;
cameraFarClip_ = renderer->GetViewDistance();
if ( sceneManager->hasEntity("WaterEntity") )
water = sceneManager->getEntity("WaterEntity");
if (!water)
{
// No water entity, set fog value.
Real fogStart = fogStart_;
Real fogEnd = fogEnd_;
ClampFog(fogStart, fogEnd, cameraFarClip_);
sceneManager->setFog(Ogre::FOG_LINEAR, fogColor_, 0.001, fogStart, fogEnd);
viewport->setBackgroundColour(fogColor_);
camera->setFarClipDistance(cameraFarClip_);
}
else
{
if(camera->getDerivedPosition().z >= water->getParentNode()->getPosition().z)
{
// We're above the water.
Real fogStart = fogStart_;
Real fogEnd = fogEnd_;
ClampFog(fogStart, fogEnd, cameraFarClip_);
#ifdef CAELUM
caelumSystem_->forceSubcomponentVisibilityFlags(caelumComponents_);
#endif
sceneManager->setFog(Ogre::FOG_LINEAR, fogColor_, 0.001, fogStart, fogEnd);
viewport->setBackgroundColour(fogColor_);
camera->setFarClipDistance(cameraFarClip_);
cameraUnderWater_ = false;
}
else
{
// We're below the water.
Real fogStart = waterFogStart_;
Real fogEnd = waterFogEnd_;
Real farClip = waterFogEnd_ + 10.f;
if (farClip > cameraFarClip_)
farClip = cameraFarClip_;
//.........这里部分代码省略.........