Passivity-based Control for Hybrid Systems with Applications to Mechanical Systems Exhibiting Impacts