Another Youtube video? Yeah I know. This one explains how gravity works in Super Mario Galaxy. It’s 29 minutes long. The basic gist is, there are eight kinds of invisible gravity field objects, based off of simple shapes, in the game, which are used in concert to create the various orientations that Mario switches to as he moves around: Parallel, Sphere, Cube, Disk, Torus, Cylinder, Wedge, Wire (basically an arbitrary path in space), and Cone, which is only used in two places.
An interesting fact from near the end of the video: gravity affects Mario’s shadow! Shadows point towards where Mario will fall, not according to how light strikes him, to give players a sense of where he is spatially in 3D space.
How Spherical Planets Bent the Rules in Super Mario Galaxy (Youtube, 30 minutes)