本文整理汇总了C++中ogre::Entity::getBoundingRadius方法的典型用法代码示例。如果您正苦于以下问题:C++ Entity::getBoundingRadius方法的具体用法?C++ Entity::getBoundingRadius怎么用?C++ Entity::getBoundingRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Entity
的用法示例。
在下文中一共展示了Entity::getBoundingRadius方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EngineSetup
void CResourceManagementView::EngineSetup(void)
{
CEngine* Engine = ((CResourceManagementApp*)AfxGetApp())->m_Engine;
Ogre::Root *Root = Engine->GetRoot();
Ogre::SceneManager *SceneManager = NULL;
SceneManager = Root->createSceneManager(Ogre::ST_GENERIC, "ResourceManagement");
//
// Create a render window
// This window should be the current ChildView window using the externalWindowHandle
// value pair option.
//
Ogre::NameValuePairList parms;
parms["externalWindowHandle"] = Ogre::StringConverter::toString((long)m_hWnd);
parms["vsync"] = "true";
CRect rect;
GetClientRect(&rect);
Ogre::RenderTarget *RenderWindow = Root->getRenderTarget("Resource Management");
if (RenderWindow == NULL)
{
try
{
m_RenderWindow = Root->createRenderWindow("Resource Management", rect.Width(), rect.Height(), false, &parms);
}
catch(...)
{
MessageBox("Cannot initialize\nCheck that graphic-card driver is up-to-date", "Initialize Render System", MB_OK | MB_ICONSTOP);
exit(EXIT_SUCCESS);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// Create the camera
m_Camera = SceneManager->createCamera("Camera");
m_Camera->setNearClipDistance(0.5);
m_Camera->setFarClipDistance(5000);
m_Camera->setCastShadows(false);
m_Camera->setUseRenderingDistance(true);
m_Camera->setPosition(Ogre::Vector3(200.0, 50.0, 100.0));
m_Camera->lookAt(0.0, 0.0, 0.0);
Ogre::SceneNode *CameraNode = NULL;
CameraNode = SceneManager->getRootSceneNode()->createChildSceneNode("CameraNode");
Ogre::Viewport* Viewport = NULL;
if (0 == m_RenderWindow->getNumViewports())
{
Viewport = m_RenderWindow->addViewport(m_Camera);
Viewport->setBackgroundColour(Ogre::ColourValue(0.8f, 1.0f, 0.8f));
}
// Alter the camera aspect ratio to match the viewport
m_Camera->setAspectRatio(Ogre::Real(rect.Width()) / Ogre::Real(rect.Height()));
Ogre::StringVector Groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
Ogre::Entity *MobiusEntity = Engine->m_StlFileManager->createEntity("Mobius", "1_4.stl");
Ogre::SceneNode *MobiusNode = SceneManager->getRootSceneNode()->createChildSceneNode();
MobiusNode->attachObject(MobiusEntity);
Ogre::AxisAlignedBox MobiusBox = MobiusEntity->getBoundingBox();
Ogre::Vector3 MobiusCenter = MobiusBox.getCenter();
m_Camera->lookAt(MobiusCenter);
Ogre::Real Radius = MobiusEntity->getBoundingRadius();
m_Camera->setPosition(300, 100, 200);
m_Camera->setPolygonMode(Ogre::PM_WIREFRAME);
}