Jump to content

[SOLVED] World getNodes


photo

Recommended Posts

Hi again,

Im wondering if anyone has had any success using this C++ call (getNodes in the World Class)? Ive not had any success and it seems to fail with an exception (bad memory access) when trying to use it.

If anyone has used this successfully, could you paste a sample of use? Thanks in advance.

 

Cheers,

Dave

Link to comment
  • 3 weeks later...
  • 3 years later...
Can "World::getNodes" or "World::get()->getNode" work properly? 
 
The C++ codes like:
 
Vector< Ptr<Node> > nodes;
World::get()->getNodes(nodes);
 
Ptr<Node> node = World::get()->getNode(0);
 
I've not had any success either.

 

My version is Unigine SDK 2.3.1.

 

Thanks

David

Link to comment

Hi lin.xianming,

 

As long as I know there was an issue with World::getNodes() and similar methods in 2.3.1 - you can get a crash in some cases.

If you encountered a crash, as a temporary workaround, try calling reserve() on a vector before passing it to the getNodes() method.

This issue will be fixed in upcoming 2.4.

Other than that it works as expected, that is it fills a vector with references to all nodes currently managed by the World.

 

World::getNode() works fine for me as well, but you should take into account that this method expects a node identifier as an argument.

Node identifier is displayed in the "Nodes" window in the editor, also you can find it in the .world file.

 

If none of that helps, please provide us with more details on your problem, small test scene will be very useful.

Thanks!

Link to comment
×
×
  • Create New...