Ejemplo n.º 1
0
        public override void Init()
        {
            Node floor = (Node)AssetManager.LoadModel(AssetManager.GetAppPath() + "\\models\\scene.apx");

            rootNode.AddChild(floor);
            PhysicsWorld.AddObject(floor, 0);


            Node n = (Node)AssetManager.LoadModel(AssetManager.GetAppPath() + "\\models\\sphere16.obj");

            n.SetLocalTranslation(new Vector3f(0, 50, 0));
            rootNode.AddChild(n);
            //PhysicsWorld.AddObject(n, 1);
            PhysicsWorld.AddCharacter((DefaultCamera)cam, InputManager, n, 1);
        }
Ejemplo n.º 2
0
        public override void Init()
        {
            ShadowMappingComponent smc;

            RenderManager.AddComponent(smc = new ShadowMappingComponent(cam, Environment, new int[] { 2048, 1024 }));
            smc.RenderMode = ShadowMappingComponent.ShadowRenderMode.Forward;



            //  Node floor = (Node)AssetManager.LoadModel(AssetManager.GetAppPath() + "\\models\\scene.apx");
            //  rootNode.AddChild(floor);
            //  PhysicsWorld.AddObject(floor, 0);
            Geometry cube = new Geometry(MeshFactory.CreateCube(new Vector3f(-15, -0.5f, -15f), new Vector3f(15f, 0.5f, 15f)));

            rootNode.AddChild(cube);
            PhysicsWorld.AddObject(cube, 0);

            Node n = (Node)AssetManager.LoadModel(AssetManager.GetAppPath() + "\\models\\monkeyhq.obj");

            n.SetLocalTranslation(new Vector3f(0, 50, 0));
            rootNode.AddChild(n);
            //PhysicsWorld.AddObject(n, 5, Scene.Physics.PhysicsWorld.PhysicsShape.Box);
            PhysicsWorld.AddCharacter((DefaultCamera)cam, InputManager, n, 1);
        }