dave.lannan Posted February 6, 2013 Share Posted February 6, 2013 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
manguste Posted February 22, 2013 Share Posted February 22, 2013 Yep, our developers did it when new functionality was tested. We'll add an example, possibly in the next SDK. Link to comment
dave.lannan Posted February 25, 2013 Author Share Posted February 25, 2013 Thanks. Looking forward to the API improvements - its looking very good so far. Cheers, Dave Link to comment
lin.xianming Posted January 18, 2017 Share Posted January 18, 2017 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
ded Posted January 19, 2017 Share Posted January 19, 2017 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
lin.xianming Posted January 19, 2017 Share Posted January 19, 2017 Very helpful. Thanks a lot. Link to comment
Recommended Posts