Animation code for a spatial class