Esempio n. 1
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);

#if !UWP
            this.EntityManager.Remove("CameraRig");

            FreeCamera3D mainCamera = new FreeCamera3D("main", Vector3.Zero, -Vector3.UnitZ);
            this.EntityManager.Add(mainCamera);
#endif
        }
Esempio n. 2
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);

            PhysicsManager.Simulation3D.Initialize();
            PhysicsManager.Simulation3D.Gravity       = Vector3.Zero;
            PhysicsManager.Simulation3D.FixedTimeStep = 0.001f;

            PhysicsManager.Simulation3D.OnPhysicStep += OnPhysicStep;

            // Where the camera is placed on the world
            var position = new Vector3(0, 0, 2.5f);
            // Where the camera is looking at
            var lookAt = Vector3.Zero;
            var camera = new FreeCamera3D("MainCamera", position, lookAt)
            {
                BackgroundColor = Color.CornflowerBlue
            };

            this.EntityManager.Add(camera.Entity);
        }
Esempio n. 3
0
        protected override void CreateScene()
        {
            Matrix m = Matrix.Identity;

            Vector3 forward  = m.Forward;
            Vector3 backward = m.Backward;


            //WaveServices.ScreenContextManager.SetDiagnosticsActive(true);

            this.Load(WaveContent.Scenes.MyScene);

            var vrCamera = this.EntityManager.Find("VRCamera");

            this.cameraRig            = vrCamera.FindComponent <VRCameraRig>();
            cameraRig.Monoscopic      = false;
            cameraRig.VRMode          = VRMode.AttachedMode;
            cameraRig.BackgroundColor = Color.CornflowerBlue;

            var cardboard = new CardboardVRProvider()
            {
                IsBarrelDistortionEnabled = true,
                IsNeckDisplacementEnabled = true,
            };

            vrCamera.AddComponent(cardboard);

            FreeCamera3D freeCamera3D = new FreeCamera3D("freeCam", Vector3.One * 4, Vector3.Zero);
            var          cam3D        = freeCamera3D.Entity.FindComponent <Camera3D>();

            cam3D.Viewport    = new Viewport(0, 0, 0.2f, 0.2f);
            cam3D.ClearFlags  = ClearFlags.DepthAndStencil;
            cam3D.CameraOrder = 10;

            this.EntityManager.Add(freeCamera3D);

            ////var oculus = new OculusVRProvider()
            ////{
            ////    ShowHMDMirrorTexture = true
            ////};

            ////vrCamera.AddComponent(oculus);

            var leapMotionService = new LeapMotionService();

            WaveServices.RegisterService(leapMotionService);
            leapMotionService.StartSensor(LeapFeatures.Hands | LeapFeatures.HMDMode);

            ////this.toggleSwitch = new ToggleSwitch();
            ////this.toggleSwitch.Toggled += toggleSwitch_Toggled;

            ////this.EntityManager.Add(this.toggleSwitch);

            ////videos = new VideoInfo[2];


            ////WaveServices.VideoPlayer.Play(videos[0]);
            ////WaveServices.VideoPlayer.IsLooped = true;

            ////var screenMaterial = this.Assets.LoadModel<MaterialModel>(WaveContent.Assets.Material.TVScreenMaterial);
            ////(screenMaterial.Material as StandardMaterial).Diffuse = WaveServices.VideoPlayer.VideoTexture;
        }