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