Keep rotations between -180 and 180 degrees

Float numbers get rather sparse when their values are high. Therefore,
rotations shouldn't be larger than 180.f or smaller than -180.f.