This toy needs WebGL, which this browser has turned off.
The mule's outline is traced from the brand mark, filled with about 7,900 points and triangulated. Each point knows how far it sits from the edge, and that distance decides how much it puffs out. Ears and legs round off, while the body stays flat on the sides like a real piñata.
Every new piñata is cut into about twenty random pieces with a Voronoi pattern. A hit dents the paper under the stick and wears down the pieces around it. When one gives, it drops away as its own rigid body, and anything no longer connected to the rope goes with it.
The mule and every loose piece are rigid bodies solved with position based dynamics: eight substeps a frame, a rope that can go slack, and floor contact with friction. Sweets and confetti pile up on a height map.
The fringe is painted onto a canvas when the page loads and used for both colour and bump, projected across the shell so the rows wrap around every edge.
Scale: the mule is 90 cm tall and weighs about 1.7 kg with its sweets inside. Drag empty space to walk around it, scroll to step closer.