Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _callViewModel           = new CallViewModel(CoreApplication.MainView.CoreWindow.Dispatcher);
            this.DataContext         = _callViewModel;
            _callViewModel.PeerVideo = PeerVideo;

            // We don't render our own video
            //_callViewModel.SelfVideo = SelfVideo;
        }
Exemplo n.º 2
0
        protected override async void Start()
        {
            // Create a basic scene, see StereoApplication
            base.Start();

            _callViewModel = new CallViewModel(
                CoreApplication.GetCurrentView().Dispatcher);

            // Enable input
            EnableGestureManipulation = true;
            EnableGestureTapped       = true;

            // Create a node for the Earth
            _earthNode          = Scene.CreateChild();
            _earthNode.Position = new Vector3(0, 0, 1.5f);
            _earthNode.SetScale(0.3f);

            DirectionalLight.Brightness = 1f;
            DirectionalLight.Node.SetDirection(new Vector3(-1, 0, 0.5f));

            var earth = _earthNode.CreateComponent <Sphere>();

            _earthMaterial = ResourceCache.GetMaterial("Materials/Earth.xml");
            earth.SetMaterial(_earthMaterial);

            var moonNode = _earthNode.CreateChild();

            moonNode.SetScale(0.27f);
            moonNode.Position = new Vector3(1.2f, 0, 0);

            var moon = moonNode.CreateComponent <Sphere>();

            moon.SetMaterial(ResourceCache.GetMaterial("Materials/Moon.xml"));

            // Register Cortana commands
            await RegisterCortanaCommands(new Dictionary <string, Action>
            {
                // Play animations using Cortana
                { "Call", () => CallPeer() }
            });

            // Run a few actions to spin the Earth, the Moon and the clouds.
            await TextToSpeech("Hello world from UrhoSharp!");
        }