Adds the functions:
Also adds two macros in vmath.h for convenience:
vzero and vcross_init
Forgot it also has the function:
fixed a bug in seg-seg intersect, which now appears to be functional, not with incredible rigor.
Hey Joe just a hand full of things that should be easy to fix:
First off some issues with the new macros you want to add to 'include/vmath.h':
For starters your VZERO macro appears to have an error, looks like you forgot the 'Z' comparison portion, but I'm more concerned with the way you are trying to get an exact zero compare with your vectors. Whenever your dealing with floating point math it's likely that some fuzz will creep due to representation error and it's probably why that particular macro doesn't exist already. I'd suggest using the VNEAR_ZERO(v,tol).
While I understand the intended use of VCROSS_INIT for variable initialization it's not really adding any new functionality. We’d almost have to turn around and do the same for all such macros essentially doubling the maintenance. In this case I’d suggest keep the declaration and the assignment separate and not to implement the VCROSS_INIT() macro.
Minor issue with formatting:
I’ll take the fall on this one Joe, I should have looked closer at the initial code snippet you sent me to review. Check out the ‘HACKING’ file at the top level of the SVN trunk or http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING. It’s an easy read with a lot of guidance recommendations. There’s a section on "Coding Styles & Standards” which has specific guidance on white-spacing.
fixed the commenting method in two comments
Since there's been no update to this patch for over a year, closing it out. Feel free to post a new patch if the problems identified are addressed.
As an added corollary, your vmath changes did prompt some consideration for initialization macros. I don't think we'll want to replicate macros that actually perform work, such as the VCROSS_INIT(), but I can see the utility in value-based initialization for vectors and matrices in particular. Thanks for prompting the idea Joe.