Added new method setGravity.

Added type test to hasBox2DEntityRef.