LONDON — For a show that celebrates fantasy, “Charlie and the Chocolate Factory” doesn’t put much trust in its audience’s imagination. This blindingly flashy new musical, which opened on Tuesday night at the Theater Royal, Drury Lane, is as jammed with games and gadgets as a Toys “R” Us warehouse. Behemoth playthings are forced upon you in such relentless abundance that you wind up feeling like a spoiled, benumbed child on Christmas morning, drowning in a sea of presents and yearning to flee back to bed.

Giant Rube Goldberg-like contraptions, landscapes that suggest Disney doing Dalí, elaborate video simulations, costumes that inflate and glow in the dark, automaton squirrels and “Jetsons”-style robots: the visual spectacle never stops in the second act of this cluttered adaptation of Roald Dahl’s 1964 novel for children. (Pretty much nothing happens in the first act, but more on that later.) Like the greedy little youngsters it portrays, who meet dire fates in a candy factory run by one Willy Wonka (Douglas Hodge), this production is devoured by people-eating gimmicks.

Such excesses were perhaps thought necessary by the creators of “Charlie,” which includes the Academy Award-winning director Sam Mendes (“American Beauty” and the Bond movie “Skyfall,” which feels like appropriate preparation for this show) and the Tony-winning songwriters Marc Shaiman and Scott Wittman (“Hairspray”). “Charlie,” after all, follows close on the cunning little heels of “Matilda,” a highly lauded, highly successful adaptation of another Dahl novel.

It was as if, in sizing up the triumph of “Matilda,” the “Charlie” team thought, “O.K., they’ve already done clever and charming, so let’s go big and loud instead.” Never mind that Dahl’s original “Charlie,” like “Matilda,” champions the virtues of quiet inventiveness over attention-seeking boisterousness. This is a show that would appeal less to its title character — a good little chap of teeming depths (brightly played by the clear-voiced Jack Costello the night I saw the show) — than to the overindulged, easily bored brats who share the stage with him.

The spectacular comeuppance of these horrid young things has always been a large part of the appeal of “Charlie,” which inspired two movies, in 1971 (as “Willy Wonka & the Chocolate Factory”) and in 2005. The gleefully named Augustus Gloop, Veruca Salt, Violet Beauregarde and Mike Teavee — who compete with Charlie in a contest to win a lifetime supply of candy — suggest a pageant of Four Deadly Sins for the prepubescent set, or a latter-day variation on the cautionary tales in “Shock-Headed Peter,” the 19th-century classic of the macabre.

Their characters have been tweaked for contemporary consumption in this version, which features a book by David Greig, so that the bubble-gum-addicted Veruca is now a baby rap star, with her own television show, while the violence-prone, television-fixated Mike has inevitably graduated to video games and Ritalin.

But they remain appropriately obnoxious emblems of the kind of children’s attitudes Dahl most despised, including the feeling of entitlement — that the world was created solely for their entertainment. For all their sound and fury, they’re essentially passive creatures, who expect every wish to be acted upon by obliging grown-ups.

Charlie, who lives in a rubbish dump with his poor but jolly extended family, is a fantasist and inventor who has the artist’s transformative touch. (Each child role, like the title part in “Matilda,” is played in rotation by three or four performers.) This makes him a kindred spirit to the mysterious, reclusive Willy Wonka, who lives to come up with new kinds of candy.

It’s not easy to portray the workings of imagination onstage. Though this musical features a couple of sequences in which Willy or Charlie sketches ideas into existence (via Jon Driscoll’s charming projections), mostly we’re presented with fantasies as faits accomplis.

These assume the form of intricate, gaudy set pieces in which the scenery performs more than the cast members. (Mark Thompson is the exhaustingly fertile set and costume designer.) Even the show’s most invigorating musical sequences — in which the dwarfish factory workers known as the Oompa-Loompas ply their trade — are notable for the stunt merging of people with puppets.

The sense of human passivity takes literal form in the first act, which may feature the longest buildup to a star entrance in musicals. The show begins with an animated documentary about the history of chocolate, then spends much of its time with Charlie and his two sets of grandparents (Nigel Planer, Roni Page, Billy Boyle and Myra Sands).

The old folks haven’t left their beds in decades, and their early musical numbers pose a special challenge for the choreographer, Peter Darling (“Billy Elliot,” “Matilda”), whose immense talents are squandered throughout the show. Charlie’s mom and dad (Alex Clatworthy and Jack Shalloo) hang around singing wistfully and looking virtuous and sad.

The liveliest (and shrillest) sequences here involve the introduction of Charlie’s rivals-to-be in the contest sponsored by Willy Wonka. They are seen being interviewed for television, and they appear live within the frame of a mega-screen. You may feel they never entirely step out from that distancing frame.

An hour into the show, Willy finally appears in the person of Mr. Hodge, the Tony-winning star of the revival of “La Cage aux Folles,” who was seen last season on Broadway as Cyrano de Bergerac. Mr. Hodge is an actor of prodigious daring and resourcefulness, powers that are sorely tested here.

Dahl’s Willy is a complex, forbidding figure, who embodies the artist’s oblivious self-centeredness as well as creative élan. Johnny Depp took the part to fascinatingly creepy extremes in Tim Burton’s 2005 film version, in a performance that brought to mind the Peter Pan insularity of Michael Jackson. Mr. Hodge seems torn by conflicting obligations to be both a crowd-wowing song-and-dance man and an abstracted, ambivalent introvert, and he never quite delivers a finished character.

Similarly, Mr. Shaiman’s score often feels paralyzed by opposing urges to be creepy and cheery. There’s a lot of musical vamping, especially in the first act, which confirms a sense that we’re just marking time.

Thereafter there are lots of swirling cosmos-surfing melodies — such as you often hear in big-budget fantasy movies — and the satirical pastiches for the solos by the naughty children and their parents. (Iris Roberts is amusing as Mike Teavee’s nervous wreck of a mother.)

The music is most interesting when it’s most angry and aggressive, as in the songs of the Oompa-Loompas. You get the impression that, despite their fixed grins, they’re poised for revolution. No wonder. The final vision of “Charlie” is of the bleak, multiwindowed facade of Willy’s factory, looking like a Dickensian prison.

That sure doesn’t say escapism to me. Perhaps the show’s creators are making a point about how creativity isolates its possessors. Even flying through the air in a magical glass elevator (which received its own entrance applause), Willy and Charlie come across as prisoners, unable to break out into the real world. Like the show as a whole, they’re trapped in the machinery.

“Charlie” runs through next May 31, at Royal Theater, Drury Lane, London; charlieandthechocolatefactory.com.