this is my problem:
I inizialize scenemanager, driver and device in main method as follow:
Code: Select all
device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800, 600),16, false, false, false);
driver = device->getVideoDriver();
smgr = device->getSceneManager();
MyEventReceiver receiver;
device->setEventReceiver(&receiver);
Code: Select all
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT&&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_4:
{
miamano = new Hand(smgr,"F:/GCT/Progetto/HandModel",false);
break;
}
case KEY_KEY_5:
{
if (miamano != NULL)
{
delete miamano;
miamano = NULL;
}
break;
}
case KEY_KEY_6:
{
miamano->setVisibile(!miamano->isVisible());
break;
}
return true;
}
}
return false;
}
};
The Hand's costructor is:
Code: Select all
{
//Check if model directory is right terminated
if (ModelDir.size() != 0)
{
c8 last = ModelDir[ModelDir.size()-1];
if (last != SLASH) ModelDir.append(SLASH);
}
try
{
//Building Hand Model
//ROOT
V2Grp01 = smgr->addEmptySceneNode();
V2Grp01->setName(L"V2Grp01");
V2Grp01->setVisible(this->startVisible);
scene::ISceneNode* dad_GROUND01 = smgr->addEmptySceneNode();
dad_GROUND01->setName(L"dad_GROUND01");
scene::ISceneNode* GROUND01 = smgr->addEmptySceneNode();
GROUND01->setName(L"GROUND01");
dad_Palm01 = smgr->addEmptySceneNode();
dad_Palm01->setName(L"dad_Palm01");
scene::ISceneNode* Palm01 = smgr->addEmptySceneNode();
Palm01->setName(L"Palm01");
//PALM
scene::ISceneNode* dad_Palm02 = smgr->addEmptySceneNode();
dad_Palm02->setName(L"dad_Palm02");
scene::ISceneNode* VIFS16 = smgr->addOctTreeSceneNode( smgr->getMesh((ModelDir + "VIFS16.3ds").c_str())->getMesh(0,255));
VIFS16->setName(L"VIFS16");
..........
Code: Select all
node = smgr->addTestSceneNode();
Code: Select all
node = smgr->addEmptySceneNode();