When I write the same exact code in the main instead of in the class, it works fine.
CUnit.h
Code: Select all
class CUnit{
private:
scene::ISceneManager * smgr;
public:
scene::IAnimatedMeshSceneNode * node;
CUnit(IrrlichtDevice * device);
void remove();
};
Code: Select all
CUnit::CUnit(IrrlichtDevice * device)
{
smgr=device->getSceneManager(); node=smgr->addAnimatedMeshSceneNode(smgr->getMesh("media/models/FurbolgPanda/furbolgStand.MD3"));
node->setPosition(vector3df(0,0,0));
node->setScale(vector3df(0.045f,0.045f,0.045f));
node->setMaterialFlag(video::EMF_LIGHTING,false);
node->setAnimationSpeed(10.f);
}
void CUnit::remove()
{
node->remove();
}
Code: Select all
CUnit creepUnit=CUnit(device);
creepUnit.remove();