2012/6/13 Nozomi Kodama <nozomi.kod...@yahoo.com>: >>>2012/6/12 Nozomi Kodama <nozomi.kod...@yahoo.com>: >>> >>> + if ( (pq->w >= 1.0f) || (pq->w == -1.0f) ) >> >>I think the second comparison should be '<=', if you want to avoid getting >> NaNs. > > I checked in Vista. D3DX accepts -1.0f as input and returns what the patch > does. > > However, any value < -1.0f is a unacceptable value for D3DX ( D3DX returns > (-1#IND00,-1#IND00,-1#IND00,-1#IND00) ). > > > Best regards > Nozomi
Oh, so it actually returns NaNs. Interesting... So the patch is fine as it is. Maybe you could try to add such a case to the tests, if it doesn't get too tricky. You could check for something like gotquat.x != gotquat.x, which should return true only if gotquat.x is NaN.