sergey.pozhidaev Posted October 17, 2014 Share Posted October 17, 2014 hi, bug in subj: int ret_surface = -1; vec3 rpt; // VARIANT 1: if(obj->getIntersection(pt1, pt2, ~0, &rpt, NULL, NULL, NULL, &ret_surface)) {...} // VARIANT 2: if(obj->getIntersection(pt1, pt2, ~0, NULL, NULL, NULL, NULL, &ret_surface)) {...} variant 2 gets bug - incorrect surface detected. Link to comment
silent Posted October 20, 2014 Share Posted October 20, 2014 Hi Sergey, Is it possible to reproduce such behavior with <SDK>\source\samples\Api\Nodes\Objects sample? I've tried to call getIntersection() diffrent ways and always get correct results. Could you please give us more details or provide a simple test scene for reproduction? Thanks! 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
sergey.pozhidaev Posted November 14, 2014 Author Share Posted November 14, 2014 <SDK>\source\samples\Api\Nodes\Objects - there is one-surface model, i used multi, with Unigine::ObjectMeshDynamicPtr Link to comment
silent Posted November 14, 2014 Share Posted November 14, 2014 Hi Sergey, Sorry, still can't reproduce. Could you please provide a minimal sample with your mesh? Thanks! 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
unclebob Posted November 14, 2014 Share Posted November 14, 2014 Hey Sergey, Could you also please tell us which version of the engine do you use? Link to comment
sergey.pozhidaev Posted November 16, 2014 Author Share Posted November 16, 2014 Unigine 2.0 alpha Binary: Windows 32bit Visual C++ 1600 Release Oct 9 2014 r15975 Link to comment
unclebob Posted November 17, 2014 Share Posted November 17, 2014 Hi Sergey! I had a look inside engine's ObjectMeshDynamic::getIntersection code and here's what I found (spoiler, it's not a bug). if you don't pass pointer to position then this method is supposed to be used only for intersection checking without getting any data from it. The algorithm will stop on the first triangle (not the closest one) that intersects the ray in that case. So I recommend you just to pass some pointer to temporary variable even if you don't want to use position data. Link to comment
Recommended Posts