Forráskód Böngészése

small code cleanup

vpenades 2 éve
szülő
commit
694258573c

+ 0 - 7
MonoScene.sln

@@ -35,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo3", "demos\Demo3\Demo3.
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo4.VR", "demos\Demo4.VR\Demo4.VR.csproj", "{E33A8290-FFD1-44DF-B095-FF7002BE8CFE}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoSceneViewer", "demos\MonoSceneViewer\MonoSceneViewer.csproj", "{FE00A03E-5C60-4722-8DE2-B3705FB9845B}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonoScene.Pipeline.Assimp", "src\MonoScene.Pipeline.Assimp\MonoScene.Pipeline.Assimp.csproj", "{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}"
 EndProject
 Global
@@ -89,10 +87,6 @@ Global
 		{E33A8290-FFD1-44DF-B095-FF7002BE8CFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E33A8290-FFD1-44DF-B095-FF7002BE8CFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E33A8290-FFD1-44DF-B095-FF7002BE8CFE}.Release|Any CPU.Build.0 = Release|Any CPU
-		{FE00A03E-5C60-4722-8DE2-B3705FB9845B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{FE00A03E-5C60-4722-8DE2-B3705FB9845B}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{FE00A03E-5C60-4722-8DE2-B3705FB9845B}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{FE00A03E-5C60-4722-8DE2-B3705FB9845B}.Release|Any CPU.Build.0 = Release|Any CPU
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -113,7 +107,6 @@ Global
 		{92F7F12B-F434-4396-AA57-1A3D4DF63F4B} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
 		{2BD342D9-5E43-497C-930C-7576376F6B91} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
 		{E33A8290-FFD1-44DF-B095-FF7002BE8CFE} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
-		{FE00A03E-5C60-4722-8DE2-B3705FB9845B} = {CB3349D6-3282-49BC-87BC-3EA128FAE922}
 		{CC274EDC-1D0D-4BAB-AB9B-26077CE7874B} = {D3CE88C7-E423-42EF-B869-C233AE360D89}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution

+ 3 - 11
demos/Demo4.VR/VRGameDemo.cs

@@ -11,10 +11,6 @@ using Microsoft.Xna.Framework.Input.Oculus;
 
 namespace Primitives3D
 {
-    /// <summary>
-    /// This sample shows how to draw 3D geometric primitives
-    /// such as cubes, spheres, and cylinders.
-    /// </summary>
     public class VRGameDemo : Microsoft.Xna.Framework.XRGame
     {
         #region Lifecycle
@@ -30,9 +26,9 @@ namespace Primitives3D
         {
             base.LoadContent();
 
-            var gltfScene = new VRSceneDemo(this);
-            gltfScene.Initialize();
-            this.Components.Add(gltfScene);
+            var component = new VRSceneDemo(this);
+            component.Initialize();
+            this.Components.Add(component);
         }
 
         #endregion                
@@ -151,8 +147,4 @@ namespace Primitives3D
 
         #endregion
     }
-
-    
-
-
 }

+ 6 - 26
demos/Demo4.VR/XRGame.cs

@@ -91,10 +91,10 @@ namespace Microsoft.Xna.Framework
 
         #region Draw
 
-        protected virtual void DrawStereo(GameTime gameTime, Vector3 cameraPosition, out Matrix left, out Matrix right)
+        protected virtual void DrawStereo(GameTime gameTime, Vector3 cameraPosition, out Matrix leftView, out Matrix rightView)
         {
-            left = Matrix.Identity;
-            right = Matrix.Identity;
+            leftView = Matrix.Identity;
+            rightView = Matrix.Identity;
 
             if (!ovrDevice.IsConnected) return;
 
@@ -115,8 +115,8 @@ namespace Microsoft.Xna.Framework
                 Matrix globalWorld = Matrix.CreateWorld(cameraPosition, Vector3.Forward, Vector3.Up);
                 view = Matrix.Invert(globalWorld) * view;
 
-                if (eye == 0) left = view;
-                if (eye == 1) right = view;
+                if (eye == 0) leftView = view;
+                if (eye == 1) rightView = view;
 
                 DrawScene(gameTime, view, (near, far) => ovrDevice.CreateProjection(eye, near, far));
 
@@ -130,27 +130,7 @@ namespace Microsoft.Xna.Framework
             int result = ovrDevice.EndFrame();            
 
             return;
-        }
-
-        protected virtual void DrawPreview()
-        {
-            // draw on PC screen
-            GraphicsDevice.SetRenderTarget(null);
-            GraphicsDevice.Clear(Color.Black);
-
-            // preview VR rendertargets
-            var pp = GraphicsDevice.PresentationParameters;
-            int height = pp.BackBufferHeight;
-            float aspectRatio = (float)ovrDevice.GetEyeRenderTarget(0).Width / ovrDevice.GetEyeRenderTarget(0).Height;
-
-            /*
-            int width = Math.Min(pp.BackBufferWidth, (int)(height * aspectRatio));
-            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive);
-            spriteBatch.Draw(ovrDevice.GetEyeRenderTarget(0), new Rectangle(0, 0, width, height), Color.White);
-            spriteBatch.Draw(ovrDevice.GetEyeRenderTarget(1), new Rectangle(width, 0, width, height), Color.White);
-            spriteBatch.End();
-            */
-        }
+        }        
 
         protected virtual void DrawScene(GameTime gameTime, Matrix view, ProjectionDelegate projection)
         {

+ 1 - 1
demos/MonoSceneViewer/MonoSceneViewer.csproj

@@ -10,7 +10,7 @@
   <ItemGroup>
     <PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.1.2082-develop" />
     <PackageReference Include="PropertyTools.Wpf" Version="3.1.0" />
-    <PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0-alpha0026" />    
+    <PackageReference Include="SharpGLTF.Toolkit" Version="1.0.0-alpha0027" />    
   </ItemGroup>
 
   <ItemGroup>