Browse Source

Samples are in a separate repo, please read readme.md to set your environment.
Updated ourOwnBabylon.js and BuildOurOwnBabylonJS.exe
Fixed build of solution for different configurations

Gwenaël Hagenmuller 11 năm trước cách đây
mục cha
commit
26b4900125

+ 11 - 0
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS.sln

@@ -20,26 +20,37 @@ Global
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Debug|Any CPU.Build.0 = Debug|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Debug|Mixed Platforms.Build.0 = Debug|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Debug|x86.ActiveCfg = Debug|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Debug|x86.Build.0 = Debug|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Release|Any CPU.ActiveCfg = Release|x86
+		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Release|Any CPU.Build.0 = Release|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Release|Mixed Platforms.Build.0 = Release|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Release|x86.ActiveCfg = Release|x86
 		{0263AD0D-56E6-4439-BC05-6EC957200F52}.Release|x86.Build.0 = Release|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Debug|Any CPU.Build.0 = Debug|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Debug|Mixed Platforms.Build.0 = Debug|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Debug|x86.ActiveCfg = Debug|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Debug|x86.Build.0 = Debug|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Release|Any CPU.ActiveCfg = Release|x86
+		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Release|Any CPU.Build.0 = Release|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Release|Mixed Platforms.Build.0 = Release|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Release|x86.ActiveCfg = Release|x86
 		{93EF5B02-72EB-4B55-831E-E5051269EDA6}.Release|x86.Build.0 = Release|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Debug|Any CPU.Build.0 = Debug|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Debug|Mixed Platforms.Build.0 = Debug|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Debug|x86.ActiveCfg = Debug|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Debug|x86.Build.0 = Debug|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Release|Any CPU.ActiveCfg = Release|x86
+		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Release|Any CPU.Build.0 = Release|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Release|Mixed Platforms.ActiveCfg = Release|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Release|Mixed Platforms.Build.0 = Release|x86
 		{CFBE5149-1605-4824-8BD2-55C9B3C1DA60}.Release|x86.ActiveCfg = Release|x86

+ 1 - 4
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS.csproj.user

@@ -1,9 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
-    <StartArguments>/w:"..\..\..\..\.." /i:"..\..\ourOwnBabylonJS.xml" /s:"Babylon\Shaders" /o:"..\.."</StartArguments>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+  <PropertyGroup>
     <StartArguments>/w:"..\..\..\..\.." /i:"..\..\ourOwnBabylonJS.xml" /s:"Babylon\Shaders" /o:"..\.."</StartArguments>
   </PropertyGroup>
 </Project>

BIN
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS/executables/BuildOurOwnBabylonJS.exe


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJS/ourOwnBabylon.js


+ 1 - 1
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJSServer/BuildOurOwnBabylonJSServer.csproj

@@ -117,7 +117,7 @@
     <Content Include="Content\themes\base\jquery.ui.slider.css" />
     <Content Include="Content\themes\base\jquery.ui.tabs.css" />
     <Content Include="Content\themes\base\jquery.ui.theme.css" />
-    <Content Include="..\..\..\Samples\Scenes\**\*.*">
+    <Content Include="$(BabylonJSSamplesDirFullPath)Scenes\**\*.*">
       <Link>Content\BabylonJS-Demos\%(RecursiveDir)%(Filename)%(Extension)</Link>
     </Content>
     <Content Include="Global.asax" />

+ 9 - 0
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJSServer/Content/Web.config

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <system.webServer>
+        <staticContent>
+            <mimeMap fileExtension=".fx" mimeType="application/shader" />
+            <mimeMap fileExtension=".babylon" mimeType="application/babylon" />
+        </staticContent>
+    </system.webServer>
+</configuration>

+ 8 - 1
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJSServer/Controllers/BuildOurOwnBabylonJSController.cs

@@ -48,7 +48,14 @@ namespace BuildOurOwnBabylonJSServer.Controllers
                     break;
             }
 
-            return File(new FileStream(absPath, FileMode.Open), type);
+            try
+            {
+                return File(new FileStream(absPath, FileMode.Open), type);
+            }
+            catch
+            {
+                return new HttpNotFoundResult();
+            }
         }
     }
 }

+ 1 - 1
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJSServer/Views/BabylonJSDemo/Index.cshtml

@@ -6,7 +6,7 @@
 
 <script type="text/javascript">
     $(document).ready(function () {
-        BABYLON.SceneLoader.Load("@Html.Raw(this.BabylonJSFile("Samples/Scenes/" + (string)ViewBag.DemoFolderName))" + "@Url.Encode("/")", "@ViewBag.DemoFile", OURBABYLON.engine, function (scene) {
+        BABYLON.SceneLoader.Load("@Html.Raw(this.BabylonJSSamplesFile("Scenes/" + (string)ViewBag.DemoFolderName))" + "@Url.Encode("/")", "@ViewBag.DemoFile", OURBABYLON.engine, function (scene) {
             
             scene.activeCamera.attachControl(OURBABYLON.canvas);
             

+ 18 - 1
Tools/BuildOurOwnBabylonJS/BuildOurOwnBabylonJSServer/WebViewPageExtensions.cs

@@ -15,7 +15,7 @@ namespace BuildOurOwnBabylonJSServer.Extensions
             if (page == null)
                 return null;
 
-            // relPath must be the last one so filename must be appended to it
+            // relPath must be the last one so filename can be appended to it
             var url = page.Url.Action(BuildOurOwnBabylonJSController.GetFileContentActionName,
                                       "BuildOurOwnBabylonJS",
                                       new { rootPath = page.ViewBag.BabylonJSFolder, relPath = relPathToBabylonJSFolder },
@@ -40,5 +40,22 @@ namespace BuildOurOwnBabylonJSServer.Extensions
 
             return page.Html.Raw(script.ToString(TagRenderMode.Normal));
         }
+
+        public static string BabylonJSSamplesFile(this WebViewPage page,
+            string relPathToBabylonJSSamplesFolder)
+        {
+            if (page == null)
+                return null;
+
+            var babylonJSSamplesDirFullPath = Environment.GetEnvironmentVariable("BabylonJSSamplesDirFullPath");
+
+            // relPath must be the last one so filename can be appended to it
+            var url = page.Url.Action(BuildOurOwnBabylonJSController.GetFileContentActionName,
+                                      "BuildOurOwnBabylonJS",
+                                      new { rootPath = babylonJSSamplesDirFullPath, relPath = relPathToBabylonJSSamplesFolder },
+                                      page.Request.Url.Scheme);
+
+            return url;
+        }
     }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 59 - 25
Tools/BuildOurOwnBabylonJS/readme.md