public void setPitch( float pitch )
    {
        if ( pitch < 0 )
        {
            pitch += 360f; // unnegativize(TM) the number
        }
        pitch %= 360; // get the number within 0-359

        // the pitch is out of range
        if ( ( pitch > minPitch ) && ( pitch < maxPitch ) )
        {

            // set the pitch to the nearest boundary
            if ( pitch >= 180 )
            {
                pitch = maxPitch;
            }
            if ( pitch < 180 )
            {
                pitch = minPitch;
            }
        }
        this.pitch = pitch;
    }