Code: Select all
IMeshSceneNode* baseNode = smgr->addMeshSceneNode(smgr->getMesh("data/base.b3d"));
....
IMeshSceneNode* flagNode = smgr->addMeshSceneNode(smgr->getMesh("data/flag.b3d"));
....
flagNode->setParent(baseNode);
cout<<"baseNode:"<<baseNode<<endl;
cout<<"flagNode:"<<flagNode<<endl;
cout<<"ParentTest:"<<flagNode->getParent()<<endl;
Code: Select all
baseNode:0x2219a78
flagNode:0x2219be0
ParentTest:0
I tried to step through this with a debugger, but at the line,
Code: Select all
flagNode->setParent(baseNode);so it wouldn't let me step into that method and see what it was doing, but after that line, the "Parent" instance variable in flagNode is still NULL.
EDIT: If anyone knows why they debugger wouldn't let me step into that method, I would appreciate it. I have no idea what an RTTI symbol is, so Im not sure if thats the reason.
EDIT2: after further investigation, I have determined the function
Code: Select all
virtual void setParent(ISceneNode* newParent)Here is a short test, can someone else confirm you get similar output?
Code: Select all
int width=800;
int height=600;
SIrrlichtCreationParameters params;
params.AntiAlias=0;
params.Bits=32;
params.DriverType=EDT_OPENGL;
params.Vsync=true;
params.WindowSize=dimension2d<u32>(width,height);
params.Fullscreen=false;
irrDevice=createDeviceEx(params);
smgr = irrDevice->getSceneManager();
ISceneNode* baseNode = smgr->addCubeSceneNode();
ISceneNode* flagNode = smgr->addCubeSceneNode();
flagNode->setParent(baseNode);
cout<<"baseNode:"<<baseNode<<endl;
cout<<"flagNode:"<<flagNode<<endl;
cout<<"ParentTest:"<<flagNode->getParent()<<endl;