Documentation Updates After Posting Version 5.9

Previous version updates:
•  Version 5.0 to Version 5.1
•  Version 5.1 to Version 5.2
•  Version 5.2 to Version 5.3
•  Version 5.3 to Version 5.4
•  Version 5.4 to Version 5.5
•  Version 5.5 to Version 5.6
•  Version 5.6 to Version 5.7
•  Version 5.7 to Version 5.8
•  Version 5.8 to Version 5.9


May 12, 2013. Corrected the comments that describe the index output. (Thanks to Simon Flöry for reporting this.)
March 17, 2013. Added new function ComputeDistancePointToHyperbola. Added support for generating MSVS 2012 projects (v110).
March 1, 2013. The SetAlphaState function had a cut-and-paste error that sets the blend color blue channel to the green value. (Thanks to Gary Paluk for reporting this.) The FindContactSet function, line 1361, had a GetPointFromIndex function that used b0Index but should use b1Index. (Thanks to Moreno Trlin for reporting this.) Fixed a logic error in Triangles::UpdateModelTangentsUseTCoords. The last part of the loop was setting vertex attributes for index 'curr', but should have set for the associated vertex index, now in the code as 'v[curr]'. (Thanks to Nichalaus Long for reporting this.)
February 6, 2013. The GetPoint(int) function was intended to be used for returning the first point of contact between a moving segment and moving triangle (or the endpoints if the first contact is a segment). If called after the 'bool Find()' call (stationary segment/triangle), GetPoint(int) returns uninitialized data. I modified 'bool Find()' to store the point of intersection. The GetSegmentParameter() and GetTriBary?() functions were designed for you to compute the point explicitly for 'bool Find()'. The 'bool Find()' function was missing the assignment of mIntersectionType, so that was fixed. (Thanks to Sergey Maruda for reporting this problem.)
January 3, 2013. The Disable function accessed the wrong profile. (Thanks to Gary Paluk for reporting this problem.) The last loops in the SqrDistance functions had reflect[j] that should have been reflect[i]. (Thanks to Jakob Wasza for reporting this problem.)
December 15, 2012. The constructor had an initialization loop with an incorrect upper limit. (Thanks to Gary Paluk for reporting this problem.)
November 23, 2012. Added quotes to the mkdir and xcopy arguments involving the $(Configuration) macro. This avoids post-build errors when the configuration name has spaces. Created Microsoft Visual Studio 2012 project files for the main Wild Magic libraries. The DX9 library is set up to use the June 2010 DirectX SDK. Be aware that MSVS 2012 ships with the DirectX 11.1 SDK, in the "Windows Kits" folder in the "Program Files" folder. It is possible to use the June 2010 DirectX SDK with Windows 8 as long as you have the MSVS 2010 runtime installed. I will ship Wild Magic 6 that uses DirectX 11.1, but it will hook up to the Windows Kits version. I will generate MSVS 2012 project files for the samples shortly. In order to build the GLUT graphics and application projects, the GLUT files must be copied as shown next.
C:\Program Files (x86)\Windows Kits\8.0\Include\um\gl\glut.h
C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\glut.def
C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\glut32.lib
Fixed a compile issue with std::greater. In MSVS 2010 this used to be accessed by inclusion of other STL headers, but not so in MSVS 2012. I added an include of <functional> to the core library header.
November 22, 2012. Some line-object squared-distance queries used temporary line objects. The temporary objects are accessed by reference in the query objects, so use of the query objects after their construction led to dereferencing already destroyed temporary objects. (Thanks to Staruhin D. for reporting this problem.) Minor loop changes led to better performance (2- to 3-time speedup). Code comments describe the changes. (Thanks to Linus Källberg [Computer Science at Mälardalen University in Sweden] for providing this improvement.)
November 3, 2012. Small thresholds are used for testing the discriminant of the quadratic equation related to the computations: Q(t) = a2*t^2 + 2*a1*t + a0. The discriminant is D = a1*a1 - a0*a2. Q(t) has no real-valued roots when D < 0, one real-valued root when D = 0, or two real-valued roots when D > 0. The code logic involves user-defined thresholds:
  if (D < negThreshold) { no roots (no intersections) }
  else if (D > posThreshold) { two roots (two intersections) }
  else { one root (one intersection) }
The default values for the thresholds are zero, but you may set them to be nonzero (negThreshold <= 0 and posThreshold >= 0). Previously, the negative threshold was hard-coded as zero. The positive threshold was hard-coded to Math::ZERO_TOLERANCE, which is not suitable for some data sets (i.e. when ellipsoid extents are quite large). The default is now zero, so if your application relied on the old behavior, you must modify this value. (Thanks to Jonatan Leloux for reporting this bug.) The intersection testing uses the center-extent form for line segments. If you start with endpoints (Vector2<Real>) and create Segment2<Real> objects, the conversion to center-extent form can contain small numerical round-off errors. Testing for the intersection of two egments that share an endpoint might lead to a failure due to the round-off errors. To allow for this, you may specify a small positive threshold that slightly enlarges the intervals for the segments. The default value is zero. The computation for determining whether the segments are parallel might contain small floating-point round-off errors. The algorithm reduces to testing whether a dot product is zero or nonzero. You may specify a small positive threshold to adjust the test (dot == 0) to (fabs(dot) > 0). The default threshold is zero. (Thanks to Guo Xuekun for reporting this problem.) The root finder Cubic(c0,c1,c2) in the case of positive discriminant had several errors. (Thanks to Pierre-Antoine LEFRANC for reporting this bug.) Fixed a minor notational problem. Section 2 defined a point r = (y0, y1, y2). Starting with equation (10), values y0 and y1 were introduced as coefficients of a linear combination involving r, but these coefficients are not the components of r. I revised Section 2 to use r = (r0,r1,r2) in order to avoid the confusion. (Thanks to Kevin Van Workum for reporting this problem.) Equation (15) for the cubic discriminant had a typographical error in a power.
October 31, 2012. When building the control points matrix Q, the indices were swapped (mControls[i1][i0] is correct, not mControls[i0][i1]). The problem showed up for non-square grids of points. Also, the indices on mSamples[][] were swapped. These were fixed, including in GetPosition. The comments about constraints between the degrees and number of controls points was incorrect (degree* + 1 < numControls* is instead required) and the assertions in the constructor were modified accordingly. (Thanks to Andre Linarth for reporting these bugs.)
September 26, 2012. I had accidentally exposed WM5_USE_MEMORY for all configurations. This is now turned off for all configurations. You can expose it, if you prefer, for Debug configurations. Or you can add it to MSVS project configurations as desired. [The reason for turning it off is that some users were unaware of the requirements for calling Memory::Initialize and Memory::Terminate in 'main', which led to assertions triggered when dynamic memory is used pre-main or post-main. Turning it off led to fewer (incorrect) bug reports.]