本文整理汇总了C++中ogre::Root::getSceneManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Root::getSceneManager方法的具体用法?C++ Root::getSceneManager怎么用?C++ Root::getSceneManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Root
的用法示例。
在下文中一共展示了Root::getSceneManager方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTimer
void CBlendingAnimationsView::OnTimer(UINT_PTR nIDEvent)
{
CEngine *Engine = ((CBlendingAnimationsApp*)AfxGetApp())->m_Engine;
Ogre::Root *Root = Engine->GetRoot();
Ogre::SceneNode *RobotNode = Root->getSceneManager("Walking")->getSceneNode("Robot");
Ogre::Entity *RobotEntity = Root->getSceneManager("Walking")->getEntity("Robot");
Ogre::Skeleton *Skeleton = RobotEntity->getSkeleton();
if (m_WeightDlg->m_IsAverage)
{
Skeleton->setBlendMode(Ogre::SkeletonAnimationBlendMode::ANIMBLEND_AVERAGE);
}
else
{
Skeleton->setBlendMode(Ogre::SkeletonAnimationBlendMode::ANIMBLEND_CUMULATIVE);
}
double WalkWeight;
double SlumpWeight;
switch(nIDEvent)
{
case 1:
WalkWeight = m_WeightDlg->m_WalkWeight.GetPos() / 10.0;
SlumpWeight = m_WeightDlg->m_SlumpWeight.GetPos() / 10.0;
m_WalkAnimation->setWeight(WalkWeight);
m_SlumpAnimation->setWeight(SlumpWeight);
m_WalkAnimation->addTime(0.01);
m_SlumpAnimation->addTime(0.01);
break;
case 2:
m_WalkAnimation->addTime(0.01);
break;
case 3:
m_SlumpAnimation->addTime(0.01);
break;
}
Root->renderOneFrame();
CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:52,代码来源:BlendingAnimationsView.cpp
示例2: debugDrawClassification
void NavigationCell::debugDrawClassification( Ogre::Vector3 start, Ogre::Vector3 end )
{
Ogre::Root *root = Ogre::Root::getSingletonPtr();
Ogre::SceneManager* mgr = root->getSceneManager( "SceneManagerInstance" );
Ogre::ManualObject* debug;
Ogre::SceneNode* node;
if( mgr->hasManualObject( "debugDrawClassification" ) )
debug = mgr->getManualObject( "debugDrawClassification" );
else
{
debug = mgr->createManualObject( "debugDrawClassification" );
node = mgr->getRootSceneNode()->createChildSceneNode();
node->attachObject( debug );
node->translate( 0, 1, 0 );
debug->setQueryFlags( 0 );
debug->setRenderQueueGroup( Ogre::RENDER_QUEUE_OVERLAY );
}
debug->begin( "debug/blue", Ogre::RenderOperation::OT_LINE_LIST );
debug->position( start );
debug->position( end );
debug->end();
// debugDrawCell( debug, "debug/yellow", "debug/blue" );
}
示例3: 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
示例4: debugDrawCellAndNeigbours
void NavigationCell::debugDrawCellAndNeigbours()
{
Ogre::Root *root = Ogre::Root::getSingletonPtr();
Ogre::SceneManager* mgr = root->getSceneManager( "SceneManagerInstance" );
Ogre::ManualObject* debug;
Ogre::SceneNode* debugNode;
if( mgr->hasSceneNode( "debugDrawNode" ) )
{
debugNode = mgr->getSceneNode( "debugDrawNode" );
}
else
{
debugNode = mgr->getRootSceneNode()->createChildSceneNode( "debugDrawNode" );
debugNode->translate( 0, 1, 0 ); // Move up slightly to see lines better.
}
if( mgr->hasManualObject( "debugDraw" ) )
debug = mgr->getManualObject( "debugDraw" );
else
{
debug = mgr->createManualObject( "debugDraw" );
debugNode->attachObject( debug );
debug->setQueryFlags( 0 );
debug->setRenderQueueGroup( Ogre::RENDER_QUEUE_OVERLAY );
}
for( int i = 0; i < 3; i++ )
{
if( mLinks[i] )
{
debug->begin( "debug/blue", Ogre::RenderOperation::OT_LINE_STRIP );
debug->position( mLinks[i]->mVertices[0] );
debug->position( mLinks[i]->mVertices[1] );
debug->position( mLinks[i]->mVertices[2] );
debug->position( mLinks[i]->mVertices[0] );
debug->end();
}
}
debug->begin( "debug/yellow", Ogre::RenderOperation::OT_LINE_STRIP );
debug->position( mVertices[0].x, mVertices[0].y+1, mVertices[0].z );
debug->position( mVertices[1].x, mVertices[1].y+1, mVertices[1].z );
debug->position( mVertices[2].x, mVertices[2].y+1, mVertices[2].z );
debug->position( mVertices[0].x, mVertices[0].y+1, mVertices[0].z );
debug->end();
}
示例5: resetPathfinding
void NavigationMesh::resetPathfinding()
{
mOpenList.clear();
for( CellVector::iterator i = mCells.begin(); i != mCells.end(); i++ )
{
i->path = -1; // Not strictly required.
i->parent = 0; // Or this either.
i->isOpen = false;
i->isClosed = false;
}
Ogre::Root *root = Ogre::Root::getSingletonPtr();
Ogre::SceneManager* mgr = root->getSceneManager( "SceneManagerInstance" );
mgr->destroyManualObject( "debugDrawClassification" );
mgr->destroyManualObject( "debugDraw" );
}
示例6: setShow
void NavigationMesh::setShow( bool show )
{
Ogre::Root *root = Ogre::Root::getSingletonPtr();
Ogre::SceneManager* mgr = root->getSceneManager( "SceneManagerInstance" );
Ogre::ManualObject* debug;
Ogre::SceneNode* debugNode;
mShow = show;
if( mgr->hasSceneNode( "debugDrawNode2" ) )
{
debugNode = mgr->getSceneNode( "debugDrawNode2" );
}
else
{
debugNode = mgr->getRootSceneNode()->createChildSceneNode( "debugDrawNode2" );
debugNode->translate( 0, 1, 0 ); // Move up slightly to see lines better.
}
if( mgr->hasManualObject( "debugDraw2" ) )
debug = mgr->getManualObject( "debugDraw2" );
else
{
debug = mgr->createManualObject( "debugDraw2" );
debugNode->attachObject( debug );
debug->setQueryFlags( 0 );
debug->setRenderQueueGroup( Ogre::RENDER_QUEUE_OVERLAY );
}
if( !mShow )
{
mgr->destroyManualObject( debug );
return;
}
for( CellVector::iterator i = mCells.begin(); i != mCells.end(); i++ )
{
i->debugDrawCell( debug, "debug/yellow", "debug/blue" );
}
return;
}
示例7: OnTimer
void CTerrainWalkingView::OnTimer(UINT_PTR nIDEvent)
{
Ogre::Quaternion Quaternion;
CEngine *Engine = ((CTerrainWalkingApp*)AfxGetApp())->m_Engine;
Ogre::Root *Root = Engine->GetRoot();
Ogre::SceneNode *RobotNode = Root->getSceneManager("Walking")->getSceneNode("Robot");
Ogre::Entity *RobotEntity = Root->getSceneManager("Walking")->getEntity("Robot");
Ogre::AxisAlignedBox RobotBox = RobotEntity->getBoundingBox();
Ogre::Entity *TopographyEntity = Root->getSceneManager("Walking")->getEntity("Topography");
Ogre::AxisAlignedBox TopographyBox = TopographyEntity->getBoundingBox();
Ogre::Vector3 Start = TopographyBox.getMinimum();
Ogre::Vector3 Finish = TopographyBox.getMaximum();
double x = Start[0] + (Finish[0] - Start[0]) * m_RelativeDistance;
double y = Start[1] + (Finish[1] - Start[1]) * m_RelativeDistance;
double z = Start[2] + (Finish[2] - Start[2]) * m_RelativeDistance;
Ogre::Vector3 Elevation(x, y, z);
Ogre::Vector3 CameraMove;
switch (nIDEvent)
{
case 1:
m_Animation->addTime(0.01);
m_RelativeDistance += 0.01;
if (m_CollisionTools->collidesWithEntity(Elevation, Ogre::Vector3(x,y - 1,z), Ogre::Vector3(x,y + 1,z), 100.0f, 0.0f, 4294967295))
{
x = Elevation[0];
y = Elevation[1] + RobotBox.getSize()[1];
z = Elevation[2];
}
RobotNode->setPosition(x, y, z);
m_Camera->lookAt(x, y, z);
if (m_RelativeDistance > 1.0)
KillTimer(1);
break;
case 2:
CameraMove[0] = -100;
CameraMove[1] = 0;
CameraMove[2] = 0;
m_Camera->moveRelative(CameraMove);
break;
case 3:
CameraMove[0] = 0;
CameraMove[1] = 100;
CameraMove[2] = 0;
m_Camera->moveRelative(CameraMove);
break;
case 4:
CameraMove[0] = 100;
CameraMove[1] = 0;
CameraMove[2] = 0;
m_Camera->moveRelative(CameraMove);
break;
case 5:
CameraMove[0] = 0;
CameraMove[1] = -100;
CameraMove[2] = 0;
m_Camera->moveRelative(CameraMove);
break;
}
Root->renderOneFrame();
CView::OnTimer(nIDEvent);
}
开发者ID:southerlies,项目名称:OGRE-3D-1.7-Application-Development-Cookbook-Code,代码行数:85,代码来源:TerrainWalkingView.cpp