Code: Select all
class PlayerMesh {
public:
IAnimatedMesh* Mesh;
IAnimatedMeshSceneNode* MeshNode;
PlayerMesh (ISceneManager*, IVideoDriver*, string, string);
};
PlayerMesh::PlayerMesh (ISceneManager* manager, IVideoDriver* drvr, string MPath, string TPath) {
Mesh = manager->getMesh(MPath);
MeshNode = manager->addAnimatedMeshSceneNode(Mesh);
MeshNode->setMaterialFlag(EMF_LIGHTING, false);
MeshNode->setMaterialTexture(0, drvr->getTexture(TPath));
Here is how it was called:
Code: Select all
PlayerMesh PMesh (smgr, driver, "c:/gamemedia/b3dtest.b3d", "c:/gamemedia/UV.jpg");
Whenever I try and run the program, I get this error:
which is in reference to the getMesh line of code.C:\game\gaim.cpp|40|error: no matching function for call to 'irr::scene::ISceneManager::getMesh(std::string&)'|
Now, I've tried changing the strings into ifstreams in stead, but all I get is this error:
Also, I use std::string in stead of just string even though I already included the std namespace because if I don't I get this error when I use it:C:\game\gaim.cpp|40|error: invalid conversion from 'void*' to 'irr::io::IReadFile*'|
C:\game\gaim.cpp|34|error: reference to 'string' is ambiguous|
Normally I would ask on a C++ forum about this, however I get the feeling that this has something to do with getMesh itself and how it is supposed to be called, which would make it an irrlicht problem. Can anyone help me with this? I have a feeling it's just a variable format problem, I just need to know the right kind to use. Now, the irrlicht API says that getMesh uses a string variable, but clearly it's not quite that simple, so what's up?
Thanks in advance.