Jump to content

[SOLVED] World getNodes


photo

Recommended Posts

Posted

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

  • 3 weeks later...
Posted

Yep, our developers did it when new functionality was tested. We'll add an example, possibly in the next SDK.

Posted

Thanks. Looking forward to the API improvements - its looking very good so far.

Cheers,

Dave

  • 3 years later...
Posted
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

Posted

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!

×
×
  • Create New...