index.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html>
  2. <!-- Copyright 2012 United States Government, as represented by the Secretary of Defense, Under -->
  3. <!-- Secretary of Defense (Personnel & Readiness). -->
  4. <!-- -->
  5. <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file -->
  6. <!-- except in compliance with the License. You may obtain a copy of the License at -->
  7. <!-- -->
  8. <!-- http://www.apache.org/licenses/LICENSE-2.0 -->
  9. <!-- -->
  10. <!-- Unless required by applicable law or agreed to in writing, software distributed under the -->
  11. <!-- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -->
  12. <!-- either express or implied. See the License for the specific language governing permissions -->
  13. <!-- and limitations under the License. -->
  14. <html>
  15. <!-- The Virtual World Framework client is a collection of scripts and a world specification -->
  16. <!-- passed to an initialization call. In this sample, the world specification is provided -->
  17. <!-- inline for clarity, but it is normally provided by the reflector or may be specified as a -->
  18. <!-- URI and loaded from a network-visible location. -->
  19. <head>
  20. <title>Virtual World Framework</title>
  21. <link rel="icon" type="image/x-icon" href="favicon.ico" />
  22. <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  23. <script type="text/javascript" src="compatibilitycheck.js"></script>
  24. <script type="text/javascript" src="socket.io/socket.io.js"></script>
  25. <!-- <script type="text/javascript" src="socket.io-sessionid-patch.js"></script> -->
  26. <script type="text/javascript" src="require.js"></script>
  27. <script type="text/javascript" src="async.js"></script>
  28. <script type="text/javascript" src="closure/base.js"></script>
  29. <script type="text/javascript">goog.require('goog.vec.Vec2')</script>
  30. <script type="text/javascript">goog.require('goog.vec.Mat4')</script>
  31. <script type="text/javascript">goog.require('goog.vec.Quaternion')</script>
  32. <script type="text/javascript" src="crypto.js"></script>
  33. <script type="text/javascript" src="md5.js"></script>
  34. <script type="text/javascript" src="alea.js"></script>
  35. <script type="text/javascript" src="mash.js"></script>
  36. <script type="text/javascript" src="Class.create.js"></script>
  37. <script type="text/javascript" src="rAF.js"></script>
  38. <script type="text/javascript" src="performance.now-polyfill.js"></script>
  39. <!-- This is the main client library. vwf.js creates a framework manager and attaches it to -->
  40. <!-- the global window object as window.vwf. All access to the framework is through that -->
  41. <!-- reference, and no other objects are globally visible. -->
  42. <script type="text/javascript" src="vwf.js"></script>
  43. <!-- The core framework manages the simulation and synchronizes it across worlds shared by -->
  44. <!-- multiple users. But, the manner in which the simulation is expressed is controlled by -->
  45. <!-- extension modules. There are two flavors. Models directly control the simulation but -->
  46. <!-- cannot accept external input. The model configuration is identical for all participants -->
  47. <!-- in a shared world. Views may accept external input -such as pointer and key events or -->
  48. <!-- directives from a connection to an outside engine that is not visible to all users- but -->
  49. <!-- may only affect the simulation indirectly through the synchronization server. -->
  50. <script type="text/javascript">
  51. // Users can specify which libraries the application will load by adding parameters to the URL.
  52. // Model libraries are specified as a query parameter and view libraries as a hash fragment.
  53. var queryString = window.location.search.substring(1);
  54. var hashString = window.location.hash.substring(2);
  55. var userLibraries = {model:{}, view:{}};
  56. var googleEarth = false;
  57. var match;
  58. var application;
  59. var regex = /([^&=]+)=?([^&]*)/g;
  60. var requireConfig = {
  61. paths: {
  62. jquery: "jquery-1.10.2.min",
  63. "jquery-ui": "jquery-ui-1.10.3.custom.min",
  64. hammer: "jquery.hammer",
  65. },
  66. shim: {
  67. "jquery-ui": {
  68. deps: ["jquery"],
  69. exports: "$"
  70. },
  71. "jquery-encoder-0.1.0": ["jquery"],
  72. "hammer": {
  73. deps: ["jquery"],
  74. exports: "Hammer"
  75. }
  76. }
  77. };
  78. require(requireConfig, ["jquery", "jquery-encoder-0.1.0"], function($) {
  79. while(match = regex.exec(queryString)) {
  80. var key = $.encoder.canonicalize(match[1]);
  81. var parameters = $.encoder.canonicalize(match[2]);
  82. if(key == "application") {
  83. // Get the application specification if one is provided in the query string.
  84. application = parameters;
  85. }
  86. else {
  87. try {
  88. parameters = JSON.parse(parameters);
  89. }
  90. catch(e) {
  91. }
  92. userLibraries["model"]["vwf/model/" + key] = (parameters && parameters != "") ? parameters : undefined;
  93. }
  94. }
  95. while(match = regex.exec(hashString)) {
  96. var key = $.encoder.canonicalize(match[1]);
  97. var parameters = $.encoder.canonicalize(match[2]);
  98. try {
  99. parameters = JSON.parse(parameters);
  100. }
  101. catch(e) {
  102. }
  103. userLibraries["view"]["vwf/view/" + key] = (parameters && parameters != "") ? parameters : undefined;
  104. if(key == "google-earth") {
  105. googleEarth = true;
  106. }
  107. }
  108. googleEarth && document.write( "<scr" + "ipt type='text/javascript' src='http://www.google.com/jsapi?hl=en&amp;key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw'></scr" + "ipt>");
  109. vwf.loadConfiguration(application, userLibraries, compatibilityCheck);
  110. });
  111. </script>
  112. <script type="text/javascript">googleEarth && google.load( "earth", "1" )</script>
  113. <!-- This is the common view implementation and an example view that summarizes the -->
  114. <!-- simulation state in HTML on the main page. -->
  115. <link rel="stylesheet" type="text/css" href="index.css" />
  116. <link rel="stylesheet" type="text/css" href="vwf/view/editor/editor.css" />
  117. </head>
  118. <body>
  119. <!-- Generic clients may have nearly empty pages, but pages for custom clients may be laid -->
  120. <!-- out in any manner desired. Any view and models that render to the page should be -->
  121. <!-- instructed where to attach their content. -->
  122. <!-- The main content renders to "#vwf-root", the item with the id "vwf-root". -->
  123. <!-- The loading spinner -->
  124. <div id="vwf-loading-spinner" class="pace pace-active"><div class="pace-activity"></div></div>
  125. <div id="incompatibleBrowser">
  126. <div>
  127. <span style="color:#3090C7;"><br/><br/>Your browser does not support Virtual World Framework. Please review our <a href='https://virtual.wf/requirements.html'>requirements</a> for supported browser versions.</span>
  128. </div>
  129. </div>
  130. <div id="vwf-root"></div>
  131. </body>
  132. </html>