Hi!

After working some time with your lib, there are a few issues I would like to tell you about:

BitStream::ReadNormQuat():

w = sqrt(1.0f - x*x - y*y - z*z);

Numerical errors can cause the expression in the sqrt to be negative, yielding undefined results or a floating point exception. A simple max(0,expr) would prevent this.

BitStream::WriteOrthMatrix():

qw = sqrt( 1 + m00 + m11 + m22 ) / 2;

qx = sqrt( 1 + m00 - m11 - m22 ) / 2;

qy = sqrt( 1 - m00 + m11 - m22 ) / 2;

qz = sqrt( 1 - m00 - m11 + m22 ) / 2;

Same as above.

qx = _copysign( qx, m21 - m12 );

qy = _copysign( qy, m02 - m20 );

qz = _copysign( qz, m20 - m02 ); // should be qz = _copysign( qz, m10 - m01 );

There are two typos in there (they are on the web page you got the code from, too, but are corrected in a later post)

The expressions should be symmetrical.

StringCompressor::EncodeString():

This should take a const char* as input.

RakPeer::PlayerIDToDottedIP():

IMHO this should be made a static function. It would be convenient to have access to this function without having a peer object around.

Hope I could help

christian