What is ub variable used for? #9

Closed
garfi43 opened this Issue Nov 30, 2012 · 3 comments

Comments

Projects
None yet
2 participants

garfi43 commented Nov 30, 2012

I wanted to know what is the following variable used for.

File ray2.c on line 31:

  • 31: kmScalar ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom;

It is declared and initialized but never used.

on lines 33,34

  • 33: kmScalar x = x1 + ua * (x2 - x1);
  • 34: kmScalar y = y1 + ua * (y2 - y1);

ua variable is used two times.

Was the ua variable on line 34 meant to be ub?

Owner

Kazade commented Nov 30, 2012

No, the double usage of ua is correct. However, ua and ub can be used to determine if the intersection actually happened which is what we should be doing rather than the min/max checks. I'll take a proper look when I can :)

garfi43 commented Dec 4, 2012

Thank you for your reply. Really nice library.

Owner

Kazade commented Jan 4, 2013

I finally fixed this. Latest master makes use of ub.

Kazade closed this Jan 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment