geting node by name
geting node by name
I have small question.How can i get scene node from irr file, by name?
thanks for answers
thanks for answers
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
OK i reduced my problems to one.
and this is error:
main.cpp(105) : error C2450: switch expression of type 'irr::scene::ISceneNode *' is illegal
Help me please
Code: Select all
scene::ISceneNode * node = node;
scene::ITriangleSelector * selector = 0;
switch(smgr->getSceneNodeFromName(node->getName(), node))
{
case scene::"room":
selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break;
main.cpp(105) : error C2450: switch expression of type 'irr::scene::ISceneNode *' is illegal
Help me please
wow, that's very bad, maybe (for sure) you should do some C/C++ research !?!?!koso wrote:OK i reduced my problems to one.and this is error:Code: Select all
scene::ISceneNode * node = node; scene::ITriangleSelector * selector = 0; switch(smgr->getSceneNodeFromName(node->getName(), node)) { case scene::"room": selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node); break;
main.cpp(105) : error C2450: switch expression of type 'irr::scene::ISceneNode *' is illegal
Help me please
Code: Select all
scene::ISceneNode * node = node;
Code: Select all
switch(smgr->getSceneNodeFromName(node->getName(), node))
well, you could if you cast the pointer, but that's not what you want...
also why do you search for the node by name when you already have the node !?!?!
Code: Select all
case scene::"room":
I'm not sure what you want to do, but I guess something like this:
Code: Select all
// scene::ISceneNode * node = node; // wrong and not needed !!!
scene::ITriangleSelector * selector = 0;
if(core::stringc(node->getName()).equals_ignore_case("room"))
{
selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
}
and please do yourself a favour and grab some C/C++ book and do some learning !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
i missed. i have nodes there.Acki wrote:
this is bad, you're using the same variable name two times, also why do you dublicate the node, having it once is enough !!!Code: Select all
scene::ISceneNode * node = /////node/////;
you should read irr example 15 and then you realize what i want.I want get scene node by name from irrEdit file.
i missed. i have nodes there.Acki wrote:
this is bad, you're using the same variable name two times, also why do you dublicate the node, having it once is enough !!!Code: Select all
scene::ISceneNode * node = /////node/////;
you should read irr example 15 and then you realize what i want.I want get scene node by name from irrEdit file.
and that "room" is name of node wich i want get from scene
and where do this nodes come from ???koso wrote:i missed. i have nodes there.
even if you have this nodes, then you already have a node, so no need to dublicate the pointer...
I thought so, but that doesn't change the fact that scene::"room" is illegal !!!koso wrote:and that "room" is name of node wich i want get from scene
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
and how did you get those nodes ???koso wrote:there are loop wich test all nodes in scene."nodes" is from that loop.
maybe show the complete loop and how you get this array...
well, let's assume you realy got this array correctly:
Code: Select all
scene::ITriangleSelector * selector = 0;
if(core::stringc(nodes[i]->getName()).equals_ignore_case("room"))
{
selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)nodes[i])->getMesh(), nodes[i]);
}
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java