Optical geometry for gravitational collapse and Hawking radiation