Intuitive theories of physics govern the everyday action of humans. Studies with children and the ability of adults to adapt to novel physical situations suggest this knowledge might be learned, but how can physics be learned? We consider different physical models of dynamic situations as generated from an underlying physical theory defined over Spelke-like objects. This allows us to go from the observed dynamics of objects (e.g. particles and positions) to the underlying physical model governing the interaction between the objects (e.g. a spring in a gravity well). The underlying theory is then used to predict and generalize object properties and interactions in new scenarios. We compare these predictions and generalizations to those of humans faced with the same unfolding dynamics. We argue that this generative model of physics can explain the ability of humans to learn and generalize novel dynamics.