package sg.test;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.jmex.physics.DynamicPhysicsNode;
import com.jmex.physics.StaticPhysicsNode;
import com.jmex.physics.geometry.PhysicsBox;
import com.jmex.physics.util.SimplePhysicsGame;

public class PhysicsTest extends SimplePhysicsGame {
	
    protected void simpleInitGame() {
        StaticPhysicsNode staticNode = getPhysicsSpace().createStaticNode();
        rootNode.attachChild( staticNode );
        PhysicsBox floorBox = staticNode.createBox( "floor" );
        floorBox.getLocalScale().set( 10, 0.5f, 10 );
        DynamicPhysicsNode dynamicNode = getPhysicsSpace().createDynamicNode();
        rootNode.attachChild( dynamicNode );
        dynamicNode.createBox( "falling box" );
        dynamicNode.getLocalTranslation().set( 0, 5, 0 );
        showPhysics = true;
    }

    public static void main( String[] args ) {
        Logger.getLogger( "" ).setLevel( Level.WARNING );
        PhysicsTest game = new PhysicsTest();
        game.setConfigShowMode(ConfigShowMode.AlwaysShow);
        game.start();
    }
}