Jump to content

C++ ObjectMeshDynamicPtr::getIntersection.


photo

Recommended Posts

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

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:

Link to comment
  • 4 weeks later...

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
×
×
  • Create New...