OGRE-找不到请求的发射极类型.在promentystemmanager中:: _ create -emitter
Ogre - Cannot find requested emitter type. in ParticleSystemManager::_createEmitter
我正在尝试从本教程中运行tinyogre,但我仍然收到以下消息:
ogre异常(2:InvalidParameTerexception):找不到请求的发射极类型。在promentystemmanager :: _ create -emitter at c:/intel/inde/ogresdk_1-9-0/ogre/ogre/ogremain/src/ogreparticlesystemmanager.cpp (第270行)
这是我的代码:
tinyogre.cpp
/*
-----------------------------------------------------------------------------
Filename: TinyOgre.cpp
-----------------------------------------------------------------------------
This source file is part of the
___ __ __ _ _ _
/_____ _ _ __ ___ / / / (_) | _(_)
// // _` | '__/ _ / / / | |/ / |
/ _// (_| | | | __/ / /| | <| |
___/ __, |_| ___| / / |_|_|__|
|___/
Tutorial Framework
http://www.ogre3d.org/tikiwiki/
-----------------------------------------------------------------------------
*/
#include "TinyOgre.h"
#include <OgreLogManager.h>
#include <OgreViewport.h>
#include <OgreConfigFile.h>
#include <OgreEntity.h>
#include <OgreWindowEventUtilities.h>
//-------------------------------------------------------------------------------------
TinyOgre::TinyOgre(void)
: mRoot(0),
mCamera(0),
mSceneMgr(0),
mWindow(0),
mResourcesCfg(Ogre::StringUtil::BLANK),
mPluginsCfg(Ogre::StringUtil::BLANK)
{
}
//-------------------------------------------------------------------------------------
TinyOgre::~TinyOgre(void)
{
delete mRoot;
}
bool TinyOgre::go(void)
{
#ifdef _DEBUG
mResourcesCfg = "resources_d.cfg";
mPluginsCfg = "plugins_d.cfg";
#else
mResourcesCfg = "resources.cfg";
mPluginsCfg = "plugins.cfg";
#endif
// construct Ogre::Root
mRoot = new Ogre::Root(mPluginsCfg);
//-------------------------------------------------------------------------------------
// setup resources
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcesCfg);
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
archName, typeName, secName);
}
}
//-------------------------------------------------------------------------------------
// configure
// Show the configuration dialog and initialise the system
// You can skip this and use root.restoreConfig() to load configuration
// settings if you were sure there are valid ones saved in ogre.cfg
if(mRoot->restoreConfig() || mRoot->showConfigDialog())
{
// If returned true, user clicked OK so initialise
// Here we choose to let the system create a default rendering window by passing 'true'
mWindow = mRoot->initialise(true, "TinyOgre Render Window");
}
else
{
return false;
}
//-------------------------------------------------------------------------------------
// choose scenemanager
// Get the SceneManager, in this case a generic one
mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
//-------------------------------------------------------------------------------------
// create camera
// Create the camera
mCamera = mSceneMgr->createCamera("PlayerCam");
// Position it at 500 in Z direction
mCamera->setPosition(Ogre::Vector3(0,0,80));
// Look back along -Z
mCamera->lookAt(Ogre::Vector3(0,0,-300));
mCamera->setNearClipDistance(5);
//-------------------------------------------------------------------------------------
// create viewports
// Create one viewport, entire window
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
// Alter the camera aspect ratio to match the viewport
mCamera->setAspectRatio(
Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
//-------------------------------------------------------------------------------------
// Set default mipmap level (NB some APIs ignore this)
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
//-------------------------------------------------------------------------------------
// Create any resource listeners (for loading screens)
//createResourceListener();
//-------------------------------------------------------------------------------------
// load resources
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
//-------------------------------------------------------------------------------------
// Create the scene
Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
headNode->attachObject(ogreHead);
// Set ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
// Create a light
Ogre::Light* l = mSceneMgr->createLight("MainLight");
l->setPosition(20,80,50);
//-------------------------------------------------------------------------------------
while(true)
{
// Pump window messages for nice behaviour
Ogre::WindowEventUtilities::messagePump();
if(mWindow->isClosed())
{
return false;
}
// Render a frame
if(!mRoot->renderOneFrame()) return false;
}
// We should never be able to reach this corner
// but return true to calm down our compiler
return true;
}
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char *argv[])
#endif
{
// Create application object
TinyOgre app;
try {
app.go();
} catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}
return 0;
}
#ifdef __cplusplus
}
#endif
tinyogre.h
/*
-----------------------------------------------------------------------------
Filename: TinyOgre.h
-----------------------------------------------------------------------------
This source file is part of the
___ __ __ _ _ _
/_____ _ _ __ ___ / / / (_) | _(_)
// // _` | '__/ _ / / / | |/ / |
/ _// (_| | | | __/ / /| | <| |
___/ __, |_| ___| / / |_|_|__|
|___/
Tutorial Framework
http://www.ogre3d.org/tikiwiki/
-----------------------------------------------------------------------------
*/
#ifndef __TinyOgre_h_
#define __TinyOgre_h_
#include <OgreRoot.h>
#include <OgreCamera.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
class TinyOgre
{
public:
TinyOgre(void);
virtual ~TinyOgre(void);
bool go(void);
protected:
Ogre::Root *mRoot;
Ogre::Camera* mCamera;
Ogre::SceneManager* mSceneMgr;
Ogre::RenderWindow* mWindow;
Ogre::String mResourcesCfg;
Ogre::String mPluginsCfg;
};
#endif // #ifndef __TinyOgre_h_
我的资源.cfg正在遵循(我已经从网络上的其他一些教程组成):
# Resources required by the sample browser and most samples.
[Essential]
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/SdkTrays.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/profiler.zip
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/thumbnails
# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[Popular]
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/fonts
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/Cg
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL150
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL400
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSLES
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/HLSL
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/scripts
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/textures
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/textures/nvidia
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/scripts/SSAO
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/textures/SSAO
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/Cg
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/GLSL
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/models
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/particle
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/DeferredShadingMedia
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/PCZAppMedia
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/materials
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/PCZAppMedia
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/volumeTerrain
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/cubemap.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/cubemapsJS.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/dragon.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/fresneldemo.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/ogretestmap.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/ogredance.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/Sinbad.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/skybox.zip
Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/volumeTerrain/volumeTerrainBig.zip
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/ParticleFX
[General]
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media
# Materials for visual tests
[Tests]
FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Tests/Media
我注意到,当我评论以下行:
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL150
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL400
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSLES
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/HLSL
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/Cg
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/GLSL
然后我收到不同的错误消息:
ogre异常(6:filenotfoundexception):无法找到资源 Resource Group或任何其他 团体。在ResourceGroupManager :: OpenResource at C:/intel/inde/ogresdk_1-9-0/ogre/ogreain/src/ogreresourcegroupmanager.cpp (第756行)
如果我评论以下行:
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL150
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL400
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSLES
#FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/HLSL
然后我收到此错误消息:
ogre异常(6:filenotfoundexception):无法找到资源 资源组流行或任何其他组中的Shadows.glsl。在 ResourceGroupManager :: OpenResource at C:/intel/inde/ogresdk_1-9-0/ogre/ogreain/src/ogreresourcegroupmanager.cpp (第756行)
让我进一步澄清自己的情况;我们在当前项目中使用了OGRE来提供一些可视化和数学(我个人不做OGRE,而是其他项目部分)。如今,我想编译" Hello World" Ogre项目并开始玩。我正在使用VisualStudio 2013和Ogre 1.9。我怀疑问题可能是我没有根据Wiki安装Ogre,而是从另一台PC复制了。但是我100%确定这是在工作安装安装。例如,也使用OGRE的代码以下代码对我来说正常工作(但是此示例不使用Resources.cfg)。谢谢
ps:首先,我想将其发布到Ogre论坛上,但看来注册被打破(注册后没有邮件),因此,如果有人可以重新发布它,我会很高兴。
听起来好像您没有在应用程序中加载" plugin_particlefx"。确保它在您的" plugins.cfg"中列出。然后,此插件将提供专用Ogre3D Wiki页面上列出的发射极类型。
论坛:注册有效。如果激活邮件以某种方式无法到达您,请与我们联系,我们可以轻松地对其进行解决。
- Using C++ CryptAPI:CNG Create CSR
- 错误:(-210:不支持的格式或格式组合)功能'create'中的硬件视频解码器不支持视频源
- Firebase C++VS2018 SDL2-在Firebase::app::create(..)上执行异常处理
- QThread::create 似乎没有将参数传递给函数
- 为什么"non-standard syntax; use '&' to create a pointer to member"在 CTOR 中使用线程?
- QThread::create running on UI Thread
- 空指针(为缺少的输出数组调用的 create() 在 create,文件 /home/m/OpenCV/modules/
- 使用宏替换工厂模式样式 API 中的"create()"函数
- 错误:'create'不是 'cv::Tracker' 的成员
- Gtk::Main 和 Gtk::Application::create 有什么区别?
- 如果它被定义为 C++ 类中的成员函数,我得到了"non-standard syntax; use '&' to create a pointer to member"
- 使用yaml :: emitter将嵌套地图和序列编写到yaml文件
- libgit2:git_clone() 失败并出现"failed to create ssl object"错误
- 使用c_str时"Use & to create a pointer to a member"
- OGRE-找不到请求的发射极类型.在promentystemmanager中:: _ create -emitter
- Visual Studio 2015:获取"non standard syntax, use '&' to create a pointer to member"错误
- MinGW在代码块中构建时的ar.exe "could not create temporary file whilst writing archive: no more archived files
- Create Eigen::Ref from std::vector
- B2Shape等于0xCDCDCDCD,并在Create灯具时抛出异常
- QThread 中的 QTcpSocket 将提交事务,但当 Write 被调用时"Cannot create children for a parent that is in a different