Yes, that is exactly what I meant. There are already some cars that do it almost properly.
http://www.fiskerautomotive.com/ https://en.wikipedia.org/wiki/Yo-Mobile
Btw Yo-Mobile is interesting since they are using rotary engine to do power generation.