Object3D.rayIntersectsAABB question

Started by voronwe13, August 08, 2014, 08:56:25 PM

Previous topic - Next topic

voronwe13

#15
Okay, I just figured out the calcMinDistance issue....  It's related to the ignoreIfLarger variable.   Since I'm setting the origin of my ray only 10 away from the object, I just put the ignoreIfLarger as 20, since I didn't think it would need to be any larger.   If you take the test code I posted and change that value to 20, or anything less than the distance from the point to the top-left corner, you'll see what I'm talking about. 

I realize now that if I had read the documentation for it more closely, I would have picked up on that sooner.  Although it's kind of weird that it only seems to check one corner of the polygon.

EgonOlsen

I see. You don't have to be too conservative with the value that you are using for ignoreIfLarger. As a rule of thumb, take the maximum that you would expect and multiply it by 1.5.
About the AABB-issue: Congratulations! You've found a problem that lurks inside the engine for more than 10 years now. The algorithm can't deal with planes that are exactly in parallel with the direction vector. I'll add a workaround for this to the next release.

voronwe13

Cool, glad I was able to help you discover a long-hidden bug!   And now that I know what's going on with calcMinDistance, I have everything working the way I want it to.   Thanks for your help!