ExBemined Posted May 17, 2016 Share Posted May 17, 2016 We are having some trouble with the Unigine::Object::getBodyRigid function in the C++ API in 2.2.1, it always seems to return NULL even if there is a valid body. Seems like in UniginePhysics.cpp the condition is inverted, returning a BodyRigidInterface when input is NULL and returning NULL when input is a valid BodyRigid: BodyRigidPtr api(::BodyRigid *arg) { return BodyRigidPtr(arg == NULL ? new BodyRigidInterface(arg) : NULL ); } Link to comment
silent Posted May 17, 2016 Share Posted May 17, 2016 Hi Michiel, Yes, you are absolutely right. Currently there is a wrong condition inside UniginePhysics.cpp (already fixed in our internal builds). You can revert the condition and rebuild the engine to fix this issue. Sorry for the inconvenience caused. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
nconil Posted August 4, 2016 Share Posted August 4, 2016 In the same file, there are 2 getters that do not have the 'arg != NULL' test : BodyPtr api(const ::Body *arg) { return BodyPtr(new BodyInterface(const_cast< ::Body* >(arg))); } BodyRigidPtr api(const ::BodyRigid *arg) { return BodyRigidPtr(new BodyRigidInterface(const_cast< ::BodyRigid* >(arg))); } When arg is NULL, we still receive a valid Interface, which will crash at the first function call. This is just to be sure it will also be fixed in the next release. Link to comment
silent Posted August 4, 2016 Share Posted August 4, 2016 nconil Sure, already fixed :) Thanks for noticing that! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts