Edit:
Ignore post, contains bad ideas.
Volker wrote:
Although I could hardly reproduce the problem, it's true that there would be a problem for not only perpendicular rays but also for those which are parallel to the Z-Axis. So I think the following patch should solve this issue. Could anyone confirm this?
So, refactoring is sufficiently completed
Test results:
I had to change all abs calls with fabs calls for gcc otherwise it would not compile (abs is only defined for int and long long).
Further I had to comment out the Liang-Barsky algorithm and use t1 = 0, t2 = 1. That's bad for performance but shouldn't be any problem, or am I missing something?
Then it worked even for test vectors like (0, -10000, 0).
Direction vectors like (10000, 0, 0) or (0, 0, 10000) work, too.
Another change in "check for perpendicular ray": the intersection Position is not returned. I added the line
Code:
intsPos = _absTrans * Vec3f(orig.x, height1, orig.z);