chSoftwareRenderer/chMathUtil.cpp
//get in -pi to pi range
get in -pi to pi range
get in - pi to pi range
float chWrapPi(float rads)
{
	if(rads >= -CH_PI && rads<= CH_PI)
	{
		return rads;
	}
	rads += CH_PI;
	rads -= floor(rads*CH_1overPI*0.5f)*CH_2PI;
	rads -= CH_PI;
	return rads;
}
float chWrapPi ( float rads ) { if ( rads >= - CH_PI && rads <= CH_PI ) { return rads ; } rads += CH_PI ; rads -= floor ( rads * CH_1overPI * 0.5f ) * CH_2PI ; rads -= CH_PI ; return rads ; }
get in -pi to pi range
get in - pi to pi range