Actor Jamie Foxx performs at the 2009 Wango Tango concert in Irvine, California May 9, 2009. REUTERS/Mario Anzuoni

Jamie Foxx is joining the cast of Due Date, a road-trip comedy from The Hangover director Todd Phillips.

Foxx joins Robert Downey Jr. and Zach Galifianakis in the Warner Bros. movie about a high-strung father-to-be (Downey) who's forced to hitch a ride with a college slacker (Galifianakis) to make it to the birth on time.

Foxx will play Downey's longtime pal who once dated his wife (Michelle Monaghan) and secretly keeps in touch with her.

Foxx next stars in the thriller Law Abiding Citizen and recently wrapped the romantic comedy Valentine's Day.