Hi,
Wenn ich es so mache wie frodenius dann bekomm ich folgende Fehler:
Zitat:
main.cpp: In function `int main()':
main.cpp:55: error: no matching function for call to `irr::scene::IAnimatedMeshSceneNode::addChild(irr::scene::IAnimatedMesh*&)'
R:/irrlicht-1.3/include/ISceneNode.h:223: note: candidates are: virtual void irr::scene::ISceneNode::addChild(irr::scene::ISceneNode*)
Hier mal der Quellcode:
Code:
#include <irrlicht.h>
#include <iostream>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice *device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(1280, 1024),32, true, true,true,0);
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
device->setWindowCaption(L"Test");
device->getFileSystem()->addZipFileArchive
("./Data/map1.pk3");
scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp");
scene::ISceneNode* q3node = 0;
if (q3levelmesh)
q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0));
scene::ITriangleSelector* selector = 0;
if (q3node)
{
q3node->setPosition(core::vector3df(-1370,-130,-1400));
}
device->getCursorControl()->setVisible(false);
video::SMaterial material;
material.Textures[0] = driver->getTexture("./Data/faerie2.bmp");
material.Lighting = true;
scene::IAnimatedMeshSceneNode* node = 0;
scene::IAnimatedMesh* faerie = smgr->getMesh("./Data/faerie.md2");
node = smgr->addAnimatedMeshSceneNode(faerie);
node->setPosition(core::vector3df(-70,0,-90));
node->setMD2Animation(scene::EMAT_RUN);
node->addChild(faerie);
node->setVisible(false);
node->getMaterial(0) = material;
material.Textures[0] = 0;
material.Lighting = true;
smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
video::SColorf(1.0f,1.0f,1.0f,1.0f),
600.0f);
scene::ISceneNode* selectedSceneNode = 0;
scene::ISceneNode* lastSelectedSceneNode = 0;
int lastFPS = -1;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
smgr->drawAll();
core::line3d<f32> line;
core::vector3df intersection;
core::triangle3df tri;
smgr->getSceneCollisionManager()->getCollisionPoint(line, selector, intersection, tri);
driver->setTransform(video::ETS_WORLD, core::matrix4());
driver->setMaterial(material);
driver->endScene();
}
device->drop();
return 0;
}
Der Code sieht ein bisschen komisch aus da ich mit dem Code aus den Tutorials rumspiele!
Danke für euere Hilfe,
MFG ReduX