mirrorAngle(HALF_PI) should be -HALFPI rather than HALF_PI