-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
363 lines (339 loc) · 879 KB
/
index.html
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<!DOCTYPE html>
<!-- Created with https://packager.turbowarp.org/ -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- We only include this to explicitly loosen the CSP of various packager environments. It does not provide any security. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: blob:">
<title>Dimulo_0.1.7.1</title>
<style>
body {
color: #ffffff;
font-family: sans-serif;
overflow: hidden;
margin: 0;
padding: 0;
}
:root, body.is-fullscreen {
background-color: #ffffff;
}
[hidden] {
display: none !important;
}
h1 {
font-weight: normal;
}
a {
color: inherit;
text-decoration: underline;
cursor: pointer;
}
#app, #loading, #error, #launch {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.screen {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
cursor: default;
user-select: none;
-webkit-user-select: none;
background-color: #ffffff;
}
#launch {
background-color: rgba(0, 0, 0, 0.7);
cursor: pointer;
}
.green-flag {
width: 80px;
height: 80px;
padding: 16px;
border-radius: 100%;
background: rgba(255, 255, 255, 0.75);
border: 3px solid hsla(0, 100%, 100%, 1);
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
#loading {
}
.progress-bar-outer {
border: 1px solid currentColor;
height: 10px;
width: 200px;
max-width: 200px;
}
.progress-bar-inner {
height: 100%;
width: 0;
background-color: currentColor;
}
.loading-text, noscript {
font-weight: normal;
font-size: 36px;
margin: 0 0 16px;
}
.loading-image {
margin: 0 0 16px;
}
#error-message, #error-stack {
font-family: monospace;
max-width: 600px;
white-space: pre-wrap;
user-select: text;
-webkit-user-select: text;
}
#error-stack {
text-align: left;
max-height: 200px;
overflow: auto;
}
.control-button {
width: 2rem;
height: 2rem;
padding: 0.375rem;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
user-select: none;
-webkit-user-select: none;
cursor: pointer;
border: 0;
border-radius: 4px;
}
.control-button:hover {
background: #ff4c4c26;
}
.control-button.active {
background: #ff4c4c59;
}
.fullscreen-button {
background: white !important;
}
.standalone-fullscreen-button {
position: absolute;
top: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 0 0 0 4px;
padding: 4px;
cursor: pointer;
}
.sc-canvas {
cursor: auto;
}
.sc-monitor-root[data-opcode^="data_"] .sc-monitor-value-color {
background-color: #ff8c1a;
}
.sc-monitor-row-value-outer {
background-color: #fc662c;
}
.sc-monitor-row-value-editing .sc-monitor-row-value-outer {
background-color: #e25b27;
}
</style>
<meta name="theme-color" content="#ffffff">
</head>
<body>
<div id="app"></div>
<div id="launch" class="screen" hidden title="Click to start">
<div class="green-flag">
<svg viewBox="0 0 16.63 17.5" width="42" height="44">
<defs><style>.cls-1,.cls-2{fill:#4cbf56;stroke:#45993d;stroke-linecap:round;stroke-linejoin:round;}.cls-2{stroke-width:1.5px;}</style></defs>
<path class="cls-1" d="M.75,2A6.44,6.44,0,0,1,8.44,2h0a6.44,6.44,0,0,0,7.69,0V12.4a6.44,6.44,0,0,1-7.69,0h0a6.44,6.44,0,0,0-7.69,0"/>
<line class="cls-2" x1="0.75" y1="16.75" x2="0.75" y2="0.75"/>
</svg>
</div>
</div>
<div id="loading" class="screen">
<noscript>Enable JavaScript</noscript>
<div class="progress-bar-outer"><div class="progress-bar-inner" id="loading-inner"></div></div>
</div>
<div id="error" class="screen" hidden>
<h1>Error</h1>
<details>
<summary id="error-message"></summary>
<p id="error-stack"></p>
</details>
</div>
<script src="script.js"></script>
<script>
const appElement = document.getElementById('app');
const launchScreen = document.getElementById('launch');
const loadingScreen = document.getElementById('loading');
const loadingInner = document.getElementById('loading-inner');
const errorScreen = document.getElementById('error');
const errorScreenMessage = document.getElementById('error-message');
const errorScreenStack = document.getElementById('error-stack');
const handleError = (error) => {
console.error(error);
if (!errorScreen.hidden) return;
errorScreen.hidden = false;
errorScreenMessage.textContent = '' + error;
let debug = error && error.stack || 'no stack';
debug += '\nUser agent: ' + navigator.userAgent;
errorScreenStack.textContent = debug;
};
const setProgress = (progress) => {
if (loadingInner) loadingInner.style.width = progress * 100 + '%';
};
const interpolate = (a, b, t) => a + t * (b - a);
try {
setProgress(0.1);
const scaffolding = new Scaffolding.Scaffolding();
scaffolding.width = 480;
scaffolding.height = 360;
scaffolding.resizeMode = "dynamic-resize";
scaffolding.editableLists = false;
scaffolding.usePackagedRuntime = true;
scaffolding.setup();
scaffolding.appendTo(appElement);
const vm = scaffolding.vm;
window.scaffolding = scaffolding;
window.vm = scaffolding.vm;
window.Scratch = {
vm,
renderer: vm.renderer,
audioEngine: vm.runtime.audioEngine,
bitmapAdapter: vm.runtime.v2BitmapAdapter,
videoProvider: vm.runtime.ioDevices.video.provider
};
scaffolding.setUsername("player####".replace(/#/g, () => Math.floor(Math.random() * 10)));
scaffolding.setAccentColor("#ff4c4c");
scaffolding.addCloudProvider(new Scaffolding.Cloud.WebSocketProvider(["wss://clouddata.turbowarp.org","wss://clouddata.turbowarp.xyz"], "p4-@Dimulo_0.1.7.1.sb3"));
if (document.fullscreenEnabled || document.webkitFullscreenEnabled) {
let isFullScreen = !!(document.fullscreenElement || document.webkitFullscreenElement);
const fullscreenButton = document.createElement('img');
fullscreenButton.draggable = false;
fullscreenButton.className = 'control-button fullscreen-button';
fullscreenButton.addEventListener('click', () => {
if (isFullScreen) {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
} else {
if (document.body.requestFullscreen) {
document.body.requestFullscreen();
} else if (document.body.webkitRequestFullscreen) {
document.body.webkitRequestFullscreen();
}
}
});
const otherControlsExist = false;
const fillColor = otherControlsExist ? '#575E75' : '#ffffff';
const updateFullScreen = () => {
isFullScreen = !!(document.fullscreenElement || document.webkitFullscreenElement);
document.body.classList.toggle('is-fullscreen', isFullScreen);
if (isFullScreen) {
fullscreenButton.src = 'data:image/svg+xml,' + encodeURIComponent('<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="' + fillColor + '" fill-rule="evenodd"><path d="M12.662 3.65l.89.891 3.133-2.374a.815.815 0 011.15.165.819.819 0 010 .986L15.467 6.46l.867.871c.25.25.072.664-.269.664L12.388 8A.397.397 0 0112 7.611V3.92c0-.341.418-.514.662-.27M7.338 16.35l-.89-.89-3.133 2.374a.817.817 0 01-1.15-.166.819.819 0 010-.985l2.37-3.143-.87-.871a.387.387 0 01.27-.664L7.612 12a.397.397 0 01.388.389v3.692a.387.387 0 01-.662.27M7.338 3.65l-.89.891-3.133-2.374a.815.815 0 00-1.15.165.819.819 0 000 .986l2.37 3.142-.87.871a.387.387 0 00.27.664L7.612 8A.397.397 0 008 7.611V3.92a.387.387 0 00-.662-.27M12.662 16.35l.89-.89 3.133 2.374a.817.817 0 001.15-.166.819.819 0 000-.985l-2.368-3.143.867-.871a.387.387 0 00-.269-.664L12.388 12a.397.397 0 00-.388.389v3.692c0 .342.418.514.662.27"/></g></svg>');
} else {
fullscreenButton.src = 'data:image/svg+xml,' + encodeURIComponent('<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><g fill="' + fillColor + '" fill-rule="evenodd"><path d="M16.338 7.35l-.89-.891-3.133 2.374a.815.815 0 01-1.15-.165.819.819 0 010-.986l2.368-3.142-.867-.871a.387.387 0 01.269-.664L16.612 3a.397.397 0 01.388.389V7.08a.387.387 0 01-.662.27M3.662 12.65l.89.89 3.133-2.374a.817.817 0 011.15.166.819.819 0 010 .985l-2.37 3.143.87.871c.248.25.071.664-.27.664L3.388 17A.397.397 0 013 16.611V12.92c0-.342.418-.514.662-.27M3.662 7.35l.89-.891 3.133 2.374a.815.815 0 001.15-.165.819.819 0 000-.986L6.465 4.54l.87-.871a.387.387 0 00-.27-.664L3.388 3A.397.397 0 003 3.389V7.08c0 .341.418.514.662.27M16.338 12.65l-.89.89-3.133-2.374a.817.817 0 00-1.15.166.819.819 0 000 .985l2.368 3.143-.867.871a.387.387 0 00.269.664l3.677.005a.397.397 0 00.388-.389V12.92a.387.387 0 00-.662-.27"/></g></svg>');
}
};
updateFullScreen();
document.addEventListener('fullscreenchange', updateFullScreen);
document.addEventListener('webkitfullscreenchange', updateFullScreen);
if (otherControlsExist) {
fullscreenButton.className = 'control-button fullscreen-button';
scaffolding.addControlButton({
element: fullscreenButton,
where: 'top-right'
});
} else {
fullscreenButton.className = 'standalone-fullscreen-button';
document.body.appendChild(fullscreenButton);
}
}
vm.setTurboMode(false);
if (vm.setInterpolation) vm.setInterpolation(false);
if (vm.setFramerate) vm.setFramerate(30);
if (vm.renderer.setUseHighQualityRender) vm.renderer.setUseHighQualityRender(false);
if (vm.setRuntimeOptions) vm.setRuntimeOptions({
fencing: true,
miscLimits: true,
maxClones: 300,
});
if (vm.setCompilerOptions) vm.setCompilerOptions({
enabled: true,
warpTimer: false
});
if (typeof ScaffoldingAddons !== 'undefined') {
ScaffoldingAddons.run(scaffolding, {"gamepad":false,"pointerlock":false,"specialCloudBehaviors":false,"unsafeCloudBehaviors":false,"pause":false});
}
scaffolding.setExtensionSecurityManager({
getSandboxMode: 'unsandboxed',
canLoadExtensionFromProject: (url) => {
handleError(new Error('Missing custom extension: ' + url));
return Promise.resolve(false);
}
});
for (const extension of ["data:text/javascript;,(function(Scratch)%20%7B%20%2F*!%0A%20*%20This%20is%20based%20on%20https%3A%2F%2Fgithub.com%2Fgriffpatch%2Fscratch-vm%2Ftree%2Fbox2d%2Fsrc%2Fextensions%2Fscratch3_griffpatch%0A%20*%2F%0A%0A%2F*%20eslint-disable%20*%2F%0A%0A(function(Scratch)%20%7B%0A%20%20'use%20strict'%3B%0A%0A%20%20if%20(!Scratch.extensions.unsandboxed)%20%7B%0A%20%20%20%20throw%20new%20Error('Box2D%20must%20be%20run%20unsandboxed')%3B%0A%20%20%7D%0A%0A%20%20%2F%2F%20First%20we%20need%20to%20load%20the%20Box2D%20physics%20library%20that%20this%20extension%20uses.%0A%20%20%2F%2F%20It's%20not%20currently%20advised%20to%20load%20more%20scripts%20in%20custom%20extensions%2C%20so%20we%20copied%20and%20pasted%0A%20%20%2F%2F%20the%20source%20code%20below.%20Yes%2C%20this%20is%20really%20ugly.%0A%0A%20%20%2F*!%0A%20%20%20%20*%20Copyright%20(c)%202006-2007%20Erin%20Catto%20http%3A%2F%2Fwww.gphysics.com%0A%20%20%20%20*%0A%20%20%20%20*%20This%20software%20is%20provided%20'as-is'%2C%20without%20any%20express%20or%20implied%0A%20%20%20%20*%20warranty.%20%20In%20no%20event%20will%20the%20authors%20be%20held%20liable%20for%20any%20damages%0A%20%20%20%20*%20arising%20from%20the%20use%20of%20this%20software.%0A%20%20%20%20*%20Permission%20is%20granted%20to%20anyone%20to%20use%20this%20software%20for%20any%20purpose%2C%0A%20%20%20%20*%20including%20commercial%20applications%2C%20and%20to%20alter%20it%20and%20redistribute%20it%0A%20%20%20%20*%20freely%2C%20subject%20to%20the%20following%20restrictions%3A%0A%20%20%20%20*%201.%20The%20origin%20of%20this%20software%20must%20not%20be%20misrepresented%3B%20you%20must%20not%0A%20%20%20%20*%20claim%20that%20you%20wrote%20the%20original%20software.%20If%20you%20use%20this%20software%0A%20%20%20%20*%20in%20a%20product%2C%20an%20acknowledgment%20in%20the%20product%20documentation%20would%20be%0A%20%20%20%20*%20appreciated%20but%20is%20not%20required.%0A%20%20%20%20*%202.%20Altered%20source%20versions%20must%20be%20plainly%20marked%20as%20such%2C%20and%20must%20not%20be%0A%20%20%20%20*%20misrepresented%20as%20being%20the%20original%20software.%0A%20%20%20%20*%203.%20This%20notice%20may%20not%20be%20removed%20or%20altered%20from%20any%20source%20distribution.%0A%20%20%20%20*%2F%0A%0A%20%20var%20Box2D%20%3D%20%7B%7D%3B%0A%20%20(function%20(a2j%2C%20undefined)%20%7B%0A%20%20%20%20function%20emptyFn()%20%7B%7D%0A%20%20%20%20a2j.inherit%20%3D%20function%20(cls%2C%20base)%20%7B%0A%20%20%20%20%20%20var%20tmpCtr%20%3D%20cls%3B%0A%20%20%20%20%20%20emptyFn.prototype%20%3D%20base.prototype%3B%0A%20%20%20%20%20%20cls.prototype%20%3D%20new%20emptyFn()%3B%0A%20%20%20%20%20%20cls.prototype.constructor%20%3D%20tmpCtr%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20a2j.generateCallback%20%3D%20function%20generateCallback(context%2C%20cb)%20%7B%0A%20%20%20%20%20%20return%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20cb.apply(context%2C%20arguments)%3B%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20a2j.NVector%20%3D%20function%20NVector(length)%20%7B%0A%20%20%20%20%20%20if%20(length%20%3D%3D%3D%20undefined)%20length%20%3D%200%3B%0A%20%20%20%20%20%20var%20tmp%20%3D%20new%20Array(length%20%7C%7C%200)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20length%3B%20%2B%2Bi)%20tmp%5Bi%5D%20%3D%200%3B%0A%20%20%20%20%20%20return%20tmp%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20a2j.is%20%3D%20function%20is(o1%2C%20o2)%20%7B%0A%20%20%20%20%20%20if%20(o1%20%3D%3D%3D%20null)%20return%20false%3B%0A%20%20%20%20%20%20if%20(o2%20instanceof%20Function%20%26%26%20o1%20instanceof%20o2)%20return%20true%3B%0A%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20o1.constructor.__implements%20!%3D%20undefined%20%26%26%0A%20%20%20%20%20%20%20%20o1.constructor.__implements%5Bo2%5D%0A%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20a2j.parseUInt%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20return%20Math.abs(parseInt(v))%3B%0A%20%20%20%20%7D%3B%0A%20%20%7D)(Box2D)%3B%0A%0A%20%20%2F%2F%23TODO%20remove%20assignments%20from%20global%20namespace%0A%20%20var%20Vector%20%3D%20Array%3B%0A%20%20var%20Vector_a2j_Number%20%3D%20Box2D.NVector%3B%0A%20%20%2F%2Fpackage%20structure%0A%20%20if%20(typeof%20Box2D%20%3D%3D%3D%20%22undefined%22)%20Box2D%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Collision%20%3D%3D%3D%20%22undefined%22)%20Box2D.Collision%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Collision.Shapes%20%3D%3D%3D%20%22undefined%22)%20Box2D.Collision.Shapes%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Common%20%3D%3D%3D%20%22undefined%22)%20Box2D.Common%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Common.Math%20%3D%3D%3D%20%22undefined%22)%20Box2D.Common.Math%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Dynamics%20%3D%3D%3D%20%22undefined%22)%20Box2D.Dynamics%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Dynamics.Contacts%20%3D%3D%3D%20%22undefined%22)%0A%20%20%20%20Box2D.Dynamics.Contacts%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Dynamics.Controllers%20%3D%3D%3D%20%22undefined%22)%0A%20%20%20%20Box2D.Dynamics.Controllers%20%3D%20%7B%7D%3B%0A%20%20if%20(typeof%20Box2D.Dynamics.Joints%20%3D%3D%3D%20%22undefined%22)%20Box2D.Dynamics.Joints%20%3D%20%7B%7D%3B%0A%20%20%2F%2Fpre-definitions%0A%20%20(function%20()%20%7B%0A%20%20%20%20Box2D.Collision.IBroadPhase%20%3D%20%22Box2D.Collision.IBroadPhase%22%3B%0A%0A%20%20%20%20function%20b2AABB()%20%7B%0A%20%20%20%20%20%20b2AABB.b2AABB.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2AABB%20%3D%20b2AABB%3B%0A%0A%20%20%20%20function%20b2Bound()%20%7B%0A%20%20%20%20%20%20b2Bound.b2Bound.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Bound%20%3D%20b2Bound%3B%0A%0A%20%20%20%20function%20b2BoundValues()%20%7B%0A%20%20%20%20%20%20b2BoundValues.b2BoundValues.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2BoundValues)%0A%20%20%20%20%20%20%20%20this.b2BoundValues.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2BoundValues%20%3D%20b2BoundValues%3B%0A%0A%20%20%20%20function%20b2Collision()%20%7B%0A%20%20%20%20%20%20b2Collision.b2Collision.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Collision%20%3D%20b2Collision%3B%0A%0A%20%20%20%20function%20b2ContactID()%20%7B%0A%20%20%20%20%20%20b2ContactID.b2ContactID.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2ContactID)%0A%20%20%20%20%20%20%20%20this.b2ContactID.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2ContactID%20%3D%20b2ContactID%3B%0A%0A%20%20%20%20function%20b2ContactPoint()%20%7B%0A%20%20%20%20%20%20b2ContactPoint.b2ContactPoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2ContactPoint%20%3D%20b2ContactPoint%3B%0A%0A%20%20%20%20function%20b2Distance()%20%7B%0A%20%20%20%20%20%20b2Distance.b2Distance.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Distance%20%3D%20b2Distance%3B%0A%0A%20%20%20%20function%20b2DistanceInput()%20%7B%0A%20%20%20%20%20%20b2DistanceInput.b2DistanceInput.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DistanceInput%20%3D%20b2DistanceInput%3B%0A%0A%20%20%20%20function%20b2DistanceOutput()%20%7B%0A%20%20%20%20%20%20b2DistanceOutput.b2DistanceOutput.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DistanceOutput%20%3D%20b2DistanceOutput%3B%0A%0A%20%20%20%20function%20b2DistanceProxy()%20%7B%0A%20%20%20%20%20%20b2DistanceProxy.b2DistanceProxy.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DistanceProxy%20%3D%20b2DistanceProxy%3B%0A%0A%20%20%20%20function%20b2DynamicTree()%20%7B%0A%20%20%20%20%20%20b2DynamicTree.b2DynamicTree.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2DynamicTree)%0A%20%20%20%20%20%20%20%20this.b2DynamicTree.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DynamicTree%20%3D%20b2DynamicTree%3B%0A%0A%20%20%20%20function%20b2DynamicTreeBroadPhase()%20%7B%0A%20%20%20%20%20%20b2DynamicTreeBroadPhase.b2DynamicTreeBroadPhase.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DynamicTreeBroadPhase%20%3D%20b2DynamicTreeBroadPhase%3B%0A%0A%20%20%20%20function%20b2DynamicTreeNode()%20%7B%0A%20%20%20%20%20%20b2DynamicTreeNode.b2DynamicTreeNode.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DynamicTreeNode%20%3D%20b2DynamicTreeNode%3B%0A%0A%20%20%20%20function%20b2DynamicTreePair()%20%7B%0A%20%20%20%20%20%20b2DynamicTreePair.b2DynamicTreePair.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2DynamicTreePair%20%3D%20b2DynamicTreePair%3B%0A%0A%20%20%20%20function%20b2Manifold()%20%7B%0A%20%20%20%20%20%20b2Manifold.b2Manifold.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Manifold)%20this.b2Manifold.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Manifold%20%3D%20b2Manifold%3B%0A%0A%20%20%20%20function%20b2ManifoldPoint()%20%7B%0A%20%20%20%20%20%20b2ManifoldPoint.b2ManifoldPoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2ManifoldPoint)%0A%20%20%20%20%20%20%20%20this.b2ManifoldPoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2ManifoldPoint%20%3D%20b2ManifoldPoint%3B%0A%0A%20%20%20%20function%20b2Point()%20%7B%0A%20%20%20%20%20%20b2Point.b2Point.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Point%20%3D%20b2Point%3B%0A%0A%20%20%20%20function%20b2RayCastInput()%20%7B%0A%20%20%20%20%20%20b2RayCastInput.b2RayCastInput.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2RayCastInput)%0A%20%20%20%20%20%20%20%20this.b2RayCastInput.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2RayCastInput%20%3D%20b2RayCastInput%3B%0A%0A%20%20%20%20function%20b2RayCastOutput()%20%7B%0A%20%20%20%20%20%20b2RayCastOutput.b2RayCastOutput.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2RayCastOutput%20%3D%20b2RayCastOutput%3B%0A%0A%20%20%20%20function%20b2Segment()%20%7B%0A%20%20%20%20%20%20b2Segment.b2Segment.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Segment%20%3D%20b2Segment%3B%0A%0A%20%20%20%20function%20b2SeparationFunction()%20%7B%0A%20%20%20%20%20%20b2SeparationFunction.b2SeparationFunction.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2SeparationFunction%20%3D%20b2SeparationFunction%3B%0A%0A%20%20%20%20function%20b2Simplex()%20%7B%0A%20%20%20%20%20%20b2Simplex.b2Simplex.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Simplex)%20this.b2Simplex.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2Simplex%20%3D%20b2Simplex%3B%0A%0A%20%20%20%20function%20b2SimplexCache()%20%7B%0A%20%20%20%20%20%20b2SimplexCache.b2SimplexCache.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2SimplexCache%20%3D%20b2SimplexCache%3B%0A%0A%20%20%20%20function%20b2SimplexVertex()%20%7B%0A%20%20%20%20%20%20b2SimplexVertex.b2SimplexVertex.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2SimplexVertex%20%3D%20b2SimplexVertex%3B%0A%0A%20%20%20%20function%20b2TimeOfImpact()%20%7B%0A%20%20%20%20%20%20b2TimeOfImpact.b2TimeOfImpact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2TimeOfImpact%20%3D%20b2TimeOfImpact%3B%0A%0A%20%20%20%20function%20b2TOIInput()%20%7B%0A%20%20%20%20%20%20b2TOIInput.b2TOIInput.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2TOIInput%20%3D%20b2TOIInput%3B%0A%0A%20%20%20%20function%20b2WorldManifold()%20%7B%0A%20%20%20%20%20%20b2WorldManifold.b2WorldManifold.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2WorldManifold)%0A%20%20%20%20%20%20%20%20this.b2WorldManifold.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.b2WorldManifold%20%3D%20b2WorldManifold%3B%0A%0A%20%20%20%20function%20ClipVertex()%20%7B%0A%20%20%20%20%20%20ClipVertex.ClipVertex.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.ClipVertex%20%3D%20ClipVertex%3B%0A%0A%20%20%20%20function%20Features()%20%7B%0A%20%20%20%20%20%20Features.Features.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Features%20%3D%20Features%3B%0A%0A%20%20%20%20function%20b2CircleShape()%20%7B%0A%20%20%20%20%20%20b2CircleShape.b2CircleShape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2CircleShape)%0A%20%20%20%20%20%20%20%20this.b2CircleShape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Shapes.b2CircleShape%20%3D%20b2CircleShape%3B%0A%0A%20%20%20%20function%20b2EdgeChainDef()%20%7B%0A%20%20%20%20%20%20b2EdgeChainDef.b2EdgeChainDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2EdgeChainDef)%0A%20%20%20%20%20%20%20%20this.b2EdgeChainDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Shapes.b2EdgeChainDef%20%3D%20b2EdgeChainDef%3B%0A%0A%20%20%20%20function%20b2EdgeShape()%20%7B%0A%20%20%20%20%20%20b2EdgeShape.b2EdgeShape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2EdgeShape)%0A%20%20%20%20%20%20%20%20this.b2EdgeShape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Shapes.b2EdgeShape%20%3D%20b2EdgeShape%3B%0A%0A%20%20%20%20function%20b2MassData()%20%7B%0A%20%20%20%20%20%20b2MassData.b2MassData.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Shapes.b2MassData%20%3D%20b2MassData%3B%0A%0A%20%20%20%20function%20b2PolygonShape()%20%7B%0A%20%20%20%20%20%20b2PolygonShape.b2PolygonShape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2PolygonShape)%0A%20%20%20%20%20%20%20%20this.b2PolygonShape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Shapes.b2PolygonShape%20%3D%20b2PolygonShape%3B%0A%0A%20%20%20%20function%20b2Shape()%20%7B%0A%20%20%20%20%20%20b2Shape.b2Shape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Shape)%20this.b2Shape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Collision.Shapes.b2Shape%20%3D%20b2Shape%3B%0A%20%20%20%20Box2D.Common.b2internal%20%3D%20%22Box2D.Common.b2internal%22%3B%0A%0A%20%20%20%20function%20b2Color()%20%7B%0A%20%20%20%20%20%20b2Color.b2Color.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Color)%20this.b2Color.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.b2Color%20%3D%20b2Color%3B%0A%0A%20%20%20%20function%20b2Settings()%20%7B%0A%20%20%20%20%20%20b2Settings.b2Settings.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.b2Settings%20%3D%20b2Settings%3B%0A%0A%20%20%20%20function%20b2Mat22()%20%7B%0A%20%20%20%20%20%20b2Mat22.b2Mat22.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Mat22)%20this.b2Mat22.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Mat22%20%3D%20b2Mat22%3B%0A%0A%20%20%20%20function%20b2Mat33()%20%7B%0A%20%20%20%20%20%20b2Mat33.b2Mat33.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Mat33)%20this.b2Mat33.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Mat33%20%3D%20b2Mat33%3B%0A%0A%20%20%20%20function%20b2Math()%20%7B%0A%20%20%20%20%20%20b2Math.b2Math.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Math%20%3D%20b2Math%3B%0A%0A%20%20%20%20function%20b2Sweep()%20%7B%0A%20%20%20%20%20%20b2Sweep.b2Sweep.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Sweep%20%3D%20b2Sweep%3B%0A%0A%20%20%20%20function%20b2Transform()%20%7B%0A%20%20%20%20%20%20b2Transform.b2Transform.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Transform)%0A%20%20%20%20%20%20%20%20this.b2Transform.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Transform%20%3D%20b2Transform%3B%0A%0A%20%20%20%20function%20b2Vec2()%20%7B%0A%20%20%20%20%20%20b2Vec2.b2Vec2.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Vec2)%20this.b2Vec2.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Vec2%20%3D%20b2Vec2%3B%0A%0A%20%20%20%20function%20b2Vec3()%20%7B%0A%20%20%20%20%20%20b2Vec3.b2Vec3.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Vec3)%20this.b2Vec3.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Common.Math.b2Vec3%20%3D%20b2Vec3%3B%0A%0A%20%20%20%20function%20b2Body()%20%7B%0A%20%20%20%20%20%20b2Body.b2Body.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Body)%20this.b2Body.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2Body%20%3D%20b2Body%3B%0A%0A%20%20%20%20function%20b2BodyDef()%20%7B%0A%20%20%20%20%20%20b2BodyDef.b2BodyDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2BodyDef)%20this.b2BodyDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2BodyDef%20%3D%20b2BodyDef%3B%0A%0A%20%20%20%20function%20b2ContactFilter()%20%7B%0A%20%20%20%20%20%20b2ContactFilter.b2ContactFilter.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2ContactFilter%20%3D%20b2ContactFilter%3B%0A%0A%20%20%20%20function%20b2ContactImpulse()%20%7B%0A%20%20%20%20%20%20b2ContactImpulse.b2ContactImpulse.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2ContactImpulse%20%3D%20b2ContactImpulse%3B%0A%0A%20%20%20%20function%20b2ContactListener()%20%7B%0A%20%20%20%20%20%20b2ContactListener.b2ContactListener.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2ContactListener%20%3D%20b2ContactListener%3B%0A%0A%20%20%20%20function%20b2ContactManager()%20%7B%0A%20%20%20%20%20%20b2ContactManager.b2ContactManager.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2ContactManager)%0A%20%20%20%20%20%20%20%20this.b2ContactManager.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2ContactManager%20%3D%20b2ContactManager%3B%0A%0A%20%20%20%20function%20b2DebugDraw()%20%7B%0A%20%20%20%20%20%20b2DebugDraw.b2DebugDraw.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2DebugDraw)%0A%20%20%20%20%20%20%20%20this.b2DebugDraw.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2DebugDraw%20%3D%20b2DebugDraw%3B%0A%0A%20%20%20%20function%20b2DestructionListener()%20%7B%0A%20%20%20%20%20%20b2DestructionListener.b2DestructionListener.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2DestructionListener%20%3D%20b2DestructionListener%3B%0A%0A%20%20%20%20function%20b2FilterData()%20%7B%0A%20%20%20%20%20%20b2FilterData.b2FilterData.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2FilterData%20%3D%20b2FilterData%3B%0A%0A%20%20%20%20function%20b2Fixture()%20%7B%0A%20%20%20%20%20%20b2Fixture.b2Fixture.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Fixture)%20this.b2Fixture.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2Fixture%20%3D%20b2Fixture%3B%0A%0A%20%20%20%20function%20b2FixtureDef()%20%7B%0A%20%20%20%20%20%20b2FixtureDef.b2FixtureDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2FixtureDef)%0A%20%20%20%20%20%20%20%20this.b2FixtureDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2FixtureDef%20%3D%20b2FixtureDef%3B%0A%0A%20%20%20%20function%20b2Island()%20%7B%0A%20%20%20%20%20%20b2Island.b2Island.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Island)%20this.b2Island.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2Island%20%3D%20b2Island%3B%0A%0A%20%20%20%20function%20b2TimeStep()%20%7B%0A%20%20%20%20%20%20b2TimeStep.b2TimeStep.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2TimeStep%20%3D%20b2TimeStep%3B%0A%0A%20%20%20%20function%20b2World()%20%7B%0A%20%20%20%20%20%20b2World.b2World.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2World)%20this.b2World.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.b2World%20%3D%20b2World%3B%0A%0A%20%20%20%20function%20b2CircleContact()%20%7B%0A%20%20%20%20%20%20b2CircleContact.b2CircleContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2CircleContact%20%3D%20b2CircleContact%3B%0A%0A%20%20%20%20function%20b2Contact()%20%7B%0A%20%20%20%20%20%20b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Contact)%20this.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2Contact%20%3D%20b2Contact%3B%0A%0A%20%20%20%20function%20b2ContactConstraint()%20%7B%0A%20%20%20%20%20%20b2ContactConstraint.b2ContactConstraint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2ContactConstraint)%0A%20%20%20%20%20%20%20%20this.b2ContactConstraint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactConstraint%20%3D%20b2ContactConstraint%3B%0A%0A%20%20%20%20function%20b2ContactConstraintPoint()%20%7B%0A%20%20%20%20%20%20b2ContactConstraintPoint.b2ContactConstraintPoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactConstraintPoint%20%3D%20b2ContactConstraintPoint%3B%0A%0A%20%20%20%20function%20b2ContactEdge()%20%7B%0A%20%20%20%20%20%20b2ContactEdge.b2ContactEdge.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactEdge%20%3D%20b2ContactEdge%3B%0A%0A%20%20%20%20function%20b2ContactFactory()%20%7B%0A%20%20%20%20%20%20b2ContactFactory.b2ContactFactory.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2ContactFactory)%0A%20%20%20%20%20%20%20%20this.b2ContactFactory.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactFactory%20%3D%20b2ContactFactory%3B%0A%0A%20%20%20%20function%20b2ContactRegister()%20%7B%0A%20%20%20%20%20%20b2ContactRegister.b2ContactRegister.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactRegister%20%3D%20b2ContactRegister%3B%0A%0A%20%20%20%20function%20b2ContactResult()%20%7B%0A%20%20%20%20%20%20b2ContactResult.b2ContactResult.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactResult%20%3D%20b2ContactResult%3B%0A%0A%20%20%20%20function%20b2ContactSolver()%20%7B%0A%20%20%20%20%20%20b2ContactSolver.b2ContactSolver.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2ContactSolver)%0A%20%20%20%20%20%20%20%20this.b2ContactSolver.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2ContactSolver%20%3D%20b2ContactSolver%3B%0A%0A%20%20%20%20function%20b2EdgeAndCircleContact()%20%7B%0A%20%20%20%20%20%20b2EdgeAndCircleContact.b2EdgeAndCircleContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2EdgeAndCircleContact%20%3D%20b2EdgeAndCircleContact%3B%0A%0A%20%20%20%20function%20b2NullContact()%20%7B%0A%20%20%20%20%20%20b2NullContact.b2NullContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2NullContact)%0A%20%20%20%20%20%20%20%20this.b2NullContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2NullContact%20%3D%20b2NullContact%3B%0A%0A%20%20%20%20function%20b2PolyAndCircleContact()%20%7B%0A%20%20%20%20%20%20b2PolyAndCircleContact.b2PolyAndCircleContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2PolyAndCircleContact%20%3D%20b2PolyAndCircleContact%3B%0A%0A%20%20%20%20function%20b2PolyAndEdgeContact()%20%7B%0A%20%20%20%20%20%20b2PolyAndEdgeContact.b2PolyAndEdgeContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2PolyAndEdgeContact%20%3D%20b2PolyAndEdgeContact%3B%0A%0A%20%20%20%20function%20b2PolygonContact()%20%7B%0A%20%20%20%20%20%20b2PolygonContact.b2PolygonContact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2PolygonContact%20%3D%20b2PolygonContact%3B%0A%0A%20%20%20%20function%20b2PositionSolverManifold()%20%7B%0A%20%20%20%20%20%20b2PositionSolverManifold.b2PositionSolverManifold.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2PositionSolverManifold)%0A%20%20%20%20%20%20%20%20this.b2PositionSolverManifold.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Contacts.b2PositionSolverManifold%20%3D%20b2PositionSolverManifold%3B%0A%0A%20%20%20%20function%20b2BuoyancyController()%20%7B%0A%20%20%20%20%20%20b2BuoyancyController.b2BuoyancyController.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2BuoyancyController%20%3D%20b2BuoyancyController%3B%0A%0A%20%20%20%20function%20b2ConstantAccelController()%20%7B%0A%20%20%20%20%20%20b2ConstantAccelController.b2ConstantAccelController.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2ConstantAccelController%20%3D%0A%20%20%20%20%20%20b2ConstantAccelController%3B%0A%0A%20%20%20%20function%20b2ConstantForceController()%20%7B%0A%20%20%20%20%20%20b2ConstantForceController.b2ConstantForceController.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2ConstantForceController%20%3D%0A%20%20%20%20%20%20b2ConstantForceController%3B%0A%0A%20%20%20%20function%20b2Controller()%20%7B%0A%20%20%20%20%20%20b2Controller.b2Controller.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2Controller%20%3D%20b2Controller%3B%0A%0A%20%20%20%20function%20b2ControllerEdge()%20%7B%0A%20%20%20%20%20%20b2ControllerEdge.b2ControllerEdge.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2ControllerEdge%20%3D%20b2ControllerEdge%3B%0A%0A%20%20%20%20function%20b2GravityController()%20%7B%0A%20%20%20%20%20%20b2GravityController.b2GravityController.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2GravityController%20%3D%20b2GravityController%3B%0A%0A%20%20%20%20function%20b2TensorDampingController()%20%7B%0A%20%20%20%20%20%20b2TensorDampingController.b2TensorDampingController.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Controllers.b2TensorDampingController%20%3D%0A%20%20%20%20%20%20b2TensorDampingController%3B%0A%0A%20%20%20%20function%20b2DistanceJoint()%20%7B%0A%20%20%20%20%20%20b2DistanceJoint.b2DistanceJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2DistanceJoint)%0A%20%20%20%20%20%20%20%20this.b2DistanceJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2DistanceJoint%20%3D%20b2DistanceJoint%3B%0A%0A%20%20%20%20function%20b2DistanceJointDef()%20%7B%0A%20%20%20%20%20%20b2DistanceJointDef.b2DistanceJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2DistanceJointDef)%0A%20%20%20%20%20%20%20%20this.b2DistanceJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2DistanceJointDef%20%3D%20b2DistanceJointDef%3B%0A%0A%20%20%20%20function%20b2FrictionJoint()%20%7B%0A%20%20%20%20%20%20b2FrictionJoint.b2FrictionJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2FrictionJoint)%0A%20%20%20%20%20%20%20%20this.b2FrictionJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2FrictionJoint%20%3D%20b2FrictionJoint%3B%0A%0A%20%20%20%20function%20b2FrictionJointDef()%20%7B%0A%20%20%20%20%20%20b2FrictionJointDef.b2FrictionJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2FrictionJointDef)%0A%20%20%20%20%20%20%20%20this.b2FrictionJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2FrictionJointDef%20%3D%20b2FrictionJointDef%3B%0A%0A%20%20%20%20function%20b2GearJoint()%20%7B%0A%20%20%20%20%20%20b2GearJoint.b2GearJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2GearJoint)%0A%20%20%20%20%20%20%20%20this.b2GearJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2GearJoint%20%3D%20b2GearJoint%3B%0A%0A%20%20%20%20function%20b2GearJointDef()%20%7B%0A%20%20%20%20%20%20b2GearJointDef.b2GearJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2GearJointDef)%0A%20%20%20%20%20%20%20%20this.b2GearJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2GearJointDef%20%3D%20b2GearJointDef%3B%0A%0A%20%20%20%20function%20b2Jacobian()%20%7B%0A%20%20%20%20%20%20b2Jacobian.b2Jacobian.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2Jacobian%20%3D%20b2Jacobian%3B%0A%0A%20%20%20%20function%20b2Joint()%20%7B%0A%20%20%20%20%20%20b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2Joint)%20this.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2Joint%20%3D%20b2Joint%3B%0A%0A%20%20%20%20function%20b2JointDef()%20%7B%0A%20%20%20%20%20%20b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2JointDef)%20this.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2JointDef%20%3D%20b2JointDef%3B%0A%0A%20%20%20%20function%20b2JointEdge()%20%7B%0A%20%20%20%20%20%20b2JointEdge.b2JointEdge.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2JointEdge%20%3D%20b2JointEdge%3B%0A%0A%20%20%20%20function%20b2LineJoint()%20%7B%0A%20%20%20%20%20%20b2LineJoint.b2LineJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2LineJoint)%0A%20%20%20%20%20%20%20%20this.b2LineJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2LineJoint%20%3D%20b2LineJoint%3B%0A%0A%20%20%20%20function%20b2LineJointDef()%20%7B%0A%20%20%20%20%20%20b2LineJointDef.b2LineJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2LineJointDef)%0A%20%20%20%20%20%20%20%20this.b2LineJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2LineJointDef%20%3D%20b2LineJointDef%3B%0A%0A%20%20%20%20function%20b2MouseJoint()%20%7B%0A%20%20%20%20%20%20b2MouseJoint.b2MouseJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2MouseJoint)%0A%20%20%20%20%20%20%20%20this.b2MouseJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2MouseJoint%20%3D%20b2MouseJoint%3B%0A%0A%20%20%20%20function%20b2MouseJointDef()%20%7B%0A%20%20%20%20%20%20b2MouseJointDef.b2MouseJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2MouseJointDef)%0A%20%20%20%20%20%20%20%20this.b2MouseJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2MouseJointDef%20%3D%20b2MouseJointDef%3B%0A%0A%20%20%20%20function%20b2PrismaticJoint()%20%7B%0A%20%20%20%20%20%20b2PrismaticJoint.b2PrismaticJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2PrismaticJoint)%0A%20%20%20%20%20%20%20%20this.b2PrismaticJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2PrismaticJoint%20%3D%20b2PrismaticJoint%3B%0A%0A%20%20%20%20function%20b2PrismaticJointDef()%20%7B%0A%20%20%20%20%20%20b2PrismaticJointDef.b2PrismaticJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2PrismaticJointDef)%0A%20%20%20%20%20%20%20%20this.b2PrismaticJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2PrismaticJointDef%20%3D%20b2PrismaticJointDef%3B%0A%0A%20%20%20%20function%20b2PulleyJoint()%20%7B%0A%20%20%20%20%20%20b2PulleyJoint.b2PulleyJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2PulleyJoint)%0A%20%20%20%20%20%20%20%20this.b2PulleyJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2PulleyJoint%20%3D%20b2PulleyJoint%3B%0A%0A%20%20%20%20function%20b2PulleyJointDef()%20%7B%0A%20%20%20%20%20%20b2PulleyJointDef.b2PulleyJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2PulleyJointDef)%0A%20%20%20%20%20%20%20%20this.b2PulleyJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2PulleyJointDef%20%3D%20b2PulleyJointDef%3B%0A%0A%20%20%20%20function%20b2RevoluteJoint()%20%7B%0A%20%20%20%20%20%20b2RevoluteJoint.b2RevoluteJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2RevoluteJoint)%0A%20%20%20%20%20%20%20%20this.b2RevoluteJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2RevoluteJoint%20%3D%20b2RevoluteJoint%3B%0A%0A%20%20%20%20function%20b2RevoluteJointDef()%20%7B%0A%20%20%20%20%20%20b2RevoluteJointDef.b2RevoluteJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2RevoluteJointDef)%0A%20%20%20%20%20%20%20%20this.b2RevoluteJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2RevoluteJointDef%20%3D%20b2RevoluteJointDef%3B%0A%0A%20%20%20%20function%20b2WeldJoint()%20%7B%0A%20%20%20%20%20%20b2WeldJoint.b2WeldJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2WeldJoint)%0A%20%20%20%20%20%20%20%20this.b2WeldJoint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2WeldJoint%20%3D%20b2WeldJoint%3B%0A%0A%20%20%20%20function%20b2WeldJointDef()%20%7B%0A%20%20%20%20%20%20b2WeldJointDef.b2WeldJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20if%20(this.constructor%20%3D%3D%3D%20b2WeldJointDef)%0A%20%20%20%20%20%20%20%20this.b2WeldJointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%0A%20%20%20%20Box2D.Dynamics.Joints.b2WeldJointDef%20%3D%20b2WeldJointDef%3B%0A%20%20%7D)()%3B%20%2F%2Fdefinitions%0A%20%20Box2D.postDefs%20%3D%20%5B%5D%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2CircleShape%20%3D%20Box2D.Collision.Shapes.b2CircleShape%2C%0A%20%20%20%20%20%20b2EdgeChainDef%20%3D%20Box2D.Collision.Shapes.b2EdgeChainDef%2C%0A%20%20%20%20%20%20b2EdgeShape%20%3D%20Box2D.Collision.Shapes.b2EdgeShape%2C%0A%20%20%20%20%20%20b2MassData%20%3D%20Box2D.Collision.Shapes.b2MassData%2C%0A%20%20%20%20%20%20b2PolygonShape%20%3D%20Box2D.Collision.Shapes.b2PolygonShape%2C%0A%20%20%20%20%20%20b2Shape%20%3D%20Box2D.Collision.Shapes.b2Shape%2C%0A%20%20%20%20%20%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%2C%0A%20%20%20%20%20%20b2AABB%20%3D%20Box2D.Collision.b2AABB%2C%0A%20%20%20%20%20%20b2Bound%20%3D%20Box2D.Collision.b2Bound%2C%0A%20%20%20%20%20%20b2BoundValues%20%3D%20Box2D.Collision.b2BoundValues%2C%0A%20%20%20%20%20%20b2Collision%20%3D%20Box2D.Collision.b2Collision%2C%0A%20%20%20%20%20%20b2ContactID%20%3D%20Box2D.Collision.b2ContactID%2C%0A%20%20%20%20%20%20b2ContactPoint%20%3D%20Box2D.Collision.b2ContactPoint%2C%0A%20%20%20%20%20%20b2Distance%20%3D%20Box2D.Collision.b2Distance%2C%0A%20%20%20%20%20%20b2DistanceInput%20%3D%20Box2D.Collision.b2DistanceInput%2C%0A%20%20%20%20%20%20b2DistanceOutput%20%3D%20Box2D.Collision.b2DistanceOutput%2C%0A%20%20%20%20%20%20b2DistanceProxy%20%3D%20Box2D.Collision.b2DistanceProxy%2C%0A%20%20%20%20%20%20b2DynamicTree%20%3D%20Box2D.Collision.b2DynamicTree%2C%0A%20%20%20%20%20%20b2DynamicTreeBroadPhase%20%3D%20Box2D.Collision.b2DynamicTreeBroadPhase%2C%0A%20%20%20%20%20%20b2DynamicTreeNode%20%3D%20Box2D.Collision.b2DynamicTreeNode%2C%0A%20%20%20%20%20%20b2DynamicTreePair%20%3D%20Box2D.Collision.b2DynamicTreePair%2C%0A%20%20%20%20%20%20b2Manifold%20%3D%20Box2D.Collision.b2Manifold%2C%0A%20%20%20%20%20%20b2ManifoldPoint%20%3D%20Box2D.Collision.b2ManifoldPoint%2C%0A%20%20%20%20%20%20b2Point%20%3D%20Box2D.Collision.b2Point%2C%0A%20%20%20%20%20%20b2RayCastInput%20%3D%20Box2D.Collision.b2RayCastInput%2C%0A%20%20%20%20%20%20b2RayCastOutput%20%3D%20Box2D.Collision.b2RayCastOutput%2C%0A%20%20%20%20%20%20b2Segment%20%3D%20Box2D.Collision.b2Segment%2C%0A%20%20%20%20%20%20b2SeparationFunction%20%3D%20Box2D.Collision.b2SeparationFunction%2C%0A%20%20%20%20%20%20b2Simplex%20%3D%20Box2D.Collision.b2Simplex%2C%0A%20%20%20%20%20%20b2SimplexCache%20%3D%20Box2D.Collision.b2SimplexCache%2C%0A%20%20%20%20%20%20b2SimplexVertex%20%3D%20Box2D.Collision.b2SimplexVertex%2C%0A%20%20%20%20%20%20b2TimeOfImpact%20%3D%20Box2D.Collision.b2TimeOfImpact%2C%0A%20%20%20%20%20%20b2TOIInput%20%3D%20Box2D.Collision.b2TOIInput%2C%0A%20%20%20%20%20%20b2WorldManifold%20%3D%20Box2D.Collision.b2WorldManifold%2C%0A%20%20%20%20%20%20ClipVertex%20%3D%20Box2D.Collision.ClipVertex%2C%0A%20%20%20%20%20%20Features%20%3D%20Box2D.Collision.Features%2C%0A%20%20%20%20%20%20IBroadPhase%20%3D%20Box2D.Collision.IBroadPhase%3B%0A%0A%20%20%20%20b2AABB.b2AABB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.lowerBound%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.upperBound%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.IsValid%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20dX%20%3D%20this.upperBound.x%20-%20this.lowerBound.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20this.upperBound.y%20-%20this.lowerBound.y%3B%0A%20%20%20%20%20%20var%20valid%20%3D%20dX%20%3E%3D%200.0%20%26%26%20dY%20%3E%3D%200.0%3B%0A%20%20%20%20%20%20valid%20%3D%20valid%20%26%26%20this.lowerBound.IsValid()%20%26%26%20this.upperBound.IsValid()%3B%0A%20%20%20%20%20%20return%20valid%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.GetCenter%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20(this.lowerBound.x%20%2B%20this.upperBound.x)%20%2F%202%2C%0A%20%20%20%20%20%20%20%20(this.lowerBound.y%20%2B%20this.upperBound.y)%20%2F%202%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.GetExtents%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20(this.upperBound.x%20-%20this.lowerBound.x)%20%2F%202%2C%0A%20%20%20%20%20%20%20%20(this.upperBound.y%20-%20this.lowerBound.y)%20%2F%202%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.Contains%20%3D%20function%20(aabb)%20%7B%0A%20%20%20%20%20%20var%20result%20%3D%20true%3B%0A%20%20%20%20%20%20result%20%3D%20result%20%26%26%20this.lowerBound.x%20%3C%3D%20aabb.lowerBound.x%3B%0A%20%20%20%20%20%20result%20%3D%20result%20%26%26%20this.lowerBound.y%20%3C%3D%20aabb.lowerBound.y%3B%0A%20%20%20%20%20%20result%20%3D%20result%20%26%26%20aabb.upperBound.x%20%3C%3D%20this.upperBound.x%3B%0A%20%20%20%20%20%20result%20%3D%20result%20%26%26%20aabb.upperBound.y%20%3C%3D%20this.upperBound.y%3B%0A%20%20%20%20%20%20return%20result%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.RayCast%20%3D%20function%20(output%2C%20input)%20%7B%0A%20%20%20%20%20%20var%20tmin%20%3D%20-Number.MAX_VALUE%3B%0A%20%20%20%20%20%20var%20tmax%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20var%20pX%20%3D%20input.p1.x%3B%0A%20%20%20%20%20%20var%20pY%20%3D%20input.p1.y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20input.p2.x%20-%20input.p1.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20input.p2.y%20-%20input.p1.y%3B%0A%20%20%20%20%20%20var%20absDX%20%3D%20Math.abs(dX)%3B%0A%20%20%20%20%20%20var%20absDY%20%3D%20Math.abs(dY)%3B%0A%20%20%20%20%20%20var%20normal%20%3D%20output.normal%3B%0A%20%20%20%20%20%20var%20inv_d%20%3D%200%3B%0A%20%20%20%20%20%20var%20t1%20%3D%200%3B%0A%20%20%20%20%20%20var%20t2%20%3D%200%3B%0A%20%20%20%20%20%20var%20t3%20%3D%200%3B%0A%20%20%20%20%20%20var%20s%20%3D%200%3B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20(absDX%20%3C%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(pX%20%3C%20this.lowerBound.x%20%7C%7C%20this.upperBound.x%20%3C%20pX)%20return%20false%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20inv_d%20%3D%201.0%20%2F%20dX%3B%0A%20%20%20%20%20%20%20%20%20%20t1%20%3D%20(this.lowerBound.x%20-%20pX)%20*%20inv_d%3B%0A%20%20%20%20%20%20%20%20%20%20t2%20%3D%20(this.upperBound.x%20-%20pX)%20*%20inv_d%3B%0A%20%20%20%20%20%20%20%20%20%20s%20%3D%20-1.0%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(t1%20%3E%20t2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20t3%20%3D%20t1%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20t1%20%3D%20t2%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20t2%20%3D%20t3%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(t1%20%3E%20tmin)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20normal.x%20%3D%20s%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normal.y%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tmin%20%3D%20t1%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20tmax%20%3D%20Math.min(tmax%2C%20t2)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(tmin%20%3E%20tmax)%20return%20false%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20if%20(absDY%20%3C%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(pY%20%3C%20this.lowerBound.y%20%7C%7C%20this.upperBound.y%20%3C%20pY)%20return%20false%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20inv_d%20%3D%201.0%20%2F%20dY%3B%0A%20%20%20%20%20%20%20%20%20%20t1%20%3D%20(this.lowerBound.y%20-%20pY)%20*%20inv_d%3B%0A%20%20%20%20%20%20%20%20%20%20t2%20%3D%20(this.upperBound.y%20-%20pY)%20*%20inv_d%3B%0A%20%20%20%20%20%20%20%20%20%20s%20%3D%20-1.0%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(t1%20%3E%20t2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20t3%20%3D%20t1%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20t1%20%3D%20t2%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20t2%20%3D%20t3%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(t1%20%3E%20tmin)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20normal.y%20%3D%20s%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normal.x%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tmin%20%3D%20t1%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20tmax%20%3D%20Math.min(tmax%2C%20t2)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(tmin%20%3E%20tmax)%20return%20false%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20output.fraction%20%3D%20tmin%3B%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.TestOverlap%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20var%20d1X%20%3D%20other.lowerBound.x%20-%20this.upperBound.x%3B%0A%20%20%20%20%20%20var%20d1Y%20%3D%20other.lowerBound.y%20-%20this.upperBound.y%3B%0A%20%20%20%20%20%20var%20d2X%20%3D%20this.lowerBound.x%20-%20other.upperBound.x%3B%0A%20%20%20%20%20%20var%20d2Y%20%3D%20this.lowerBound.y%20-%20other.upperBound.y%3B%0A%20%20%20%20%20%20if%20(d1X%20%3E%200.0%20%7C%7C%20d1Y%20%3E%200.0)%20return%20false%3B%0A%20%20%20%20%20%20if%20(d2X%20%3E%200.0%20%7C%7C%20d2Y%20%3E%200.0)%20return%20false%3B%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.Combine%20%3D%20function%20(aabb1%2C%20aabb2)%20%7B%0A%20%20%20%20%20%20var%20aabb%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20aabb.Combine(aabb1%2C%20aabb2)%3B%0A%20%20%20%20%20%20return%20aabb%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2AABB.prototype.Combine%20%3D%20function%20(aabb1%2C%20aabb2)%20%7B%0A%20%20%20%20%20%20this.lowerBound.x%20%3D%20Math.min(aabb1.lowerBound.x%2C%20aabb2.lowerBound.x)%3B%0A%20%20%20%20%20%20this.lowerBound.y%20%3D%20Math.min(aabb1.lowerBound.y%2C%20aabb2.lowerBound.y)%3B%0A%20%20%20%20%20%20this.upperBound.x%20%3D%20Math.max(aabb1.upperBound.x%2C%20aabb2.upperBound.x)%3B%0A%20%20%20%20%20%20this.upperBound.y%20%3D%20Math.max(aabb1.upperBound.y%2C%20aabb2.upperBound.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Bound.b2Bound%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Bound.prototype.IsLower%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.value%20%26%201)%20%3D%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Bound.prototype.IsUpper%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.value%20%26%201)%20%3D%3D%201%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Bound.prototype.Swap%20%3D%20function%20(b)%20%7B%0A%20%20%20%20%20%20var%20tempValue%20%3D%20this.value%3B%0A%20%20%20%20%20%20var%20tempProxy%20%3D%20this.proxy%3B%0A%20%20%20%20%20%20var%20tempStabbingCount%20%3D%20this.stabbingCount%3B%0A%20%20%20%20%20%20this.value%20%3D%20b.value%3B%0A%20%20%20%20%20%20this.proxy%20%3D%20b.proxy%3B%0A%20%20%20%20%20%20this.stabbingCount%20%3D%20b.stabbingCount%3B%0A%20%20%20%20%20%20b.value%20%3D%20tempValue%3B%0A%20%20%20%20%20%20b.proxy%20%3D%20tempProxy%3B%0A%20%20%20%20%20%20b.stabbingCount%20%3D%20tempStabbingCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2BoundValues.b2BoundValues%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2BoundValues.prototype.b2BoundValues%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.lowerValues%20%3D%20new%20Vector_a2j_Number()%3B%0A%20%20%20%20%20%20this.lowerValues%5B0%5D%20%3D%200.0%3B%0A%20%20%20%20%20%20this.lowerValues%5B1%5D%20%3D%200.0%3B%0A%20%20%20%20%20%20this.upperValues%20%3D%20new%20Vector_a2j_Number()%3B%0A%20%20%20%20%20%20this.upperValues%5B0%5D%20%3D%200.0%3B%0A%20%20%20%20%20%20this.upperValues%5B1%5D%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.b2Collision%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Collision.ClipSegmentToLine%20%3D%20function%20(vOut%2C%20vIn%2C%20normal%2C%20offset)%20%7B%0A%20%20%20%20%20%20if%20(offset%20%3D%3D%3D%20undefined)%20offset%20%3D%200%3B%0A%20%20%20%20%20%20var%20cv%3B%0A%20%20%20%20%20%20var%20numOut%20%3D%200%3B%0A%20%20%20%20%20%20cv%20%3D%20vIn%5B0%5D%3B%0A%20%20%20%20%20%20var%20vIn0%20%3D%20cv.v%3B%0A%20%20%20%20%20%20cv%20%3D%20vIn%5B1%5D%3B%0A%20%20%20%20%20%20var%20vIn1%20%3D%20cv.v%3B%0A%20%20%20%20%20%20var%20distance0%20%3D%20normal.x%20*%20vIn0.x%20%2B%20normal.y%20*%20vIn0.y%20-%20offset%3B%0A%20%20%20%20%20%20var%20distance1%20%3D%20normal.x%20*%20vIn1.x%20%2B%20normal.y%20*%20vIn1.y%20-%20offset%3B%0A%20%20%20%20%20%20if%20(distance0%20%3C%3D%200.0)%20vOut%5BnumOut%2B%2B%5D.Set(vIn%5B0%5D)%3B%0A%20%20%20%20%20%20if%20(distance1%20%3C%3D%200.0)%20vOut%5BnumOut%2B%2B%5D.Set(vIn%5B1%5D)%3B%0A%20%20%20%20%20%20if%20(distance0%20*%20distance1%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20var%20interp%20%3D%20distance0%20%2F%20(distance0%20-%20distance1)%3B%0A%20%20%20%20%20%20%20%20cv%20%3D%20vOut%5BnumOut%5D%3B%0A%20%20%20%20%20%20%20%20var%20tVec%20%3D%20cv.v%3B%0A%20%20%20%20%20%20%20%20tVec.x%20%3D%20vIn0.x%20%2B%20interp%20*%20(vIn1.x%20-%20vIn0.x)%3B%0A%20%20%20%20%20%20%20%20tVec.y%20%3D%20vIn0.y%20%2B%20interp%20*%20(vIn1.y%20-%20vIn0.y)%3B%0A%20%20%20%20%20%20%20%20cv%20%3D%20vOut%5BnumOut%5D%3B%0A%20%20%20%20%20%20%20%20var%20cv2%3B%0A%20%20%20%20%20%20%20%20if%20(distance0%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20cv2%20%3D%20vIn%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20cv.id%20%3D%20cv2.id%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20cv2%20%3D%20vIn%5B1%5D%3B%0A%20%20%20%20%20%20%20%20%20%20cv.id%20%3D%20cv2.id%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%2B%2BnumOut%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20numOut%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.EdgeSeparation%20%3D%20function%20(poly1%2C%20xf1%2C%20edge1%2C%20poly2%2C%20xf2)%20%7B%0A%20%20%20%20%20%20if%20(edge1%20%3D%3D%3D%20undefined)%20edge1%20%3D%200%3B%0A%20%20%20%20%20%20var%20count1%20%3D%20parseInt(poly1.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20vertices1%20%3D%20poly1.m_vertices%3B%0A%20%20%20%20%20%20var%20normals1%20%3D%20poly1.m_normals%3B%0A%20%20%20%20%20%20var%20count2%20%3D%20parseInt(poly2.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20vertices2%20%3D%20poly2.m_vertices%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20normals1%5Bedge1%5D%3B%0A%20%20%20%20%20%20var%20normal1WorldX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20var%20normal1WorldY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20var%20normal1X%20%3D%20tMat.col1.x%20*%20normal1WorldX%20%2B%20tMat.col1.y%20*%20normal1WorldY%3B%0A%20%20%20%20%20%20var%20normal1Y%20%3D%20tMat.col2.x%20*%20normal1WorldX%20%2B%20tMat.col2.y%20*%20normal1WorldY%3B%0A%20%20%20%20%20%20var%20index%20%3D%200%3B%0A%20%20%20%20%20%20var%20minDot%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20count2%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20vertices2%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20dot%20%3D%20tVec.x%20*%20normal1X%20%2B%20tVec.y%20*%20normal1Y%3B%0A%20%20%20%20%20%20%20%20if%20(dot%20%3C%20minDot)%20%7B%0A%20%20%20%20%20%20%20%20%20%20minDot%20%3D%20dot%3B%0A%20%20%20%20%20%20%20%20%20%20index%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20tVec%20%3D%20vertices1%5Bedge1%5D%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20var%20v1X%20%3D%20xf1.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20v1Y%20%3D%20xf1.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tVec%20%3D%20vertices2%5Bindex%5D%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20var%20v2X%20%3D%20xf2.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20v2Y%20%3D%20xf2.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20v2X%20-%3D%20v1X%3B%0A%20%20%20%20%20%20v2Y%20-%3D%20v1Y%3B%0A%20%20%20%20%20%20var%20separation%20%3D%20v2X%20*%20normal1WorldX%20%2B%20v2Y%20*%20normal1WorldY%3B%0A%20%20%20%20%20%20return%20separation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.FindMaxSeparation%20%3D%20function%20(edgeIndex%2C%20poly1%2C%20xf1%2C%20poly2%2C%20xf2)%20%7B%0A%20%20%20%20%20%20var%20count1%20%3D%20parseInt(poly1.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20normals1%20%3D%20poly1.m_normals%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20poly2.m_centroid%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20xf2.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20xf2.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20poly1.m_centroid%3B%0A%20%20%20%20%20%20dX%20-%3D%20xf1.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20dY%20-%3D%20xf1.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20dLocal1X%20%3D%20dX%20*%20xf1.R.col1.x%20%2B%20dY%20*%20xf1.R.col1.y%3B%0A%20%20%20%20%20%20var%20dLocal1Y%20%3D%20dX%20*%20xf1.R.col2.x%20%2B%20dY%20*%20xf1.R.col2.y%3B%0A%20%20%20%20%20%20var%20edge%20%3D%200%3B%0A%20%20%20%20%20%20var%20maxDot%20%3D%20-Number.MAX_VALUE%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20count1%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20normals1%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20dot%20%3D%20tVec.x%20*%20dLocal1X%20%2B%20tVec.y%20*%20dLocal1Y%3B%0A%20%20%20%20%20%20%20%20if%20(dot%20%3E%20maxDot)%20%7B%0A%20%20%20%20%20%20%20%20%20%20maxDot%20%3D%20dot%3B%0A%20%20%20%20%20%20%20%20%20%20edge%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20s%20%3D%20b2Collision.EdgeSeparation(poly1%2C%20xf1%2C%20edge%2C%20poly2%2C%20xf2)%3B%0A%20%20%20%20%20%20var%20prevEdge%20%3D%20parseInt(edge%20-%201%20%3E%3D%200%20%3F%20edge%20-%201%20%3A%20count1%20-%201)%3B%0A%20%20%20%20%20%20var%20sPrev%20%3D%20b2Collision.EdgeSeparation(poly1%2C%20xf1%2C%20prevEdge%2C%20poly2%2C%20xf2)%3B%0A%20%20%20%20%20%20var%20nextEdge%20%3D%20parseInt(edge%20%2B%201%20%3C%20count1%20%3F%20edge%20%2B%201%20%3A%200)%3B%0A%20%20%20%20%20%20var%20sNext%20%3D%20b2Collision.EdgeSeparation(poly1%2C%20xf1%2C%20nextEdge%2C%20poly2%2C%20xf2)%3B%0A%20%20%20%20%20%20var%20bestEdge%20%3D%200%3B%0A%20%20%20%20%20%20var%20bestSeparation%20%3D%200%3B%0A%20%20%20%20%20%20var%20increment%20%3D%200%3B%0A%20%20%20%20%20%20if%20(sPrev%20%3E%20s%20%26%26%20sPrev%20%3E%20sNext)%20%7B%0A%20%20%20%20%20%20%20%20increment%20%3D%20-1%3B%0A%20%20%20%20%20%20%20%20bestEdge%20%3D%20prevEdge%3B%0A%20%20%20%20%20%20%20%20bestSeparation%20%3D%20sPrev%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(sNext%20%3E%20s)%20%7B%0A%20%20%20%20%20%20%20%20increment%20%3D%201%3B%0A%20%20%20%20%20%20%20%20bestEdge%20%3D%20nextEdge%3B%0A%20%20%20%20%20%20%20%20bestSeparation%20%3D%20sNext%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20edgeIndex%5B0%5D%20%3D%20edge%3B%0A%20%20%20%20%20%20%20%20return%20s%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20while%20(true)%20%7B%0A%20%20%20%20%20%20%20%20if%20(increment%20%3D%3D%20-1)%20edge%20%3D%20bestEdge%20-%201%20%3E%3D%200%20%3F%20bestEdge%20-%201%20%3A%20count1%20-%201%3B%0A%20%20%20%20%20%20%20%20else%20edge%20%3D%20bestEdge%20%2B%201%20%3C%20count1%20%3F%20bestEdge%20%2B%201%20%3A%200%3B%0A%20%20%20%20%20%20%20%20s%20%3D%20b2Collision.EdgeSeparation(poly1%2C%20xf1%2C%20edge%2C%20poly2%2C%20xf2)%3B%0A%20%20%20%20%20%20%20%20if%20(s%20%3E%20bestSeparation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bestEdge%20%3D%20edge%3B%0A%20%20%20%20%20%20%20%20%20%20bestSeparation%20%3D%20s%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20edgeIndex%5B0%5D%20%3D%20bestEdge%3B%0A%20%20%20%20%20%20return%20bestSeparation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.FindIncidentEdge%20%3D%20function%20(c%2C%20poly1%2C%20xf1%2C%20edge1%2C%20poly2%2C%20xf2)%20%7B%0A%20%20%20%20%20%20if%20(edge1%20%3D%3D%3D%20undefined)%20edge1%20%3D%200%3B%0A%20%20%20%20%20%20var%20count1%20%3D%20parseInt(poly1.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20normals1%20%3D%20poly1.m_normals%3B%0A%20%20%20%20%20%20var%20count2%20%3D%20parseInt(poly2.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20vertices2%20%3D%20poly2.m_vertices%3B%0A%20%20%20%20%20%20var%20normals2%20%3D%20poly2.m_normals%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20normals1%5Bedge1%5D%3B%0A%20%20%20%20%20%20var%20normal1X%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20var%20normal1Y%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20normal1X%20%2B%20tMat.col1.y%20*%20normal1Y%3B%0A%20%20%20%20%20%20normal1Y%20%3D%20tMat.col2.x%20*%20normal1X%20%2B%20tMat.col2.y%20*%20normal1Y%3B%0A%20%20%20%20%20%20normal1X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20index%20%3D%200%3B%0A%20%20%20%20%20%20var%20minDot%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20count2%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20normals2%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20dot%20%3D%20normal1X%20*%20tVec.x%20%2B%20normal1Y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20if%20(dot%20%3C%20minDot)%20%7B%0A%20%20%20%20%20%20%20%20%20%20minDot%20%3D%20dot%3B%0A%20%20%20%20%20%20%20%20%20%20index%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20tClip%3B%0A%20%20%20%20%20%20var%20i1%20%3D%20parseInt(index)%3B%0A%20%20%20%20%20%20var%20i2%20%3D%20parseInt(i1%20%2B%201%20%3C%20count2%20%3F%20i1%20%2B%201%20%3A%200)%3B%0A%20%20%20%20%20%20tClip%20%3D%20c%5B0%5D%3B%0A%20%20%20%20%20%20tVec%20%3D%20vertices2%5Bi1%5D%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20tClip.v.x%20%3D%20xf2.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tClip.v.y%20%3D%20xf2.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tClip.id.features.referenceEdge%20%3D%20edge1%3B%0A%20%20%20%20%20%20tClip.id.features.incidentEdge%20%3D%20i1%3B%0A%20%20%20%20%20%20tClip.id.features.incidentVertex%20%3D%200%3B%0A%20%20%20%20%20%20tClip%20%3D%20c%5B1%5D%3B%0A%20%20%20%20%20%20tVec%20%3D%20vertices2%5Bi2%5D%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20tClip.v.x%20%3D%20xf2.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tClip.v.y%20%3D%20xf2.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tClip.id.features.referenceEdge%20%3D%20edge1%3B%0A%20%20%20%20%20%20tClip.id.features.incidentEdge%20%3D%20i2%3B%0A%20%20%20%20%20%20tClip.id.features.incidentVertex%20%3D%201%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.MakeClipPointVector%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20r%20%3D%20new%20Vector(2)%3B%0A%20%20%20%20%20%20r%5B0%5D%20%3D%20new%20ClipVertex()%3B%0A%20%20%20%20%20%20r%5B1%5D%20%3D%20new%20ClipVertex()%3B%0A%20%20%20%20%20%20return%20r%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.CollidePolygons%20%3D%20function%20(manifold%2C%20polyA%2C%20xfA%2C%20polyB%2C%20xfB)%20%7B%0A%20%20%20%20%20%20var%20cv%3B%0A%20%20%20%20%20%20manifold.m_pointCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20totalRadius%20%3D%20polyA.m_radius%20%2B%20polyB.m_radius%3B%0A%20%20%20%20%20%20var%20edgeA%20%3D%200%3B%0A%20%20%20%20%20%20b2Collision.s_edgeAO%5B0%5D%20%3D%20edgeA%3B%0A%20%20%20%20%20%20var%20separationA%20%3D%20b2Collision.FindMaxSeparation(%0A%20%20%20%20%20%20%20%20b2Collision.s_edgeAO%2C%0A%20%20%20%20%20%20%20%20polyA%2C%0A%20%20%20%20%20%20%20%20xfA%2C%0A%20%20%20%20%20%20%20%20polyB%2C%0A%20%20%20%20%20%20%20%20xfB%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20edgeA%20%3D%20b2Collision.s_edgeAO%5B0%5D%3B%0A%20%20%20%20%20%20if%20(separationA%20%3E%20totalRadius)%20return%3B%0A%20%20%20%20%20%20var%20edgeB%20%3D%200%3B%0A%20%20%20%20%20%20b2Collision.s_edgeBO%5B0%5D%20%3D%20edgeB%3B%0A%20%20%20%20%20%20var%20separationB%20%3D%20b2Collision.FindMaxSeparation(%0A%20%20%20%20%20%20%20%20b2Collision.s_edgeBO%2C%0A%20%20%20%20%20%20%20%20polyB%2C%0A%20%20%20%20%20%20%20%20xfB%2C%0A%20%20%20%20%20%20%20%20polyA%2C%0A%20%20%20%20%20%20%20%20xfA%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20edgeB%20%3D%20b2Collision.s_edgeBO%5B0%5D%3B%0A%20%20%20%20%20%20if%20(separationB%20%3E%20totalRadius)%20return%3B%0A%20%20%20%20%20%20var%20poly1%3B%0A%20%20%20%20%20%20var%20poly2%3B%0A%20%20%20%20%20%20var%20xf1%3B%0A%20%20%20%20%20%20var%20xf2%3B%0A%20%20%20%20%20%20var%20edge1%20%3D%200%3B%0A%20%20%20%20%20%20var%20flip%20%3D%200%3B%0A%20%20%20%20%20%20var%20k_relativeTol%20%3D%200.98%3B%0A%20%20%20%20%20%20var%20k_absoluteTol%20%3D%200.001%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20if%20(separationB%20%3E%20k_relativeTol%20*%20separationA%20%2B%20k_absoluteTol)%20%7B%0A%20%20%20%20%20%20%20%20poly1%20%3D%20polyB%3B%0A%20%20%20%20%20%20%20%20poly2%20%3D%20polyA%3B%0A%20%20%20%20%20%20%20%20xf1%20%3D%20xfB%3B%0A%20%20%20%20%20%20%20%20xf2%20%3D%20xfA%3B%0A%20%20%20%20%20%20%20%20edge1%20%3D%20edgeB%3B%0A%20%20%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_faceB%3B%0A%20%20%20%20%20%20%20%20flip%20%3D%201%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20poly1%20%3D%20polyA%3B%0A%20%20%20%20%20%20%20%20poly2%20%3D%20polyB%3B%0A%20%20%20%20%20%20%20%20xf1%20%3D%20xfA%3B%0A%20%20%20%20%20%20%20%20xf2%20%3D%20xfB%3B%0A%20%20%20%20%20%20%20%20edge1%20%3D%20edgeA%3B%0A%20%20%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_faceA%3B%0A%20%20%20%20%20%20%20%20flip%20%3D%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20incidentEdge%20%3D%20b2Collision.s_incidentEdge%3B%0A%20%20%20%20%20%20b2Collision.FindIncidentEdge(incidentEdge%2C%20poly1%2C%20xf1%2C%20edge1%2C%20poly2%2C%20xf2)%3B%0A%20%20%20%20%20%20var%20count1%20%3D%20parseInt(poly1.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20vertices1%20%3D%20poly1.m_vertices%3B%0A%20%20%20%20%20%20var%20local_v11%20%3D%20vertices1%5Bedge1%5D%3B%0A%20%20%20%20%20%20var%20local_v12%3B%0A%20%20%20%20%20%20if%20(edge1%20%2B%201%20%3C%20count1)%20%7B%0A%20%20%20%20%20%20%20%20local_v12%20%3D%20vertices1%5BparseInt(edge1%20%2B%201)%5D%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20local_v12%20%3D%20vertices1%5B0%5D%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20localTangent%20%3D%20b2Collision.s_localTangent%3B%0A%20%20%20%20%20%20localTangent.Set(local_v12.x%20-%20local_v11.x%2C%20local_v12.y%20-%20local_v11.y)%3B%0A%20%20%20%20%20%20localTangent.Normalize()%3B%0A%20%20%20%20%20%20var%20localNormal%20%3D%20b2Collision.s_localNormal%3B%0A%20%20%20%20%20%20localNormal.x%20%3D%20localTangent.y%3B%0A%20%20%20%20%20%20localNormal.y%20%3D%20-localTangent.x%3B%0A%20%20%20%20%20%20var%20planePoint%20%3D%20b2Collision.s_planePoint%3B%0A%20%20%20%20%20%20planePoint.Set(%0A%20%20%20%20%20%20%20%200.5%20*%20(local_v11.x%20%2B%20local_v12.x)%2C%0A%20%20%20%20%20%20%20%200.5%20*%20(local_v11.y%20%2B%20local_v12.y)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20tangent%20%3D%20b2Collision.s_tangent%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20tangent.x%20%3D%20tMat.col1.x%20*%20localTangent.x%20%2B%20tMat.col2.x%20*%20localTangent.y%3B%0A%20%20%20%20%20%20tangent.y%20%3D%20tMat.col1.y%20*%20localTangent.x%20%2B%20tMat.col2.y%20*%20localTangent.y%3B%0A%20%20%20%20%20%20var%20tangent2%20%3D%20b2Collision.s_tangent2%3B%0A%20%20%20%20%20%20tangent2.x%20%3D%20-tangent.x%3B%0A%20%20%20%20%20%20tangent2.y%20%3D%20-tangent.y%3B%0A%20%20%20%20%20%20var%20normal%20%3D%20b2Collision.s_normal%3B%0A%20%20%20%20%20%20normal.x%20%3D%20tangent.y%3B%0A%20%20%20%20%20%20normal.y%20%3D%20-tangent.x%3B%0A%20%20%20%20%20%20var%20v11%20%3D%20b2Collision.s_v11%3B%0A%20%20%20%20%20%20var%20v12%20%3D%20b2Collision.s_v12%3B%0A%20%20%20%20%20%20v11.x%20%3D%0A%20%20%20%20%20%20%20%20xf1.position.x%20%2B%20(tMat.col1.x%20*%20local_v11.x%20%2B%20tMat.col2.x%20*%20local_v11.y)%3B%0A%20%20%20%20%20%20v11.y%20%3D%0A%20%20%20%20%20%20%20%20xf1.position.y%20%2B%20(tMat.col1.y%20*%20local_v11.x%20%2B%20tMat.col2.y%20*%20local_v11.y)%3B%0A%20%20%20%20%20%20v12.x%20%3D%0A%20%20%20%20%20%20%20%20xf1.position.x%20%2B%20(tMat.col1.x%20*%20local_v12.x%20%2B%20tMat.col2.x%20*%20local_v12.y)%3B%0A%20%20%20%20%20%20v12.y%20%3D%0A%20%20%20%20%20%20%20%20xf1.position.y%20%2B%20(tMat.col1.y%20*%20local_v12.x%20%2B%20tMat.col2.y%20*%20local_v12.y)%3B%0A%20%20%20%20%20%20var%20frontOffset%20%3D%20normal.x%20*%20v11.x%20%2B%20normal.y%20*%20v11.y%3B%0A%20%20%20%20%20%20var%20sideOffset1%20%3D%20-tangent.x%20*%20v11.x%20-%20tangent.y%20*%20v11.y%20%2B%20totalRadius%3B%0A%20%20%20%20%20%20var%20sideOffset2%20%3D%20tangent.x%20*%20v12.x%20%2B%20tangent.y%20*%20v12.y%20%2B%20totalRadius%3B%0A%20%20%20%20%20%20var%20clipPoints1%20%3D%20b2Collision.s_clipPoints1%3B%0A%20%20%20%20%20%20var%20clipPoints2%20%3D%20b2Collision.s_clipPoints2%3B%0A%20%20%20%20%20%20var%20np%20%3D%200%3B%0A%20%20%20%20%20%20np%20%3D%20b2Collision.ClipSegmentToLine(%0A%20%20%20%20%20%20%20%20clipPoints1%2C%0A%20%20%20%20%20%20%20%20incidentEdge%2C%0A%20%20%20%20%20%20%20%20tangent2%2C%0A%20%20%20%20%20%20%20%20sideOffset1%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20if%20(np%20%3C%202)%20return%3B%0A%20%20%20%20%20%20np%20%3D%20b2Collision.ClipSegmentToLine(%0A%20%20%20%20%20%20%20%20clipPoints2%2C%0A%20%20%20%20%20%20%20%20clipPoints1%2C%0A%20%20%20%20%20%20%20%20tangent%2C%0A%20%20%20%20%20%20%20%20sideOffset2%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20if%20(np%20%3C%202)%20return%3B%0A%20%20%20%20%20%20manifold.m_localPlaneNormal.SetV(localNormal)%3B%0A%20%20%20%20%20%20manifold.m_localPoint.SetV(planePoint)%3B%0A%20%20%20%20%20%20var%20pointCount%20%3D%200%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20cv%20%3D%20clipPoints2%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20separation%20%3D%20normal.x%20*%20cv.v.x%20%2B%20normal.y%20*%20cv.v.y%20-%20frontOffset%3B%0A%20%20%20%20%20%20%20%20if%20(separation%20%3C%3D%20totalRadius)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20cp%20%3D%20manifold.m_points%5BpointCount%5D%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tX%20%3D%20cv.v.x%20-%20xf2.position.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tY%20%3D%20cv.v.y%20-%20xf2.position.y%3B%0A%20%20%20%20%20%20%20%20%20%20cp.m_localPoint.x%20%3D%20tX%20*%20tMat.col1.x%20%2B%20tY%20*%20tMat.col1.y%3B%0A%20%20%20%20%20%20%20%20%20%20cp.m_localPoint.y%20%3D%20tX%20*%20tMat.col2.x%20%2B%20tY%20*%20tMat.col2.y%3B%0A%20%20%20%20%20%20%20%20%20%20cp.m_id.Set(cv.id)%3B%0A%20%20%20%20%20%20%20%20%20%20cp.m_id.features.flip%20%3D%20flip%3B%0A%20%20%20%20%20%20%20%20%20%20%2B%2BpointCount%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20manifold.m_pointCount%20%3D%20pointCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.CollideCircles%20%3D%20function%20(manifold%2C%20circle1%2C%20xf1%2C%20circle2%2C%20xf2)%20%7B%0A%20%20%20%20%20%20manifold.m_pointCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20circle1.m_p%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%20xf1.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%20xf1.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20circle2.m_p%3B%0A%20%20%20%20%20%20var%20p2X%20%3D%20xf2.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20p2Y%20%3D%20xf2.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p2X%20-%20p1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p2Y%20-%20p1Y%3B%0A%20%20%20%20%20%20var%20distSqr%20%3D%20dX%20*%20dX%20%2B%20dY%20*%20dY%3B%0A%20%20%20%20%20%20var%20radius%20%3D%20circle1.m_radius%20%2B%20circle2.m_radius%3B%0A%20%20%20%20%20%20if%20(distSqr%20%3E%20radius%20*%20radius)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_circles%3B%0A%20%20%20%20%20%20manifold.m_localPoint.SetV(circle1.m_p)%3B%0A%20%20%20%20%20%20manifold.m_localPlaneNormal.SetZero()%3B%0A%20%20%20%20%20%20manifold.m_pointCount%20%3D%201%3B%0A%20%20%20%20%20%20manifold.m_points%5B0%5D.m_localPoint.SetV(circle2.m_p)%3B%0A%20%20%20%20%20%20manifold.m_points%5B0%5D.m_id.key%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.CollidePolygonAndCircle%20%3D%20function%20(%0A%20%20%20%20%20%20manifold%2C%0A%20%20%20%20%20%20polygon%2C%0A%20%20%20%20%20%20xf1%2C%0A%20%20%20%20%20%20circle%2C%0A%20%20%20%20%20%20xf2%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20manifold.m_pointCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20tPoint%3B%0A%20%20%20%20%20%20var%20dX%20%3D%200%3B%0A%20%20%20%20%20%20var%20dY%20%3D%200%3B%0A%20%20%20%20%20%20var%20positionX%20%3D%200%3B%0A%20%20%20%20%20%20var%20positionY%20%3D%200%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf2.R%3B%0A%20%20%20%20%20%20tVec%20%3D%20circle.m_p%3B%0A%20%20%20%20%20%20var%20cX%20%3D%20xf2.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20cY%20%3D%20xf2.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20dX%20%3D%20cX%20-%20xf1.position.x%3B%0A%20%20%20%20%20%20dY%20%3D%20cY%20-%20xf1.position.y%3B%0A%20%20%20%20%20%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20var%20cLocalX%20%3D%20dX%20*%20tMat.col1.x%20%2B%20dY%20*%20tMat.col1.y%3B%0A%20%20%20%20%20%20var%20cLocalY%20%3D%20dX%20*%20tMat.col2.x%20%2B%20dY%20*%20tMat.col2.y%3B%0A%20%20%20%20%20%20var%20dist%20%3D%200%3B%0A%20%20%20%20%20%20var%20normalIndex%20%3D%200%3B%0A%20%20%20%20%20%20var%20separation%20%3D%20-Number.MAX_VALUE%3B%0A%20%20%20%20%20%20var%20radius%20%3D%20polygon.m_radius%20%2B%20circle.m_radius%3B%0A%20%20%20%20%20%20var%20vertexCount%20%3D%20parseInt(polygon.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20vertices%20%3D%20polygon.m_vertices%3B%0A%20%20%20%20%20%20var%20normals%20%3D%20polygon.m_normals%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20dX%20%3D%20cLocalX%20-%20tVec.x%3B%0A%20%20%20%20%20%20%20%20dY%20%3D%20cLocalY%20-%20tVec.y%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20normals%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20s%20%3D%20tVec.x%20*%20dX%20%2B%20tVec.y%20*%20dY%3B%0A%20%20%20%20%20%20%20%20if%20(s%20%3E%20radius)%20%7B%0A%20%20%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(s%20%3E%20separation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20separation%20%3D%20s%3B%0A%20%20%20%20%20%20%20%20%20%20normalIndex%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20vertIndex1%20%3D%20parseInt(normalIndex)%3B%0A%20%20%20%20%20%20var%20vertIndex2%20%3D%20parseInt(%0A%20%20%20%20%20%20%20%20vertIndex1%20%2B%201%20%3C%20vertexCount%20%3F%20vertIndex1%20%2B%201%20%3A%200%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20vertices%5BvertIndex1%5D%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20vertices%5BvertIndex2%5D%3B%0A%20%20%20%20%20%20if%20(separation%20%3C%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20manifold.m_pointCount%20%3D%201%3B%0A%20%20%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_faceA%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.SetV(normals%5BnormalIndex%5D)%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPoint.x%20%3D%200.5%20*%20(v1.x%20%2B%20v2.x)%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPoint.y%20%3D%200.5%20*%20(v1.y%20%2B%20v2.y)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_localPoint.SetV(circle.m_p)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_id.key%20%3D%200%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20u1%20%3D%0A%20%20%20%20%20%20%20%20(cLocalX%20-%20v1.x)%20*%20(v2.x%20-%20v1.x)%20%2B%20(cLocalY%20-%20v1.y)%20*%20(v2.y%20-%20v1.y)%3B%0A%20%20%20%20%20%20var%20u2%20%3D%0A%20%20%20%20%20%20%20%20(cLocalX%20-%20v2.x)%20*%20(v1.x%20-%20v2.x)%20%2B%20(cLocalY%20-%20v2.y)%20*%20(v1.y%20-%20v2.y)%3B%0A%20%20%20%20%20%20if%20(u1%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20(cLocalX%20-%20v1.x)%20*%20(cLocalX%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(cLocalY%20-%20v1.y)%20*%20(cLocalY%20-%20v1.y)%20%3E%0A%20%20%20%20%20%20%20%20%20%20radius%20*%20radius%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20manifold.m_pointCount%20%3D%201%3B%0A%20%20%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_faceA%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.x%20%3D%20cLocalX%20-%20v1.x%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.y%20%3D%20cLocalY%20-%20v1.y%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.Normalize()%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPoint.SetV(v1)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_localPoint.SetV(circle.m_p)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_id.key%20%3D%200%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(u2%20%3C%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20(cLocalX%20-%20v2.x)%20*%20(cLocalX%20-%20v2.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(cLocalY%20-%20v2.y)%20*%20(cLocalY%20-%20v2.y)%20%3E%0A%20%20%20%20%20%20%20%20%20%20radius%20*%20radius%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%20%20manifold.m_pointCount%20%3D%201%3B%0A%20%20%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_faceA%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.x%20%3D%20cLocalX%20-%20v2.x%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.y%20%3D%20cLocalY%20-%20v2.y%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.Normalize()%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPoint.SetV(v2)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_localPoint.SetV(circle.m_p)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_id.key%20%3D%200%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20var%20faceCenterX%20%3D%200.5%20*%20(v1.x%20%2B%20v2.x)%3B%0A%20%20%20%20%20%20%20%20var%20faceCenterY%20%3D%200.5%20*%20(v1.y%20%2B%20v2.y)%3B%0A%20%20%20%20%20%20%20%20separation%20%3D%0A%20%20%20%20%20%20%20%20%20%20(cLocalX%20-%20faceCenterX)%20*%20normals%5BvertIndex1%5D.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20(cLocalY%20-%20faceCenterY)%20*%20normals%5BvertIndex1%5D.y%3B%0A%20%20%20%20%20%20%20%20if%20(separation%20%3E%20radius)%20return%3B%0A%20%20%20%20%20%20%20%20manifold.m_pointCount%20%3D%201%3B%0A%20%20%20%20%20%20%20%20manifold.m_type%20%3D%20b2Manifold.e_faceA%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.x%20%3D%20normals%5BvertIndex1%5D.x%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.y%20%3D%20normals%5BvertIndex1%5D.y%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPlaneNormal.Normalize()%3B%0A%20%20%20%20%20%20%20%20manifold.m_localPoint.Set(faceCenterX%2C%20faceCenterY)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_localPoint.SetV(circle.m_p)%3B%0A%20%20%20%20%20%20%20%20manifold.m_points%5B0%5D.m_id.key%20%3D%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Collision.TestOverlap%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20t1%20%3D%20b.lowerBound%3B%0A%20%20%20%20%20%20var%20t2%20%3D%20a.upperBound%3B%0A%20%20%20%20%20%20var%20d1X%20%3D%20t1.x%20-%20t2.x%3B%0A%20%20%20%20%20%20var%20d1Y%20%3D%20t1.y%20-%20t2.y%3B%0A%20%20%20%20%20%20t1%20%3D%20a.lowerBound%3B%0A%20%20%20%20%20%20t2%20%3D%20b.upperBound%3B%0A%20%20%20%20%20%20var%20d2X%20%3D%20t1.x%20-%20t2.x%3B%0A%20%20%20%20%20%20var%20d2Y%20%3D%20t1.y%20-%20t2.y%3B%0A%20%20%20%20%20%20if%20(d1X%20%3E%200.0%20%7C%7C%20d1Y%20%3E%200.0)%20return%20false%3B%0A%20%20%20%20%20%20if%20(d2X%20%3E%200.0%20%7C%7C%20d2Y%20%3E%200.0)%20return%20false%3B%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_incidentEdge%20%3D%0A%20%20%20%20%20%20%20%20b2Collision.MakeClipPointVector()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_clipPoints1%20%3D%0A%20%20%20%20%20%20%20%20b2Collision.MakeClipPointVector()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_clipPoints2%20%3D%0A%20%20%20%20%20%20%20%20b2Collision.MakeClipPointVector()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_edgeAO%20%3D%20new%20Vector_a2j_Number(1)%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_edgeBO%20%3D%20new%20Vector_a2j_Number(1)%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_localTangent%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_localNormal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_planePoint%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_tangent%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_tangent2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_v11%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.s_v12%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.b2CollidePolyTempVec%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Collision.b2_nullFeature%20%3D%200x000000ff%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2ContactID.b2ContactID%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.features%20%3D%20new%20Features()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactID.prototype.b2ContactID%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.features._m_id%20%3D%20this%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactID.prototype.Set%20%3D%20function%20(id)%20%7B%0A%20%20%20%20%20%20this.key%20%3D%20id._key%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactID.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20id%20%3D%20new%20b2ContactID()%3B%0A%20%20%20%20%20%20id.key%20%3D%20this.key%3B%0A%20%20%20%20%20%20return%20id%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Object.defineProperty(b2ContactID.prototype%2C%20%22key%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20get%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20return%20this._key%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(b2ContactID.prototype%2C%20%22key%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(value)%20%7B%0A%20%20%20%20%20%20%20%20if%20(value%20%3D%3D%3D%20undefined)%20value%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._key%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20this.features._referenceEdge%20%3D%20this._key%20%26%200x000000ff%3B%0A%20%20%20%20%20%20%20%20this.features._incidentEdge%20%3D%0A%20%20%20%20%20%20%20%20%20%20((this._key%20%26%200x0000ff00)%20%3E%3E%208)%20%26%200x000000ff%3B%0A%20%20%20%20%20%20%20%20this.features._incidentVertex%20%3D%0A%20%20%20%20%20%20%20%20%20%20((this._key%20%26%200x00ff0000)%20%3E%3E%2016)%20%26%200x000000ff%3B%0A%20%20%20%20%20%20%20%20this.features._flip%20%3D%20((this._key%20%26%200xff000000)%20%3E%3E%2024)%20%26%200x000000ff%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2ContactPoint.b2ContactPoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.position%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.velocity%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.id%20%3D%20new%20b2ContactID()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Distance.b2Distance%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Distance.Distance%20%3D%20function%20(output%2C%20cache%2C%20input)%20%7B%0A%20%20%20%20%20%20%2B%2Bb2Distance.b2_gjkCalls%3B%0A%20%20%20%20%20%20var%20proxyA%20%3D%20input.proxyA%3B%0A%20%20%20%20%20%20var%20proxyB%20%3D%20input.proxyB%3B%0A%20%20%20%20%20%20var%20transformA%20%3D%20input.transformA%3B%0A%20%20%20%20%20%20var%20transformB%20%3D%20input.transformB%3B%0A%20%20%20%20%20%20var%20simplex%20%3D%20b2Distance.s_simplex%3B%0A%20%20%20%20%20%20simplex.ReadCache(cache%2C%20proxyA%2C%20transformA%2C%20proxyB%2C%20transformB)%3B%0A%20%20%20%20%20%20var%20vertices%20%3D%20simplex.m_vertices%3B%0A%20%20%20%20%20%20var%20k_maxIters%20%3D%2020%3B%0A%20%20%20%20%20%20var%20saveA%20%3D%20b2Distance.s_saveA%3B%0A%20%20%20%20%20%20var%20saveB%20%3D%20b2Distance.s_saveB%3B%0A%20%20%20%20%20%20var%20saveCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20closestPoint%20%3D%20simplex.GetClosestPoint()%3B%0A%20%20%20%20%20%20var%20distanceSqr1%20%3D%20closestPoint.LengthSquared()%3B%0A%20%20%20%20%20%20var%20distanceSqr2%20%3D%20distanceSqr1%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20p%3B%0A%20%20%20%20%20%20var%20iter%20%3D%200%3B%0A%20%20%20%20%20%20while%20(iter%20%3C%20k_maxIters)%20%7B%0A%20%20%20%20%20%20%20%20saveCount%20%3D%20simplex.m_count%3B%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20saveCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20saveA%5Bi%5D%20%3D%20vertices%5Bi%5D.indexA%3B%0A%20%20%20%20%20%20%20%20%20%20saveB%5Bi%5D%20%3D%20vertices%5Bi%5D.indexB%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20switch%20(simplex.m_count)%20%7B%0A%20%20%20%20%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20case%202%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20simplex.Solve2()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20case%203%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20simplex.Solve3()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(simplex.m_count%20%3D%3D%203)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20p%20%3D%20simplex.GetClosestPoint()%3B%0A%20%20%20%20%20%20%20%20distanceSqr2%20%3D%20p.LengthSquared()%3B%0A%20%20%20%20%20%20%20%20if%20(distanceSqr2%20%3E%20distanceSqr1)%20%7B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20distanceSqr1%20%3D%20distanceSqr2%3B%0A%20%20%20%20%20%20%20%20var%20d%20%3D%20simplex.GetSearchDirection()%3B%0A%20%20%20%20%20%20%20%20if%20(d.LengthSquared()%20%3C%20Number.MIN_VALUE%20*%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20vertex%20%3D%20vertices%5Bsimplex.m_count%5D%3B%0A%20%20%20%20%20%20%20%20vertex.indexA%20%3D%20proxyA.GetSupport(%0A%20%20%20%20%20%20%20%20%20%20b2Math.MulTMV(transformA.R%2C%20d.GetNegative())%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20vertex.wA%20%3D%20b2Math.MulX(transformA%2C%20proxyA.GetVertex(vertex.indexA))%3B%0A%20%20%20%20%20%20%20%20vertex.indexB%20%3D%20proxyB.GetSupport(b2Math.MulTMV(transformB.R%2C%20d))%3B%0A%20%20%20%20%20%20%20%20vertex.wB%20%3D%20b2Math.MulX(transformB%2C%20proxyB.GetVertex(vertex.indexB))%3B%0A%20%20%20%20%20%20%20%20vertex.w%20%3D%20b2Math.SubtractVV(vertex.wB%2C%20vertex.wA)%3B%0A%20%20%20%20%20%20%20%20%2B%2Biter%3B%0A%20%20%20%20%20%20%20%20%2B%2Bb2Distance.b2_gjkIters%3B%0A%20%20%20%20%20%20%20%20var%20duplicate%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20saveCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(vertex.indexA%20%3D%3D%20saveA%5Bi%5D%20%26%26%20vertex.indexB%20%3D%3D%20saveB%5Bi%5D)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20duplicate%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(duplicate)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%2B%2Bsimplex.m_count%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20b2Distance.b2_gjkMaxIters%20%3D%20b2Math.Max(b2Distance.b2_gjkMaxIters%2C%20iter)%3B%0A%20%20%20%20%20%20simplex.GetWitnessPoints(output.pointA%2C%20output.pointB)%3B%0A%20%20%20%20%20%20output.distance%20%3D%20b2Math.SubtractVV(output.pointA%2C%20output.pointB).Length()%3B%0A%20%20%20%20%20%20output.iterations%20%3D%20iter%3B%0A%20%20%20%20%20%20simplex.WriteCache(cache)%3B%0A%20%20%20%20%20%20if%20(input.useRadii)%20%7B%0A%20%20%20%20%20%20%20%20var%20rA%20%3D%20proxyA.m_radius%3B%0A%20%20%20%20%20%20%20%20var%20rB%20%3D%20proxyB.m_radius%3B%0A%20%20%20%20%20%20%20%20if%20(output.distance%20%3E%20rA%20%2B%20rB%20%26%26%20output.distance%20%3E%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20output.distance%20-%3D%20rA%20%2B%20rB%3B%0A%20%20%20%20%20%20%20%20%20%20var%20normal%20%3D%20b2Math.SubtractVV(output.pointB%2C%20output.pointA)%3B%0A%20%20%20%20%20%20%20%20%20%20normal.Normalize()%3B%0A%20%20%20%20%20%20%20%20%20%20output.pointA.x%20%2B%3D%20rA%20*%20normal.x%3B%0A%20%20%20%20%20%20%20%20%20%20output.pointA.y%20%2B%3D%20rA%20*%20normal.y%3B%0A%20%20%20%20%20%20%20%20%20%20output.pointB.x%20-%3D%20rB%20*%20normal.x%3B%0A%20%20%20%20%20%20%20%20%20%20output.pointB.y%20-%3D%20rB%20*%20normal.y%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20p%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20%20%20p.x%20%3D%200.5%20*%20(output.pointA.x%20%2B%20output.pointB.x)%3B%0A%20%20%20%20%20%20%20%20%20%20p.y%20%3D%200.5%20*%20(output.pointA.y%20%2B%20output.pointB.y)%3B%0A%20%20%20%20%20%20%20%20%20%20output.pointA.x%20%3D%20output.pointB.x%20%3D%20p.x%3B%0A%20%20%20%20%20%20%20%20%20%20output.pointA.y%20%3D%20output.pointB.y%20%3D%20p.y%3B%0A%20%20%20%20%20%20%20%20%20%20output.distance%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.b2Distance.s_simplex%20%3D%20new%20b2Simplex()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Distance.s_saveA%20%3D%20new%20Vector_a2j_Number(3)%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Distance.s_saveB%20%3D%20new%20Vector_a2j_Number(3)%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2DistanceInput.b2DistanceInput%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DistanceOutput.b2DistanceOutput%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.pointA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.pointB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceProxy.b2DistanceProxy%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DistanceProxy.prototype.Set%20%3D%20function%20(shape)%20%7B%0A%20%20%20%20%20%20switch%20(shape.GetType())%20%7B%0A%20%20%20%20%20%20%20%20case%20b2Shape.e_circleShape%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle%20%3D%20shape%20instanceof%20b2CircleShape%20%3F%20shape%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_vertices%20%3D%20new%20Vector(1%2C%20true)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_vertices%5B0%5D%20%3D%20circle.m_p%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_radius%20%3D%20circle.m_radius%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Shape.e_polygonShape%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20polygon%20%3D%20shape%20instanceof%20b2PolygonShape%20%3F%20shape%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_vertices%20%3D%20polygon.m_vertices%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_count%20%3D%20polygon.m_vertexCount%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_radius%20%3D%20polygon.m_radius%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceProxy.prototype.GetSupport%20%3D%20function%20(d)%20%7B%0A%20%20%20%20%20%20var%20bestIndex%20%3D%200%3B%0A%20%20%20%20%20%20var%20bestValue%20%3D%20this.m_vertices%5B0%5D.x%20*%20d.x%20%2B%20this.m_vertices%5B0%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20this.m_count%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20value%20%3D%20this.m_vertices%5Bi%5D.x%20*%20d.x%20%2B%20this.m_vertices%5Bi%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20%20%20if%20(value%20%3E%20bestValue)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bestIndex%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%20%20bestValue%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20bestIndex%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceProxy.prototype.GetSupportVertex%20%3D%20function%20(d)%20%7B%0A%20%20%20%20%20%20var%20bestIndex%20%3D%200%3B%0A%20%20%20%20%20%20var%20bestValue%20%3D%20this.m_vertices%5B0%5D.x%20*%20d.x%20%2B%20this.m_vertices%5B0%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20this.m_count%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20value%20%3D%20this.m_vertices%5Bi%5D.x%20*%20d.x%20%2B%20this.m_vertices%5Bi%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20%20%20if%20(value%20%3E%20bestValue)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bestIndex%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%20%20bestValue%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20this.m_vertices%5BbestIndex%5D%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceProxy.prototype.GetVertexCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_count%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceProxy.prototype.GetVertex%20%3D%20function%20(index)%20%7B%0A%20%20%20%20%20%20if%20(index%20%3D%3D%3D%20undefined)%20index%20%3D%200%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(0%20%3C%3D%20index%20%26%26%20index%20%3C%20this.m_count)%3B%0A%20%20%20%20%20%20return%20this.m_vertices%5Bindex%5D%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.b2DynamicTree%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.b2DynamicTree%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_root%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_freeList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_path%20%3D%200%3B%0A%20%20%20%20%20%20this.m_insertionCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.CreateProxy%20%3D%20function%20(aabb%2C%20userData)%20%7B%0A%20%20%20%20%20%20var%20node%20%3D%20this.AllocateNode()%3B%0A%20%20%20%20%20%20var%20extendX%20%3D%20b2Settings.b2_aabbExtension%3B%0A%20%20%20%20%20%20var%20extendY%20%3D%20b2Settings.b2_aabbExtension%3B%0A%20%20%20%20%20%20node.aabb.lowerBound.x%20%3D%20aabb.lowerBound.x%20-%20extendX%3B%0A%20%20%20%20%20%20node.aabb.lowerBound.y%20%3D%20aabb.lowerBound.y%20-%20extendY%3B%0A%20%20%20%20%20%20node.aabb.upperBound.x%20%3D%20aabb.upperBound.x%20%2B%20extendX%3B%0A%20%20%20%20%20%20node.aabb.upperBound.y%20%3D%20aabb.upperBound.y%20%2B%20extendY%3B%0A%20%20%20%20%20%20node.userData%20%3D%20userData%3B%0A%20%20%20%20%20%20this.InsertLeaf(node)%3B%0A%20%20%20%20%20%20return%20node%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.DestroyProxy%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20this.RemoveLeaf(proxy)%3B%0A%20%20%20%20%20%20this.FreeNode(proxy)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.MoveProxy%20%3D%20function%20(proxy%2C%20aabb%2C%20displacement)%20%7B%0A%20%20%20%20%20%20b2Settings.b2Assert(proxy.IsLeaf())%3B%0A%20%20%20%20%20%20if%20(proxy.aabb.Contains(aabb))%20%7B%0A%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.RemoveLeaf(proxy)%3B%0A%20%20%20%20%20%20var%20extendX%20%3D%0A%20%20%20%20%20%20%20%20b2Settings.b2_aabbExtension%20%2B%0A%20%20%20%20%20%20%20%20b2Settings.b2_aabbMultiplier%20*%0A%20%20%20%20%20%20%20%20%20%20(displacement.x%20%3E%200%20%3F%20displacement.x%20%3A%20-displacement.x)%3B%0A%20%20%20%20%20%20var%20extendY%20%3D%0A%20%20%20%20%20%20%20%20b2Settings.b2_aabbExtension%20%2B%0A%20%20%20%20%20%20%20%20b2Settings.b2_aabbMultiplier%20*%0A%20%20%20%20%20%20%20%20%20%20(displacement.y%20%3E%200%20%3F%20displacement.y%20%3A%20-displacement.y)%3B%0A%20%20%20%20%20%20proxy.aabb.lowerBound.x%20%3D%20aabb.lowerBound.x%20-%20extendX%3B%0A%20%20%20%20%20%20proxy.aabb.lowerBound.y%20%3D%20aabb.lowerBound.y%20-%20extendY%3B%0A%20%20%20%20%20%20proxy.aabb.upperBound.x%20%3D%20aabb.upperBound.x%20%2B%20extendX%3B%0A%20%20%20%20%20%20proxy.aabb.upperBound.y%20%3D%20aabb.upperBound.y%20%2B%20extendY%3B%0A%20%20%20%20%20%20this.InsertLeaf(proxy)%3B%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.Rebalance%20%3D%20function%20(iterations)%20%7B%0A%20%20%20%20%20%20if%20(iterations%20%3D%3D%3D%20undefined)%20iterations%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_root%20%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20iterations%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20var%20node%20%3D%20this.m_root%3B%0A%20%20%20%20%20%20%20%20var%20bit%20%3D%200%3B%0A%20%20%20%20%20%20%20%20while%20(node.IsLeaf()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20node%20%3D%20(this.m_path%20%3E%3E%20bit)%20%26%201%20%3F%20node.child2%20%3A%20node.child1%3B%0A%20%20%20%20%20%20%20%20%20%20bit%20%3D%20(bit%20%2B%201)%20%26%2031%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%2B%2Bthis.m_path%3B%0A%20%20%20%20%20%20%20%20this.RemoveLeaf(node)%3B%0A%20%20%20%20%20%20%20%20this.InsertLeaf(node)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.GetFatAABB%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20return%20proxy.aabb%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.GetUserData%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20return%20proxy.userData%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.Query%20%3D%20function%20(callback%2C%20aabb)%20%7B%0A%20%20%20%20%20%20if%20(this.m_root%20%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20var%20stack%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20var%20count%20%3D%200%3B%0A%20%20%20%20%20%20stack%5Bcount%2B%2B%5D%20%3D%20this.m_root%3B%0A%20%20%20%20%20%20while%20(count%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20var%20node%20%3D%20stack%5B--count%5D%3B%0A%20%20%20%20%20%20%20%20if%20(node.aabb.TestOverlap(aabb))%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(node.IsLeaf())%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20proceed%20%3D%20callback(node)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(!proceed)%20return%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20stack%5Bcount%2B%2B%5D%20%3D%20node.child1%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20stack%5Bcount%2B%2B%5D%20%3D%20node.child2%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.RayCast%20%3D%20function%20(callback%2C%20input)%20%7B%0A%20%20%20%20%20%20if%20(this.m_root%20%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20var%20p1%20%3D%20input.p1%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20input.p2%3B%0A%20%20%20%20%20%20var%20r%20%3D%20b2Math.SubtractVV(p1%2C%20p2)%3B%0A%20%20%20%20%20%20r.Normalize()%3B%0A%20%20%20%20%20%20var%20v%20%3D%20b2Math.CrossFV(1.0%2C%20r)%3B%0A%20%20%20%20%20%20var%20abs_v%20%3D%20b2Math.AbsV(v)%3B%0A%20%20%20%20%20%20var%20maxFraction%20%3D%20input.maxFraction%3B%0A%20%20%20%20%20%20var%20segmentAABB%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20tX%20%3D%20p1.x%20%2B%20maxFraction%20*%20(p2.x%20-%20p1.x)%3B%0A%20%20%20%20%20%20%20%20tY%20%3D%20p1.y%20%2B%20maxFraction%20*%20(p2.y%20-%20p1.y)%3B%0A%20%20%20%20%20%20%20%20segmentAABB.lowerBound.x%20%3D%20Math.min(p1.x%2C%20tX)%3B%0A%20%20%20%20%20%20%20%20segmentAABB.lowerBound.y%20%3D%20Math.min(p1.y%2C%20tY)%3B%0A%20%20%20%20%20%20%20%20segmentAABB.upperBound.x%20%3D%20Math.max(p1.x%2C%20tX)%3B%0A%20%20%20%20%20%20%20%20segmentAABB.upperBound.y%20%3D%20Math.max(p1.y%2C%20tY)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20stack%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20var%20count%20%3D%200%3B%0A%20%20%20%20%20%20stack%5Bcount%2B%2B%5D%20%3D%20this.m_root%3B%0A%20%20%20%20%20%20while%20(count%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20var%20node%20%3D%20stack%5B--count%5D%3B%0A%20%20%20%20%20%20%20%20if%20(node.aabb.TestOverlap(segmentAABB)%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20node.aabb.GetCenter()%3B%0A%20%20%20%20%20%20%20%20var%20h%20%3D%20node.aabb.GetExtents()%3B%0A%20%20%20%20%20%20%20%20var%20separation%20%3D%0A%20%20%20%20%20%20%20%20%20%20Math.abs(v.x%20*%20(p1.x%20-%20c.x)%20%2B%20v.y%20*%20(p1.y%20-%20c.y))%20-%0A%20%20%20%20%20%20%20%20%20%20abs_v.x%20*%20h.x%20-%0A%20%20%20%20%20%20%20%20%20%20abs_v.y%20*%20h.y%3B%0A%20%20%20%20%20%20%20%20if%20(separation%20%3E%200.0)%20continue%3B%0A%20%20%20%20%20%20%20%20if%20(node.IsLeaf())%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20subInput%20%3D%20new%20b2RayCastInput()%3B%0A%20%20%20%20%20%20%20%20%20%20subInput.p1%20%3D%20input.p1%3B%0A%20%20%20%20%20%20%20%20%20%20subInput.p2%20%3D%20input.p2%3B%0A%20%20%20%20%20%20%20%20%20%20subInput.maxFraction%20%3D%20input.maxFraction%3B%0A%20%20%20%20%20%20%20%20%20%20maxFraction%20%3D%20callback(subInput%2C%20node)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(maxFraction%20%3D%3D%200.0)%20return%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(maxFraction%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tX%20%3D%20p1.x%20%2B%20maxFraction%20*%20(p2.x%20-%20p1.x)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tY%20%3D%20p1.y%20%2B%20maxFraction%20*%20(p2.y%20-%20p1.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20segmentAABB.lowerBound.x%20%3D%20Math.min(p1.x%2C%20tX)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20segmentAABB.lowerBound.y%20%3D%20Math.min(p1.y%2C%20tY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20segmentAABB.upperBound.x%20%3D%20Math.max(p1.x%2C%20tX)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20segmentAABB.upperBound.y%20%3D%20Math.max(p1.y%2C%20tY)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20stack%5Bcount%2B%2B%5D%20%3D%20node.child1%3B%0A%20%20%20%20%20%20%20%20%20%20stack%5Bcount%2B%2B%5D%20%3D%20node.child2%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.AllocateNode%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20if%20(this.m_freeList)%20%7B%0A%20%20%20%20%20%20%20%20var%20node%20%3D%20this.m_freeList%3B%0A%20%20%20%20%20%20%20%20this.m_freeList%20%3D%20node.parent%3B%0A%20%20%20%20%20%20%20%20node.parent%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20node.child1%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20node.child2%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20return%20node%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20new%20b2DynamicTreeNode()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.FreeNode%20%3D%20function%20(node)%20%7B%0A%20%20%20%20%20%20node.parent%20%3D%20this.m_freeList%3B%0A%20%20%20%20%20%20this.m_freeList%20%3D%20node%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.InsertLeaf%20%3D%20function%20(leaf)%20%7B%0A%20%20%20%20%20%20%2B%2Bthis.m_insertionCount%3B%0A%20%20%20%20%20%20if%20(this.m_root%20%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20this.m_root%20%3D%20leaf%3B%0A%20%20%20%20%20%20%20%20this.m_root.parent%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20center%20%3D%20leaf.aabb.GetCenter()%3B%0A%20%20%20%20%20%20var%20sibling%20%3D%20this.m_root%3B%0A%20%20%20%20%20%20if%20(sibling.IsLeaf()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20do%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20child1%20%3D%20sibling.child1%3B%0A%20%20%20%20%20%20%20%20%20%20var%20child2%20%3D%20sibling.child2%3B%0A%20%20%20%20%20%20%20%20%20%20var%20norm1%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20Math.abs(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(child1.aabb.lowerBound.x%20%2B%20child1.aabb.upperBound.x)%20%2F%202%20-%20center.x%0A%20%20%20%20%20%20%20%20%20%20%20%20)%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20Math.abs(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(child1.aabb.lowerBound.y%20%2B%20child1.aabb.upperBound.y)%20%2F%202%20-%20center.y%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20norm2%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20Math.abs(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(child2.aabb.lowerBound.x%20%2B%20child2.aabb.upperBound.x)%20%2F%202%20-%20center.x%0A%20%20%20%20%20%20%20%20%20%20%20%20)%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20Math.abs(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(child2.aabb.lowerBound.y%20%2B%20child2.aabb.upperBound.y)%20%2F%202%20-%20center.y%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(norm1%20%3C%20norm2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20sibling%20%3D%20child1%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20sibling%20%3D%20child2%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20while%20(sibling.IsLeaf()%20%3D%3D%20false)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20node1%20%3D%20sibling.parent%3B%0A%20%20%20%20%20%20var%20node2%20%3D%20this.AllocateNode()%3B%0A%20%20%20%20%20%20node2.parent%20%3D%20node1%3B%0A%20%20%20%20%20%20node2.userData%20%3D%20null%3B%0A%20%20%20%20%20%20node2.aabb.Combine(leaf.aabb%2C%20sibling.aabb)%3B%0A%20%20%20%20%20%20if%20(node1)%20%7B%0A%20%20%20%20%20%20%20%20if%20(sibling.parent.child1%20%3D%3D%20sibling)%20%7B%0A%20%20%20%20%20%20%20%20%20%20node1.child1%20%3D%20node2%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20node1.child2%20%3D%20node2%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20node2.child1%20%3D%20sibling%3B%0A%20%20%20%20%20%20%20%20node2.child2%20%3D%20leaf%3B%0A%20%20%20%20%20%20%20%20sibling.parent%20%3D%20node2%3B%0A%20%20%20%20%20%20%20%20leaf.parent%20%3D%20node2%3B%0A%20%20%20%20%20%20%20%20do%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(node1.aabb.Contains(node2.aabb))%20break%3B%0A%20%20%20%20%20%20%20%20%20%20node1.aabb.Combine(node1.child1.aabb%2C%20node1.child2.aabb)%3B%0A%20%20%20%20%20%20%20%20%20%20node2%20%3D%20node1%3B%0A%20%20%20%20%20%20%20%20%20%20node1%20%3D%20node1.parent%3B%0A%20%20%20%20%20%20%20%20%7D%20while%20(node1)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20node2.child1%20%3D%20sibling%3B%0A%20%20%20%20%20%20%20%20node2.child2%20%3D%20leaf%3B%0A%20%20%20%20%20%20%20%20sibling.parent%20%3D%20node2%3B%0A%20%20%20%20%20%20%20%20leaf.parent%20%3D%20node2%3B%0A%20%20%20%20%20%20%20%20this.m_root%20%3D%20node2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTree.prototype.RemoveLeaf%20%3D%20function%20(leaf)%20%7B%0A%20%20%20%20%20%20if%20(leaf%20%3D%3D%20this.m_root)%20%7B%0A%20%20%20%20%20%20%20%20this.m_root%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20node2%20%3D%20leaf.parent%3B%0A%20%20%20%20%20%20var%20node1%20%3D%20node2.parent%3B%0A%20%20%20%20%20%20var%20sibling%3B%0A%20%20%20%20%20%20if%20(node2.child1%20%3D%3D%20leaf)%20%7B%0A%20%20%20%20%20%20%20%20sibling%20%3D%20node2.child2%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20sibling%20%3D%20node2.child1%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(node1)%20%7B%0A%20%20%20%20%20%20%20%20if%20(node1.child1%20%3D%3D%20node2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20node1.child1%20%3D%20sibling%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20node1.child2%20%3D%20sibling%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20sibling.parent%20%3D%20node1%3B%0A%20%20%20%20%20%20%20%20this.FreeNode(node2)%3B%0A%20%20%20%20%20%20%20%20while%20(node1)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20oldAABB%20%3D%20node1.aabb%3B%0A%20%20%20%20%20%20%20%20%20%20node1.aabb%20%3D%20b2AABB.Combine(node1.child1.aabb%2C%20node1.child2.aabb)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(oldAABB.Contains(node1.aabb))%20break%3B%0A%20%20%20%20%20%20%20%20%20%20node1%20%3D%20node1.parent%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_root%20%3D%20sibling%3B%0A%20%20%20%20%20%20%20%20sibling.parent%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20this.FreeNode(node2)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.b2DynamicTreeBroadPhase%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_tree%20%3D%20new%20b2DynamicTree()%3B%0A%20%20%20%20%20%20this.m_moveBuffer%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20this.m_pairBuffer%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20this.m_pairCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.CreateProxy%20%3D%20function%20(aabb%2C%20userData)%20%7B%0A%20%20%20%20%20%20var%20proxy%20%3D%20this.m_tree.CreateProxy(aabb%2C%20userData)%3B%0A%20%20%20%20%20%20%2B%2Bthis.m_proxyCount%3B%0A%20%20%20%20%20%20this.BufferMove(proxy)%3B%0A%20%20%20%20%20%20return%20proxy%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.DestroyProxy%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20this.UnBufferMove(proxy)%3B%0A%20%20%20%20%20%20--this.m_proxyCount%3B%0A%20%20%20%20%20%20this.m_tree.DestroyProxy(proxy)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.MoveProxy%20%3D%20function%20(%0A%20%20%20%20%20%20proxy%2C%0A%20%20%20%20%20%20aabb%2C%0A%20%20%20%20%20%20displacement%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20var%20buffer%20%3D%20this.m_tree.MoveProxy(proxy%2C%20aabb%2C%20displacement)%3B%0A%20%20%20%20%20%20if%20(buffer)%20%7B%0A%20%20%20%20%20%20%20%20this.BufferMove(proxy)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.TestOverlap%20%3D%20function%20(proxyA%2C%20proxyB)%20%7B%0A%20%20%20%20%20%20var%20aabbA%20%3D%20this.m_tree.GetFatAABB(proxyA)%3B%0A%20%20%20%20%20%20var%20aabbB%20%3D%20this.m_tree.GetFatAABB(proxyB)%3B%0A%20%20%20%20%20%20return%20aabbA.TestOverlap(aabbB)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.GetUserData%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20return%20this.m_tree.GetUserData(proxy)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.GetFatAABB%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20return%20this.m_tree.GetFatAABB(proxy)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.GetProxyCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_proxyCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.UpdatePairs%20%3D%20function%20(callback)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20__this.m_pairCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%2C%0A%20%20%20%20%20%20%20%20queryProxy%3B%0A%20%20%20%20%20%20function%20QueryCallback(proxy)%20%7B%0A%20%20%20%20%20%20%20%20if%20(proxy%20%3D%3D%20queryProxy)%20return%20true%3B%0A%20%20%20%20%20%20%20%20if%20(__this.m_pairCount%20%3D%3D%20__this.m_pairBuffer.length)%20%7B%0A%20%20%20%20%20%20%20%20%20%20__this.m_pairBuffer%5B__this.m_pairCount%5D%20%3D%20new%20b2DynamicTreePair()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20pair%20%3D%20__this.m_pairBuffer%5B__this.m_pairCount%5D%3B%0A%20%20%20%20%20%20%20%20pair.proxyA%20%3D%20proxy%20%3C%20queryProxy%20%3F%20proxy%20%3A%20queryProxy%3B%0A%20%20%20%20%20%20%20%20pair.proxyB%20%3D%20proxy%20%3E%3D%20queryProxy%20%3F%20proxy%20%3A%20queryProxy%3B%0A%20%20%20%20%20%20%20%20%2B%2B__this.m_pairCount%3B%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20__this.m_moveBuffer.length%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20queryProxy%20%3D%20__this.m_moveBuffer%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20fatAABB%20%3D%20__this.m_tree.GetFatAABB(queryProxy)%3B%0A%20%20%20%20%20%20%20%20__this.m_tree.Query(QueryCallback%2C%20fatAABB)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20__this.m_moveBuffer.length%20%3D%200%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20__this.m_pairCount%3B%20)%20%7B%0A%20%20%20%20%20%20%20%20var%20primaryPair%20%3D%20__this.m_pairBuffer%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20userDataA%20%3D%20__this.m_tree.GetUserData(primaryPair.proxyA)%3B%0A%20%20%20%20%20%20%20%20var%20userDataB%20%3D%20__this.m_tree.GetUserData(primaryPair.proxyB)%3B%0A%20%20%20%20%20%20%20%20callback(userDataA%2C%20userDataB)%3B%0A%20%20%20%20%20%20%20%20%2B%2Bi%3B%0A%20%20%20%20%20%20%20%20while%20(i%20%3C%20__this.m_pairCount)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20pair%20%3D%20__this.m_pairBuffer%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20pair.proxyA%20!%3D%20primaryPair.proxyA%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20pair.proxyB%20!%3D%20primaryPair.proxyB%0A%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2B%2Bi%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.Query%20%3D%20function%20(callback%2C%20aabb)%20%7B%0A%20%20%20%20%20%20this.m_tree.Query(callback%2C%20aabb)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.RayCast%20%3D%20function%20(callback%2C%20input)%20%7B%0A%20%20%20%20%20%20this.m_tree.RayCast(callback%2C%20input)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.Validate%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.Rebalance%20%3D%20function%20(iterations)%20%7B%0A%20%20%20%20%20%20if%20(iterations%20%3D%3D%3D%20undefined)%20iterations%20%3D%200%3B%0A%20%20%20%20%20%20this.m_tree.Rebalance(iterations)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.BufferMove%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20this.m_moveBuffer%5Bthis.m_moveBuffer.length%5D%20%3D%20proxy%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.UnBufferMove%20%3D%20function%20(proxy)%20%7B%0A%20%20%20%20%20%20var%20i%20%3D%20parseInt(this.m_moveBuffer.indexOf(proxy))%3B%0A%20%20%20%20%20%20this.m_moveBuffer.splice(i%2C%201)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.prototype.ComparePairs%20%3D%20function%20(pair1%2C%20pair2)%20%7B%0A%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.__implements%20%3D%20%7B%7D%3B%0A%20%20%20%20b2DynamicTreeBroadPhase.__implements%5BIBroadPhase%5D%20%3D%20true%3B%0A%20%20%20%20b2DynamicTreeNode.b2DynamicTreeNode%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.aabb%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreeNode.prototype.IsLeaf%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.child1%20%3D%3D%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DynamicTreePair.b2DynamicTreePair%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Manifold.b2Manifold%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_pointCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Manifold.prototype.b2Manifold%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_points%20%3D%20new%20Vector(b2Settings.b2_maxManifoldPoints)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.m_points%5Bi%5D%20%3D%20new%20b2ManifoldPoint()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_localPlaneNormal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localPoint%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Manifold.prototype.Reset%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20(this.m_points%5Bi%5D%20instanceof%20b2ManifoldPoint%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_points%5Bi%5D%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%0A%20%20%20%20%20%20%20%20).Reset()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_localPlaneNormal.SetZero()%3B%0A%20%20%20%20%20%20this.m_localPoint.SetZero()%3B%0A%20%20%20%20%20%20this.m_type%20%3D%200%3B%0A%20%20%20%20%20%20this.m_pointCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Manifold.prototype.Set%20%3D%20function%20(m)%20%7B%0A%20%20%20%20%20%20this.m_pointCount%20%3D%20m.m_pointCount%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20(this.m_points%5Bi%5D%20instanceof%20b2ManifoldPoint%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_points%5Bi%5D%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%0A%20%20%20%20%20%20%20%20).Set(m.m_points%5Bi%5D)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_localPlaneNormal.SetV(m.m_localPlaneNormal)%3B%0A%20%20%20%20%20%20this.m_localPoint.SetV(m.m_localPoint)%3B%0A%20%20%20%20%20%20this.m_type%20%3D%20m.m_type%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Manifold.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20copy%20%3D%20new%20b2Manifold()%3B%0A%20%20%20%20%20%20copy.Set(this)%3B%0A%20%20%20%20%20%20return%20copy%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.b2Manifold.e_circles%20%3D%200x0001%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Manifold.e_faceA%20%3D%200x0002%3B%0A%20%20%20%20%20%20Box2D.Collision.b2Manifold.e_faceB%20%3D%200x0004%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2ManifoldPoint.b2ManifoldPoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_localPoint%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_id%20%3D%20new%20b2ContactID()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ManifoldPoint.prototype.b2ManifoldPoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.Reset()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ManifoldPoint.prototype.Reset%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_localPoint.SetZero()%3B%0A%20%20%20%20%20%20this.m_normalImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_tangentImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_id.key%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ManifoldPoint.prototype.Set%20%3D%20function%20(m)%20%7B%0A%20%20%20%20%20%20this.m_localPoint.SetV(m.m_localPoint)%3B%0A%20%20%20%20%20%20this.m_normalImpulse%20%3D%20m.m_normalImpulse%3B%0A%20%20%20%20%20%20this.m_tangentImpulse%20%3D%20m.m_tangentImpulse%3B%0A%20%20%20%20%20%20this.m_id.Set(m.m_id)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Point.b2Point%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.p%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Point.prototype.Support%20%3D%20function%20(xf%2C%20vX%2C%20vY)%20%7B%0A%20%20%20%20%20%20if%20(vX%20%3D%3D%3D%20undefined)%20vX%20%3D%200%3B%0A%20%20%20%20%20%20if%20(vY%20%3D%3D%3D%20undefined)%20vY%20%3D%200%3B%0A%20%20%20%20%20%20return%20this.p%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Point.prototype.GetFirstVertex%20%3D%20function%20(xf)%20%7B%0A%20%20%20%20%20%20return%20this.p%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RayCastInput.b2RayCastInput%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.p1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.p2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RayCastInput.prototype.b2RayCastInput%20%3D%20function%20(p1%2C%20p2%2C%20maxFraction)%20%7B%0A%20%20%20%20%20%20if%20(p1%20%3D%3D%3D%20undefined)%20p1%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(p2%20%3D%3D%3D%20undefined)%20p2%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(maxFraction%20%3D%3D%3D%20undefined)%20maxFraction%20%3D%201%3B%0A%20%20%20%20%20%20if%20(p1)%20this.p1.SetV(p1)%3B%0A%20%20%20%20%20%20if%20(p2)%20this.p2.SetV(p2)%3B%0A%20%20%20%20%20%20this.maxFraction%20%3D%20maxFraction%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RayCastOutput.b2RayCastOutput%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Segment.b2Segment%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.p1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.p2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Segment.prototype.TestSegment%20%3D%20function%20(%0A%20%20%20%20%20%20lambda%2C%0A%20%20%20%20%20%20normal%2C%0A%20%20%20%20%20%20segment%2C%0A%20%20%20%20%20%20maxLambda%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(maxLambda%20%3D%3D%3D%20undefined)%20maxLambda%20%3D%200%3B%0A%20%20%20%20%20%20var%20s%20%3D%20segment.p1%3B%0A%20%20%20%20%20%20var%20rX%20%3D%20segment.p2.x%20-%20s.x%3B%0A%20%20%20%20%20%20var%20rY%20%3D%20segment.p2.y%20-%20s.y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20this.p2.x%20-%20this.p1.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20this.p2.y%20-%20this.p1.y%3B%0A%20%20%20%20%20%20var%20nX%20%3D%20dY%3B%0A%20%20%20%20%20%20var%20nY%20%3D%20-dX%3B%0A%20%20%20%20%20%20var%20k_slop%20%3D%20100.0%20*%20Number.MIN_VALUE%3B%0A%20%20%20%20%20%20var%20denom%20%3D%20-(rX%20*%20nX%20%2B%20rY%20*%20nY)%3B%0A%20%20%20%20%20%20if%20(denom%20%3E%20k_slop)%20%7B%0A%20%20%20%20%20%20%20%20var%20bX%20%3D%20s.x%20-%20this.p1.x%3B%0A%20%20%20%20%20%20%20%20var%20bY%20%3D%20s.y%20-%20this.p1.y%3B%0A%20%20%20%20%20%20%20%20var%20a%20%3D%20bX%20*%20nX%20%2B%20bY%20*%20nY%3B%0A%20%20%20%20%20%20%20%20if%20(0.0%20%3C%3D%20a%20%26%26%20a%20%3C%3D%20maxLambda%20*%20denom)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20mu2%20%3D%20-rX%20*%20bY%20%2B%20rY%20*%20bX%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(-k_slop%20*%20denom%20%3C%3D%20mu2%20%26%26%20mu2%20%3C%3D%20denom%20*%20(1.0%20%2B%20k_slop))%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20a%20%2F%3D%20denom%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20nLen%20%3D%20Math.sqrt(nX%20*%20nX%20%2B%20nY%20*%20nY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20nX%20%2F%3D%20nLen%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20nY%20%2F%3D%20nLen%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20lambda%5B0%5D%20%3D%20a%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normal.Set(nX%2C%20nY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Segment.prototype.Extend%20%3D%20function%20(aabb)%20%7B%0A%20%20%20%20%20%20this.ExtendForward(aabb)%3B%0A%20%20%20%20%20%20this.ExtendBackward(aabb)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Segment.prototype.ExtendForward%20%3D%20function%20(aabb)%20%7B%0A%20%20%20%20%20%20var%20dX%20%3D%20this.p2.x%20-%20this.p1.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20this.p2.y%20-%20this.p1.y%3B%0A%20%20%20%20%20%20var%20lambda%20%3D%20Math.min(%0A%20%20%20%20%20%20%20%20dX%20%3E%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.upperBound.x%20-%20this.p1.x)%20%2F%20dX%0A%20%20%20%20%20%20%20%20%20%20%3A%20dX%20%3C%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.lowerBound.x%20-%20this.p1.x)%20%2F%20dX%0A%20%20%20%20%20%20%20%20%20%20%3A%20Number.POSITIVE_INFINITY%2C%0A%20%20%20%20%20%20%20%20dY%20%3E%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.upperBound.y%20-%20this.p1.y)%20%2F%20dY%0A%20%20%20%20%20%20%20%20%20%20%3A%20dY%20%3C%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.lowerBound.y%20-%20this.p1.y)%20%2F%20dY%0A%20%20%20%20%20%20%20%20%20%20%3A%20Number.POSITIVE_INFINITY%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.p2.x%20%3D%20this.p1.x%20%2B%20dX%20*%20lambda%3B%0A%20%20%20%20%20%20this.p2.y%20%3D%20this.p1.y%20%2B%20dY%20*%20lambda%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Segment.prototype.ExtendBackward%20%3D%20function%20(aabb)%20%7B%0A%20%20%20%20%20%20var%20dX%20%3D%20-this.p2.x%20%2B%20this.p1.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20-this.p2.y%20%2B%20this.p1.y%3B%0A%20%20%20%20%20%20var%20lambda%20%3D%20Math.min(%0A%20%20%20%20%20%20%20%20dX%20%3E%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.upperBound.x%20-%20this.p2.x)%20%2F%20dX%0A%20%20%20%20%20%20%20%20%20%20%3A%20dX%20%3C%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.lowerBound.x%20-%20this.p2.x)%20%2F%20dX%0A%20%20%20%20%20%20%20%20%20%20%3A%20Number.POSITIVE_INFINITY%2C%0A%20%20%20%20%20%20%20%20dY%20%3E%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.upperBound.y%20-%20this.p2.y)%20%2F%20dY%0A%20%20%20%20%20%20%20%20%20%20%3A%20dY%20%3C%200%0A%20%20%20%20%20%20%20%20%20%20%3F%20(aabb.lowerBound.y%20-%20this.p2.y)%20%2F%20dY%0A%20%20%20%20%20%20%20%20%20%20%3A%20Number.POSITIVE_INFINITY%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.p1.x%20%3D%20this.p2.x%20%2B%20dX%20*%20lambda%3B%0A%20%20%20%20%20%20this.p1.y%20%3D%20this.p2.y%20%2B%20dY%20*%20lambda%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2SeparationFunction.b2SeparationFunction%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_localPoint%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_axis%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2SeparationFunction.prototype.Initialize%20%3D%20function%20(%0A%20%20%20%20%20%20cache%2C%0A%20%20%20%20%20%20proxyA%2C%0A%20%20%20%20%20%20transformA%2C%0A%20%20%20%20%20%20proxyB%2C%0A%20%20%20%20%20%20transformB%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20this.m_proxyA%20%3D%20proxyA%3B%0A%20%20%20%20%20%20this.m_proxyB%20%3D%20proxyB%3B%0A%20%20%20%20%20%20var%20count%20%3D%20parseInt(cache.count)%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(0%20%3C%20count%20%26%26%20count%20%3C%203)%3B%0A%20%20%20%20%20%20var%20localPointA%3B%0A%20%20%20%20%20%20var%20localPointA1%3B%0A%20%20%20%20%20%20var%20localPointA2%3B%0A%20%20%20%20%20%20var%20localPointB%3B%0A%20%20%20%20%20%20var%20localPointB1%3B%0A%20%20%20%20%20%20var%20localPointB2%3B%0A%20%20%20%20%20%20var%20pointAX%20%3D%200%3B%0A%20%20%20%20%20%20var%20pointAY%20%3D%200%3B%0A%20%20%20%20%20%20var%20pointBX%20%3D%200%3B%0A%20%20%20%20%20%20var%20pointBY%20%3D%200%3B%0A%20%20%20%20%20%20var%20normalX%20%3D%200%3B%0A%20%20%20%20%20%20var%20normalY%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20s%20%3D%200%3B%0A%20%20%20%20%20%20var%20sgn%20%3D%200%3B%0A%20%20%20%20%20%20if%20(count%20%3D%3D%201)%20%7B%0A%20%20%20%20%20%20%20%20this.m_type%20%3D%20b2SeparationFunction.e_points%3B%0A%20%20%20%20%20%20%20%20localPointA%20%3D%20this.m_proxyA.GetVertex(cache.indexA%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20localPointB%20%3D%20this.m_proxyB.GetVertex(cache.indexB%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20localPointA%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformA.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformA.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20localPointB%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformB.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformB.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20this.m_axis.x%20%3D%20pointBX%20-%20pointAX%3B%0A%20%20%20%20%20%20%20%20this.m_axis.y%20%3D%20pointBY%20-%20pointAY%3B%0A%20%20%20%20%20%20%20%20this.m_axis.Normalize()%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(cache.indexB%5B0%5D%20%3D%3D%20cache.indexB%5B1%5D)%20%7B%0A%20%20%20%20%20%20%20%20this.m_type%20%3D%20b2SeparationFunction.e_faceA%3B%0A%20%20%20%20%20%20%20%20localPointA1%20%3D%20this.m_proxyA.GetVertex(cache.indexA%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20localPointA2%20%3D%20this.m_proxyA.GetVertex(cache.indexA%5B1%5D)%3B%0A%20%20%20%20%20%20%20%20localPointB%20%3D%20this.m_proxyB.GetVertex(cache.indexB%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20this.m_localPoint.x%20%3D%200.5%20*%20(localPointA1.x%20%2B%20localPointA2.x)%3B%0A%20%20%20%20%20%20%20%20this.m_localPoint.y%20%3D%200.5%20*%20(localPointA1.y%20%2B%20localPointA2.y)%3B%0A%20%20%20%20%20%20%20%20this.m_axis%20%3D%20b2Math.CrossVF(%0A%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(localPointA2%2C%20localPointA1)%2C%0A%20%20%20%20%20%20%20%20%20%201.0%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20this.m_axis.Normalize()%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_axis%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20normalX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20normalY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_localPoint%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformA.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformA.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20localPointB%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformB.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformB.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20s%20%3D%20(pointBX%20-%20pointAX)%20*%20normalX%20%2B%20(pointBY%20-%20pointAY)%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20if%20(s%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.NegativeSelf()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20if%20(cache.indexA%5B0%5D%20%3D%3D%20cache.indexA%5B0%5D)%20%7B%0A%20%20%20%20%20%20%20%20this.m_type%20%3D%20b2SeparationFunction.e_faceB%3B%0A%20%20%20%20%20%20%20%20localPointB1%20%3D%20this.m_proxyB.GetVertex(cache.indexB%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20localPointB2%20%3D%20this.m_proxyB.GetVertex(cache.indexB%5B1%5D)%3B%0A%20%20%20%20%20%20%20%20localPointA%20%3D%20this.m_proxyA.GetVertex(cache.indexA%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20this.m_localPoint.x%20%3D%200.5%20*%20(localPointB1.x%20%2B%20localPointB2.x)%3B%0A%20%20%20%20%20%20%20%20this.m_localPoint.y%20%3D%200.5%20*%20(localPointB1.y%20%2B%20localPointB2.y)%3B%0A%20%20%20%20%20%20%20%20this.m_axis%20%3D%20b2Math.CrossVF(%0A%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(localPointB2%2C%20localPointB1)%2C%0A%20%20%20%20%20%20%20%20%20%201.0%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20this.m_axis.Normalize()%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_axis%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20normalX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20normalY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_localPoint%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformB.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformB.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20localPointA%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformA.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20transformA.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20s%20%3D%20(pointAX%20-%20pointBX)%20*%20normalX%20%2B%20(pointAY%20-%20pointBY)%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20if%20(s%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.NegativeSelf()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20localPointA1%20%3D%20this.m_proxyA.GetVertex(cache.indexA%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20localPointA2%20%3D%20this.m_proxyA.GetVertex(cache.indexA%5B1%5D)%3B%0A%20%20%20%20%20%20%20%20localPointB1%20%3D%20this.m_proxyB.GetVertex(cache.indexB%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20localPointB2%20%3D%20this.m_proxyB.GetVertex(cache.indexB%5B1%5D)%3B%0A%20%20%20%20%20%20%20%20var%20pA%20%3D%20b2Math.MulX(transformA%2C%20localPointA)%3B%0A%20%20%20%20%20%20%20%20var%20dA%20%3D%20b2Math.MulMV(%0A%20%20%20%20%20%20%20%20%20%20transformA.R%2C%0A%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(localPointA2%2C%20localPointA1)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20pB%20%3D%20b2Math.MulX(transformB%2C%20localPointB)%3B%0A%20%20%20%20%20%20%20%20var%20dB%20%3D%20b2Math.MulMV(%0A%20%20%20%20%20%20%20%20%20%20transformB.R%2C%0A%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(localPointB2%2C%20localPointB1)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20a%20%3D%20dA.x%20*%20dA.x%20%2B%20dA.y%20*%20dA.y%3B%0A%20%20%20%20%20%20%20%20var%20e%20%3D%20dB.x%20*%20dB.x%20%2B%20dB.y%20*%20dB.y%3B%0A%20%20%20%20%20%20%20%20var%20r%20%3D%20b2Math.SubtractVV(dB%2C%20dA)%3B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20dA.x%20*%20r.x%20%2B%20dA.y%20*%20r.y%3B%0A%20%20%20%20%20%20%20%20var%20f%20%3D%20dB.x%20*%20r.x%20%2B%20dB.y%20*%20r.y%3B%0A%20%20%20%20%20%20%20%20var%20b%20%3D%20dA.x%20*%20dB.x%20%2B%20dA.y%20*%20dB.y%3B%0A%20%20%20%20%20%20%20%20var%20denom%20%3D%20a%20*%20e%20-%20b%20*%20b%3B%0A%20%20%20%20%20%20%20%20s%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20if%20(denom%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20s%20%3D%20b2Math.Clamp((b%20*%20f%20-%20c%20*%20e)%20%2F%20denom%2C%200.0%2C%201.0)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20t%20%3D%20(b%20*%20s%20%2B%20f)%20%2F%20e%3B%0A%20%20%20%20%20%20%20%20if%20(t%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20t%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20s%20%3D%20b2Math.Clamp((b%20-%20c)%20%2F%20a%2C%200.0%2C%201.0)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20localPointA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20localPointA.x%20%3D%20localPointA1.x%20%2B%20s%20*%20(localPointA2.x%20-%20localPointA1.x)%3B%0A%20%20%20%20%20%20%20%20localPointA.y%20%3D%20localPointA1.y%20%2B%20s%20*%20(localPointA2.y%20-%20localPointA1.y)%3B%0A%20%20%20%20%20%20%20%20localPointB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20localPointB.x%20%3D%20localPointB1.x%20%2B%20s%20*%20(localPointB2.x%20-%20localPointB1.x)%3B%0A%20%20%20%20%20%20%20%20localPointB.y%20%3D%20localPointB1.y%20%2B%20s%20*%20(localPointB2.y%20-%20localPointB1.y)%3B%0A%20%20%20%20%20%20%20%20if%20(s%20%3D%3D%200.0%20%7C%7C%20s%20%3D%3D%201.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_type%20%3D%20b2SeparationFunction.e_faceB%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis%20%3D%20b2Math.CrossVF(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(localPointB2%2C%20localPointB1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%201.0%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.Normalize()%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_localPoint%20%3D%20localPointB%3B%0A%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_axis%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20%20%20normalX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20normalY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20%20%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformB.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformB.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20localPointA%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20%20%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformA.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformA.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20sgn%20%3D%20(pointAX%20-%20pointBX)%20*%20normalX%20%2B%20(pointAY%20-%20pointBY)%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(s%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_axis.NegativeSelf()%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_type%20%3D%20b2SeparationFunction.e_faceA%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis%20%3D%20b2Math.CrossVF(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(localPointA2%2C%20localPointA1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%201.0%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_localPoint%20%3D%20localPointA%3B%0A%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_axis%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20%20%20normalX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20normalY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20transformA.R%3B%0A%20%20%20%20%20%20%20%20%20%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformA.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformA.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20localPointB%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20transformB.R%3B%0A%20%20%20%20%20%20%20%20%20%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformB.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20transformB.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20sgn%20%3D%20(pointBX%20-%20pointAX)%20*%20normalX%20%2B%20(pointBY%20-%20pointAY)%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(s%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_axis.NegativeSelf()%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2SeparationFunction.prototype.Evaluate%20%3D%20function%20(transformA%2C%20transformB)%20%7B%0A%20%20%20%20%20%20var%20axisA%3B%0A%20%20%20%20%20%20var%20axisB%3B%0A%20%20%20%20%20%20var%20localPointA%3B%0A%20%20%20%20%20%20var%20localPointB%3B%0A%20%20%20%20%20%20var%20pointA%3B%0A%20%20%20%20%20%20var%20pointB%3B%0A%20%20%20%20%20%20var%20seperation%20%3D%200%3B%0A%20%20%20%20%20%20var%20normal%3B%0A%20%20%20%20%20%20switch%20(this.m_type)%20%7B%0A%20%20%20%20%20%20%20%20case%20b2SeparationFunction.e_points%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20axisA%20%3D%20b2Math.MulTMV(transformA.R%2C%20this.m_axis)%3B%0A%20%20%20%20%20%20%20%20%20%20axisB%20%3D%20b2Math.MulTMV(transformB.R%2C%20this.m_axis.GetNegative())%3B%0A%20%20%20%20%20%20%20%20%20%20localPointA%20%3D%20this.m_proxyA.GetSupportVertex(axisA)%3B%0A%20%20%20%20%20%20%20%20%20%20localPointB%20%3D%20this.m_proxyB.GetSupportVertex(axisB)%3B%0A%20%20%20%20%20%20%20%20%20%20pointA%20%3D%20b2Math.MulX(transformA%2C%20localPointA)%3B%0A%20%20%20%20%20%20%20%20%20%20pointB%20%3D%20b2Math.MulX(transformB%2C%20localPointB)%3B%0A%20%20%20%20%20%20%20%20%20%20seperation%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20(pointB.x%20-%20pointA.x)%20*%20this.m_axis.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(pointB.y%20-%20pointA.y)%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20%20%20return%20seperation%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20case%20b2SeparationFunction.e_faceA%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20normal%20%3D%20b2Math.MulMV(transformA.R%2C%20this.m_axis)%3B%0A%20%20%20%20%20%20%20%20%20%20pointA%20%3D%20b2Math.MulX(transformA%2C%20this.m_localPoint)%3B%0A%20%20%20%20%20%20%20%20%20%20axisB%20%3D%20b2Math.MulTMV(transformB.R%2C%20normal.GetNegative())%3B%0A%20%20%20%20%20%20%20%20%20%20localPointB%20%3D%20this.m_proxyB.GetSupportVertex(axisB)%3B%0A%20%20%20%20%20%20%20%20%20%20pointB%20%3D%20b2Math.MulX(transformB%2C%20localPointB)%3B%0A%20%20%20%20%20%20%20%20%20%20seperation%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20(pointB.x%20-%20pointA.x)%20*%20normal.x%20%2B%20(pointB.y%20-%20pointA.y)%20*%20normal.y%3B%0A%20%20%20%20%20%20%20%20%20%20return%20seperation%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20case%20b2SeparationFunction.e_faceB%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20normal%20%3D%20b2Math.MulMV(transformB.R%2C%20this.m_axis)%3B%0A%20%20%20%20%20%20%20%20%20%20pointB%20%3D%20b2Math.MulX(transformB%2C%20this.m_localPoint)%3B%0A%20%20%20%20%20%20%20%20%20%20axisA%20%3D%20b2Math.MulTMV(transformA.R%2C%20normal.GetNegative())%3B%0A%20%20%20%20%20%20%20%20%20%20localPointA%20%3D%20this.m_proxyA.GetSupportVertex(axisA)%3B%0A%20%20%20%20%20%20%20%20%20%20pointA%20%3D%20b2Math.MulX(transformA%2C%20localPointA)%3B%0A%20%20%20%20%20%20%20%20%20%20seperation%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20(pointA.x%20-%20pointB.x)%20*%20normal.x%20%2B%20(pointA.y%20-%20pointB.y)%20*%20normal.y%3B%0A%20%20%20%20%20%20%20%20%20%20return%20seperation%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.b2SeparationFunction.e_points%20%3D%200x01%3B%0A%20%20%20%20%20%20Box2D.Collision.b2SeparationFunction.e_faceA%20%3D%200x02%3B%0A%20%20%20%20%20%20Box2D.Collision.b2SeparationFunction.e_faceB%20%3D%200x04%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2Simplex.b2Simplex%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_v1%20%3D%20new%20b2SimplexVertex()%3B%0A%20%20%20%20%20%20this.m_v2%20%3D%20new%20b2SimplexVertex()%3B%0A%20%20%20%20%20%20this.m_v3%20%3D%20new%20b2SimplexVertex()%3B%0A%20%20%20%20%20%20this.m_vertices%20%3D%20new%20Vector(3)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.b2Simplex%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_vertices%5B0%5D%20%3D%20this.m_v1%3B%0A%20%20%20%20%20%20this.m_vertices%5B1%5D%20%3D%20this.m_v2%3B%0A%20%20%20%20%20%20this.m_vertices%5B2%5D%20%3D%20this.m_v3%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.ReadCache%20%3D%20function%20(%0A%20%20%20%20%20%20cache%2C%0A%20%20%20%20%20%20proxyA%2C%0A%20%20%20%20%20%20transformA%2C%0A%20%20%20%20%20%20proxyB%2C%0A%20%20%20%20%20%20transformB%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20b2Settings.b2Assert(0%20%3C%3D%20cache.count%20%26%26%20cache.count%20%3C%3D%203)%3B%0A%20%20%20%20%20%20var%20wALocal%3B%0A%20%20%20%20%20%20var%20wBLocal%3B%0A%20%20%20%20%20%20this.m_count%20%3D%20cache.count%3B%0A%20%20%20%20%20%20var%20vertices%20%3D%20this.m_vertices%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_count%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20var%20v%20%3D%20vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20v.indexA%20%3D%20cache.indexA%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20v.indexB%20%3D%20cache.indexB%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20wALocal%20%3D%20proxyA.GetVertex(v.indexA)%3B%0A%20%20%20%20%20%20%20%20wBLocal%20%3D%20proxyB.GetVertex(v.indexB)%3B%0A%20%20%20%20%20%20%20%20v.wA%20%3D%20b2Math.MulX(transformA%2C%20wALocal)%3B%0A%20%20%20%20%20%20%20%20v.wB%20%3D%20b2Math.MulX(transformB%2C%20wBLocal)%3B%0A%20%20%20%20%20%20%20%20v.w%20%3D%20b2Math.SubtractVV(v.wB%2C%20v.wA)%3B%0A%20%20%20%20%20%20%20%20v.a%20%3D%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_count%20%3E%201)%20%7B%0A%20%20%20%20%20%20%20%20var%20metric1%20%3D%20cache.metric%3B%0A%20%20%20%20%20%20%20%20var%20metric2%20%3D%20this.GetMetric()%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20metric2%20%3C%200.5%20*%20metric1%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%202.0%20*%20metric1%20%3C%20metric2%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20metric2%20%3C%20Number.MIN_VALUE%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_count%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_count%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20v%20%3D%20vertices%5B0%5D%3B%0A%20%20%20%20%20%20%20%20v.indexA%20%3D%200%3B%0A%20%20%20%20%20%20%20%20v.indexB%20%3D%200%3B%0A%20%20%20%20%20%20%20%20wALocal%20%3D%20proxyA.GetVertex(0)%3B%0A%20%20%20%20%20%20%20%20wBLocal%20%3D%20proxyB.GetVertex(0)%3B%0A%20%20%20%20%20%20%20%20v.wA%20%3D%20b2Math.MulX(transformA%2C%20wALocal)%3B%0A%20%20%20%20%20%20%20%20v.wB%20%3D%20b2Math.MulX(transformB%2C%20wBLocal)%3B%0A%20%20%20%20%20%20%20%20v.w%20%3D%20b2Math.SubtractVV(v.wB%2C%20v.wA)%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.WriteCache%20%3D%20function%20(cache)%20%7B%0A%20%20%20%20%20%20cache.metric%20%3D%20this.GetMetric()%3B%0A%20%20%20%20%20%20cache.count%20%3D%20Box2D.parseUInt(this.m_count)%3B%0A%20%20%20%20%20%20var%20vertices%20%3D%20this.m_vertices%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_count%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20cache.indexA%5Bi%5D%20%3D%20Box2D.parseUInt(vertices%5Bi%5D.indexA)%3B%0A%20%20%20%20%20%20%20%20cache.indexB%5Bi%5D%20%3D%20Box2D.parseUInt(vertices%5Bi%5D.indexB)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.GetSearchDirection%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20switch%20(this.m_count)%20%7B%0A%20%20%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20%20%20return%20this.m_v1.w.GetNegative()%3B%0A%20%20%20%20%20%20%20%20case%202%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20e12%20%3D%20b2Math.SubtractVV(this.m_v2.w%2C%20this.m_v1.w)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20sgn%20%3D%20b2Math.CrossVV(e12%2C%20this.m_v1.w.GetNegative())%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(sgn%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20b2Math.CrossFV(1.0%2C%20e12)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20b2Math.CrossVF(e12%2C%201.0)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20return%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.GetClosestPoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20switch%20(this.m_count)%20%7B%0A%20%20%20%20%20%20%20%20case%200%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20return%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20%20%20return%20this.m_v1.w%3B%0A%20%20%20%20%20%20%20%20case%202%3A%0A%20%20%20%20%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v1.a%20*%20this.m_v1.w.x%20%2B%20this.m_v2.a%20*%20this.m_v2.w.x%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v1.a%20*%20this.m_v1.w.y%20%2B%20this.m_v2.a%20*%20this.m_v2.w.y%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20return%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.GetWitnessPoints%20%3D%20function%20(pA%2C%20pB)%20%7B%0A%20%20%20%20%20%20switch%20(this.m_count)%20%7B%0A%20%20%20%20%20%20%20%20case%200%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20%20%20pA.SetV(this.m_v1.wA)%3B%0A%20%20%20%20%20%20%20%20%20%20pB.SetV(this.m_v1.wB)%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%202%3A%0A%20%20%20%20%20%20%20%20%20%20pA.x%20%3D%20this.m_v1.a%20*%20this.m_v1.wA.x%20%2B%20this.m_v2.a%20*%20this.m_v2.wA.x%3B%0A%20%20%20%20%20%20%20%20%20%20pA.y%20%3D%20this.m_v1.a%20*%20this.m_v1.wA.y%20%2B%20this.m_v2.a%20*%20this.m_v2.wA.y%3B%0A%20%20%20%20%20%20%20%20%20%20pB.x%20%3D%20this.m_v1.a%20*%20this.m_v1.wB.x%20%2B%20this.m_v2.a%20*%20this.m_v2.wB.x%3B%0A%20%20%20%20%20%20%20%20%20%20pB.y%20%3D%20this.m_v1.a%20*%20this.m_v1.wB.y%20%2B%20this.m_v2.a%20*%20this.m_v2.wB.y%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%203%3A%0A%20%20%20%20%20%20%20%20%20%20pB.x%20%3D%20pA.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v1.a%20*%20this.m_v1.wA.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v2.a%20*%20this.m_v2.wA.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v3.a%20*%20this.m_v3.wA.x%3B%0A%20%20%20%20%20%20%20%20%20%20pB.y%20%3D%20pA.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v1.a%20*%20this.m_v1.wA.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v2.a%20*%20this.m_v2.wA.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_v3.a%20*%20this.m_v3.wA.y%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.GetMetric%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20switch%20(this.m_count)%20%7B%0A%20%20%20%20%20%20%20%20case%200%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%20%20%20%20case%202%3A%0A%20%20%20%20%20%20%20%20%20%20return%20b2Math.SubtractVV(this.m_v1.w%2C%20this.m_v2.w).Length()%3B%0A%20%20%20%20%20%20%20%20case%203%3A%0A%20%20%20%20%20%20%20%20%20%20return%20b2Math.CrossVV(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(this.m_v2.w%2C%20this.m_v1.w)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Math.SubtractVV(this.m_v3.w%2C%20this.m_v1.w)%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(false)%3B%0A%20%20%20%20%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.Solve2%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20w1%20%3D%20this.m_v1.w%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20this.m_v2.w%3B%0A%20%20%20%20%20%20var%20e12%20%3D%20b2Math.SubtractVV(w2%2C%20w1)%3B%0A%20%20%20%20%20%20var%20d12_2%20%3D%20-(w1.x%20*%20e12.x%20%2B%20w1.y%20*%20e12.y)%3B%0A%20%20%20%20%20%20if%20(d12_2%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_v1.a%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20d12_1%20%3D%20w2.x%20*%20e12.x%20%2B%20w2.y%20*%20e12.y%3B%0A%20%20%20%20%20%20if%20(d12_1%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_v2.a%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%20%20this.m_v1.Set(this.m_v2)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20inv_d12%20%3D%201.0%20%2F%20(d12_1%20%2B%20d12_2)%3B%0A%20%20%20%20%20%20this.m_v1.a%20%3D%20d12_1%20*%20inv_d12%3B%0A%20%20%20%20%20%20this.m_v2.a%20%3D%20d12_2%20*%20inv_d12%3B%0A%20%20%20%20%20%20this.m_count%20%3D%202%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Simplex.prototype.Solve3%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20w1%20%3D%20this.m_v1.w%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20this.m_v2.w%3B%0A%20%20%20%20%20%20var%20w3%20%3D%20this.m_v3.w%3B%0A%20%20%20%20%20%20var%20e12%20%3D%20b2Math.SubtractVV(w2%2C%20w1)%3B%0A%20%20%20%20%20%20var%20w1e12%20%3D%20b2Math.Dot(w1%2C%20e12)%3B%0A%20%20%20%20%20%20var%20w2e12%20%3D%20b2Math.Dot(w2%2C%20e12)%3B%0A%20%20%20%20%20%20var%20d12_1%20%3D%20w2e12%3B%0A%20%20%20%20%20%20var%20d12_2%20%3D%20-w1e12%3B%0A%20%20%20%20%20%20var%20e13%20%3D%20b2Math.SubtractVV(w3%2C%20w1)%3B%0A%20%20%20%20%20%20var%20w1e13%20%3D%20b2Math.Dot(w1%2C%20e13)%3B%0A%20%20%20%20%20%20var%20w3e13%20%3D%20b2Math.Dot(w3%2C%20e13)%3B%0A%20%20%20%20%20%20var%20d13_1%20%3D%20w3e13%3B%0A%20%20%20%20%20%20var%20d13_2%20%3D%20-w1e13%3B%0A%20%20%20%20%20%20var%20e23%20%3D%20b2Math.SubtractVV(w3%2C%20w2)%3B%0A%20%20%20%20%20%20var%20w2e23%20%3D%20b2Math.Dot(w2%2C%20e23)%3B%0A%20%20%20%20%20%20var%20w3e23%20%3D%20b2Math.Dot(w3%2C%20e23)%3B%0A%20%20%20%20%20%20var%20d23_1%20%3D%20w3e23%3B%0A%20%20%20%20%20%20var%20d23_2%20%3D%20-w2e23%3B%0A%20%20%20%20%20%20var%20n123%20%3D%20b2Math.CrossVV(e12%2C%20e13)%3B%0A%20%20%20%20%20%20var%20d123_1%20%3D%20n123%20*%20b2Math.CrossVV(w2%2C%20w3)%3B%0A%20%20%20%20%20%20var%20d123_2%20%3D%20n123%20*%20b2Math.CrossVV(w3%2C%20w1)%3B%0A%20%20%20%20%20%20var%20d123_3%20%3D%20n123%20*%20b2Math.CrossVV(w1%2C%20w2)%3B%0A%20%20%20%20%20%20if%20(d12_2%20%3C%3D%200.0%20%26%26%20d13_2%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_v1.a%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(d12_1%20%3E%200.0%20%26%26%20d12_2%20%3E%200.0%20%26%26%20d123_3%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20var%20inv_d12%20%3D%201.0%20%2F%20(d12_1%20%2B%20d12_2)%3B%0A%20%20%20%20%20%20%20%20this.m_v1.a%20%3D%20d12_1%20*%20inv_d12%3B%0A%20%20%20%20%20%20%20%20this.m_v2.a%20%3D%20d12_2%20*%20inv_d12%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%202%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(d13_1%20%3E%200.0%20%26%26%20d13_2%20%3E%200.0%20%26%26%20d123_2%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20var%20inv_d13%20%3D%201.0%20%2F%20(d13_1%20%2B%20d13_2)%3B%0A%20%20%20%20%20%20%20%20this.m_v1.a%20%3D%20d13_1%20*%20inv_d13%3B%0A%20%20%20%20%20%20%20%20this.m_v3.a%20%3D%20d13_2%20*%20inv_d13%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%202%3B%0A%20%20%20%20%20%20%20%20this.m_v2.Set(this.m_v3)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(d12_1%20%3C%3D%200.0%20%26%26%20d23_2%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_v2.a%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%20%20this.m_v1.Set(this.m_v2)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(d13_1%20%3C%3D%200.0%20%26%26%20d23_1%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_v3.a%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%201%3B%0A%20%20%20%20%20%20%20%20this.m_v1.Set(this.m_v3)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(d23_1%20%3E%200.0%20%26%26%20d23_2%20%3E%200.0%20%26%26%20d123_1%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20var%20inv_d23%20%3D%201.0%20%2F%20(d23_1%20%2B%20d23_2)%3B%0A%20%20%20%20%20%20%20%20this.m_v2.a%20%3D%20d23_1%20*%20inv_d23%3B%0A%20%20%20%20%20%20%20%20this.m_v3.a%20%3D%20d23_2%20*%20inv_d23%3B%0A%20%20%20%20%20%20%20%20this.m_count%20%3D%202%3B%0A%20%20%20%20%20%20%20%20this.m_v1.Set(this.m_v3)%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20inv_d123%20%3D%201.0%20%2F%20(d123_1%20%2B%20d123_2%20%2B%20d123_3)%3B%0A%20%20%20%20%20%20this.m_v1.a%20%3D%20d123_1%20*%20inv_d123%3B%0A%20%20%20%20%20%20this.m_v2.a%20%3D%20d123_2%20*%20inv_d123%3B%0A%20%20%20%20%20%20this.m_v3.a%20%3D%20d123_3%20*%20inv_d123%3B%0A%20%20%20%20%20%20this.m_count%20%3D%203%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2SimplexCache.b2SimplexCache%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.indexA%20%3D%20new%20Vector_a2j_Number(3)%3B%0A%20%20%20%20%20%20this.indexB%20%3D%20new%20Vector_a2j_Number(3)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2SimplexVertex.b2SimplexVertex%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2SimplexVertex.prototype.Set%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20this.wA.SetV(other.wA)%3B%0A%20%20%20%20%20%20this.wB.SetV(other.wB)%3B%0A%20%20%20%20%20%20this.w.SetV(other.w)%3B%0A%20%20%20%20%20%20this.a%20%3D%20other.a%3B%0A%20%20%20%20%20%20this.indexA%20%3D%20other.indexA%3B%0A%20%20%20%20%20%20this.indexB%20%3D%20other.indexB%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2TimeOfImpact.b2TimeOfImpact%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2TimeOfImpact.TimeOfImpact%20%3D%20function%20(input)%20%7B%0A%20%20%20%20%20%20%2B%2Bb2TimeOfImpact.b2_toiCalls%3B%0A%20%20%20%20%20%20var%20proxyA%20%3D%20input.proxyA%3B%0A%20%20%20%20%20%20var%20proxyB%20%3D%20input.proxyB%3B%0A%20%20%20%20%20%20var%20sweepA%20%3D%20input.sweepA%3B%0A%20%20%20%20%20%20var%20sweepB%20%3D%20input.sweepB%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(sweepA.t0%20%3D%3D%20sweepB.t0)%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(1.0%20-%20sweepA.t0%20%3E%20Number.MIN_VALUE)%3B%0A%20%20%20%20%20%20var%20radius%20%3D%20proxyA.m_radius%20%2B%20proxyB.m_radius%3B%0A%20%20%20%20%20%20var%20tolerance%20%3D%20input.tolerance%3B%0A%20%20%20%20%20%20var%20alpha%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20k_maxIterations%20%3D%201000%3B%0A%20%20%20%20%20%20var%20iter%20%3D%200%3B%0A%20%20%20%20%20%20var%20target%20%3D%200.0%3B%0A%20%20%20%20%20%20b2TimeOfImpact.s_cache.count%20%3D%200%3B%0A%20%20%20%20%20%20b2TimeOfImpact.s_distanceInput.useRadii%20%3D%20false%3B%0A%20%20%20%20%20%20for%20(%3B%3B)%20%7B%0A%20%20%20%20%20%20%20%20sweepA.GetTransform(b2TimeOfImpact.s_xfA%2C%20alpha)%3B%0A%20%20%20%20%20%20%20%20sweepB.GetTransform(b2TimeOfImpact.s_xfB%2C%20alpha)%3B%0A%20%20%20%20%20%20%20%20b2TimeOfImpact.s_distanceInput.proxyA%20%3D%20proxyA%3B%0A%20%20%20%20%20%20%20%20b2TimeOfImpact.s_distanceInput.proxyB%20%3D%20proxyB%3B%0A%20%20%20%20%20%20%20%20b2TimeOfImpact.s_distanceInput.transformA%20%3D%20b2TimeOfImpact.s_xfA%3B%0A%20%20%20%20%20%20%20%20b2TimeOfImpact.s_distanceInput.transformB%20%3D%20b2TimeOfImpact.s_xfB%3B%0A%20%20%20%20%20%20%20%20b2Distance.Distance(%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_distanceOutput%2C%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_cache%2C%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_distanceInput%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20if%20(b2TimeOfImpact.s_distanceOutput.distance%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20alpha%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20b2TimeOfImpact.s_fcn.Initialize(%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_cache%2C%0A%20%20%20%20%20%20%20%20%20%20proxyA%2C%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfA%2C%0A%20%20%20%20%20%20%20%20%20%20proxyB%2C%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfB%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20separation%20%3D%20b2TimeOfImpact.s_fcn.Evaluate(%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfA%2C%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfB%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20if%20(separation%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20alpha%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(iter%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(separation%20%3E%20radius)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20target%20%3D%20b2Math.Max(radius%20-%20tolerance%2C%200.75%20*%20radius)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20target%20%3D%20b2Math.Max(separation%20-%20tolerance%2C%200.02%20*%20radius)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(separation%20-%20target%20%3C%200.5%20*%20tolerance)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(iter%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20alpha%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20newAlpha%20%3D%20alpha%3B%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20x1%20%3D%20alpha%3B%0A%20%20%20%20%20%20%20%20%20%20var%20x2%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20var%20f1%20%3D%20separation%3B%0A%20%20%20%20%20%20%20%20%20%20sweepA.GetTransform(b2TimeOfImpact.s_xfA%2C%20x2)%3B%0A%20%20%20%20%20%20%20%20%20%20sweepB.GetTransform(b2TimeOfImpact.s_xfB%2C%20x2)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20f2%20%3D%20b2TimeOfImpact.s_fcn.Evaluate(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfA%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfB%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(f2%20%3E%3D%20target)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20alpha%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20var%20rootIterCount%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(%3B%3B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20x%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(rootIterCount%20%26%201)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20x%20%3D%20x1%20%2B%20((target%20-%20f1)%20*%20(x2%20-%20x1))%20%2F%20(f2%20-%20f1)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20x%20%3D%200.5%20*%20(x1%20%2B%20x2)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20sweepA.GetTransform(b2TimeOfImpact.s_xfA%2C%20x)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20sweepB.GetTransform(b2TimeOfImpact.s_xfB%2C%20x)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20f%20%3D%20b2TimeOfImpact.s_fcn.Evaluate(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfA%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.s_xfB%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(b2Math.Abs(f%20-%20target)%20%3C%200.025%20*%20tolerance)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20newAlpha%20%3D%20x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(f%20%3E%20target)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20x1%20%3D%20x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20f1%20%3D%20f%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20x2%20%3D%20x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20f2%20%3D%20f%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2B%2BrootIterCount%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2B%2Bb2TimeOfImpact.b2_toiRootIters%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(rootIterCount%20%3D%3D%2050)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.b2_toiMaxRootIters%20%3D%20b2Math.Max(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2TimeOfImpact.b2_toiMaxRootIters%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20rootIterCount%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(newAlpha%20%3C%20(1.0%20%2B%20100.0%20*%20Number.MIN_VALUE)%20*%20alpha)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20alpha%20%3D%20newAlpha%3B%0A%20%20%20%20%20%20%20%20iter%2B%2B%3B%0A%20%20%20%20%20%20%20%20%2B%2Bb2TimeOfImpact.b2_toiIters%3B%0A%20%20%20%20%20%20%20%20if%20(iter%20%3D%3D%20k_maxIterations)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20b2TimeOfImpact.b2_toiMaxIters%20%3D%20b2Math.Max(%0A%20%20%20%20%20%20%20%20b2TimeOfImpact.b2_toiMaxIters%2C%0A%20%20%20%20%20%20%20%20iter%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20return%20alpha%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.b2_toiCalls%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.b2_toiIters%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.b2_toiRootIters%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.s_cache%20%3D%20new%20b2SimplexCache()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.s_distanceInput%20%3D%20new%20b2DistanceInput()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.s_xfA%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.s_xfB%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.s_fcn%20%3D%20new%20b2SeparationFunction()%3B%0A%20%20%20%20%20%20Box2D.Collision.b2TimeOfImpact.s_distanceOutput%20%3D%20new%20b2DistanceOutput()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2TOIInput.b2TOIInput%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.proxyA%20%3D%20new%20b2DistanceProxy()%3B%0A%20%20%20%20%20%20this.proxyB%20%3D%20new%20b2DistanceProxy()%3B%0A%20%20%20%20%20%20this.sweepA%20%3D%20new%20b2Sweep()%3B%0A%20%20%20%20%20%20this.sweepB%20%3D%20new%20b2Sweep()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WorldManifold.b2WorldManifold%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WorldManifold.prototype.b2WorldManifold%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_points%20%3D%20new%20Vector(b2Settings.b2_maxManifoldPoints)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.m_points%5Bi%5D%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WorldManifold.prototype.Initialize%20%3D%20function%20(%0A%20%20%20%20%20%20manifold%2C%0A%20%20%20%20%20%20xfA%2C%0A%20%20%20%20%20%20radiusA%2C%0A%20%20%20%20%20%20xfB%2C%0A%20%20%20%20%20%20radiusB%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(radiusA%20%3D%3D%3D%20undefined)%20radiusA%20%3D%200%3B%0A%20%20%20%20%20%20if%20(radiusB%20%3D%3D%3D%20undefined)%20radiusB%20%3D%200%3B%0A%20%20%20%20%20%20if%20(manifold.m_pointCount%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20normalX%20%3D%200%3B%0A%20%20%20%20%20%20var%20normalY%20%3D%200%3B%0A%20%20%20%20%20%20var%20planePointX%20%3D%200%3B%0A%20%20%20%20%20%20var%20planePointY%20%3D%200%3B%0A%20%20%20%20%20%20var%20clipPointX%20%3D%200%3B%0A%20%20%20%20%20%20var%20clipPointY%20%3D%200%3B%0A%20%20%20%20%20%20switch%20(manifold.m_type)%20%7B%0A%20%20%20%20%20%20%20%20case%20b2Manifold.e_circles%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfA.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfA.position.x%20%2B%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfA.position.y%20%2B%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfB.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_points%5B0%5D.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfB.position.x%20%2B%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfB.position.y%20%2B%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20dX%20%3D%20pointBX%20-%20pointAX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20dY%20%3D%20pointBY%20-%20pointAY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20d2%20%3D%20dX%20*%20dX%20%2B%20dY%20*%20dY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(d2%20%3E%20Number.MIN_VALUE%20*%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20d%20%3D%20Math.sqrt(d2)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%20dX%20%2F%20d%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%20dY%20%2F%20d%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%201%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20cAX%20%3D%20pointAX%20%2B%20radiusA%20*%20this.m_normal.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20cAY%20%3D%20pointAY%20%2B%20radiusA%20*%20this.m_normal.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20cBX%20%3D%20pointBX%20-%20radiusB%20*%20this.m_normal.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20cBY%20%3D%20pointBY%20-%20radiusB%20*%20this.m_normal.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5B0%5D.x%20%3D%200.5%20*%20(cAX%20%2B%20cBX)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5B0%5D.y%20%3D%200.5%20*%20(cAY%20%2B%20cBY)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Manifold.e_faceA%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfA.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_localPlaneNormal%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normalX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normalY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfA.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfA.position.x%20%2B%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfA.position.y%20%2B%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20manifold.m_pointCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfB.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_points%5Bi%5D.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfB.position.x%20%2B%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfB.position.y%20%2B%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointX%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200.5%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(radiusA%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointX%20-%20planePointX)%20*%20normalX%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointY%20-%20planePointY)%20*%20normalY%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20radiusB)%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointY%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200.5%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(radiusA%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointX%20-%20planePointX)%20*%20normalX%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointY%20-%20planePointY)%20*%20normalY%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20radiusB)%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Manifold.e_faceB%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfB.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_localPlaneNormal%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normalX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20normalY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfB.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfB.position.x%20%2B%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfB.position.y%20%2B%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%20-normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%20-normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20manifold.m_pointCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20xfA.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20manifold.m_points%5Bi%5D.m_localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfA.position.x%20%2B%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20xfA.position.y%20%2B%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointX%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200.5%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(radiusB%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointX%20-%20planePointX)%20*%20normalX%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointY%20-%20planePointY)%20*%20normalY%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20radiusA)%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointY%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200.5%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(radiusB%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointX%20-%20planePointX)%20*%20normalX%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointY%20-%20planePointY)%20*%20normalY%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20radiusA)%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20ClipVertex.ClipVertex%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.v%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.id%20%3D%20new%20b2ContactID()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20ClipVertex.prototype.Set%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20this.v.SetV(other.v)%3B%0A%20%20%20%20%20%20this.id.Set(other.id)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Features.Features%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22referenceEdge%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20get%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20return%20this._referenceEdge%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22referenceEdge%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(value)%20%7B%0A%20%20%20%20%20%20%20%20if%20(value%20%3D%3D%3D%20undefined)%20value%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._referenceEdge%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20this._m_id._key%20%3D%0A%20%20%20%20%20%20%20%20%20%20(this._m_id._key%20%26%200xffffff00)%20%7C%20(this._referenceEdge%20%26%200x000000ff)%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22incidentEdge%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20get%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20return%20this._incidentEdge%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22incidentEdge%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(value)%20%7B%0A%20%20%20%20%20%20%20%20if%20(value%20%3D%3D%3D%20undefined)%20value%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._incidentEdge%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20this._m_id._key%20%3D%0A%20%20%20%20%20%20%20%20%20%20(this._m_id._key%20%26%200xffff00ff)%20%7C%0A%20%20%20%20%20%20%20%20%20%20((this._incidentEdge%20%3C%3C%208)%20%26%200x0000ff00)%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22incidentVertex%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20get%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20return%20this._incidentVertex%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22incidentVertex%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(value)%20%7B%0A%20%20%20%20%20%20%20%20if%20(value%20%3D%3D%3D%20undefined)%20value%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._incidentVertex%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20this._m_id._key%20%3D%0A%20%20%20%20%20%20%20%20%20%20(this._m_id._key%20%26%200xff00ffff)%20%7C%0A%20%20%20%20%20%20%20%20%20%20((this._incidentVertex%20%3C%3C%2016)%20%26%200x00ff0000)%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22flip%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20get%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20return%20this._flip%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(Features.prototype%2C%20%22flip%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(value)%20%7B%0A%20%20%20%20%20%20%20%20if%20(value%20%3D%3D%3D%20undefined)%20value%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._flip%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20this._m_id._key%20%3D%0A%20%20%20%20%20%20%20%20%20%20(this._m_id._key%20%26%200x00ffffff)%20%7C%20((this._flip%20%3C%3C%2024)%20%26%200xff000000)%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2CircleShape%20%3D%20Box2D.Collision.Shapes.b2CircleShape%2C%0A%20%20%20%20%20%20b2EdgeChainDef%20%3D%20Box2D.Collision.Shapes.b2EdgeChainDef%2C%0A%20%20%20%20%20%20b2EdgeShape%20%3D%20Box2D.Collision.Shapes.b2EdgeShape%2C%0A%20%20%20%20%20%20b2MassData%20%3D%20Box2D.Collision.Shapes.b2MassData%2C%0A%20%20%20%20%20%20b2PolygonShape%20%3D%20Box2D.Collision.Shapes.b2PolygonShape%2C%0A%20%20%20%20%20%20b2Shape%20%3D%20Box2D.Collision.Shapes.b2Shape%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%2C%0A%20%20%20%20%20%20b2Body%20%3D%20Box2D.Dynamics.b2Body%2C%0A%20%20%20%20%20%20b2BodyDef%20%3D%20Box2D.Dynamics.b2BodyDef%2C%0A%20%20%20%20%20%20b2ContactFilter%20%3D%20Box2D.Dynamics.b2ContactFilter%2C%0A%20%20%20%20%20%20b2ContactImpulse%20%3D%20Box2D.Dynamics.b2ContactImpulse%2C%0A%20%20%20%20%20%20b2ContactListener%20%3D%20Box2D.Dynamics.b2ContactListener%2C%0A%20%20%20%20%20%20b2ContactManager%20%3D%20Box2D.Dynamics.b2ContactManager%2C%0A%20%20%20%20%20%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%2C%0A%20%20%20%20%20%20b2DestructionListener%20%3D%20Box2D.Dynamics.b2DestructionListener%2C%0A%20%20%20%20%20%20b2FilterData%20%3D%20Box2D.Dynamics.b2FilterData%2C%0A%20%20%20%20%20%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%2C%0A%20%20%20%20%20%20b2FixtureDef%20%3D%20Box2D.Dynamics.b2FixtureDef%2C%0A%20%20%20%20%20%20b2Island%20%3D%20Box2D.Dynamics.b2Island%2C%0A%20%20%20%20%20%20b2TimeStep%20%3D%20Box2D.Dynamics.b2TimeStep%2C%0A%20%20%20%20%20%20b2World%20%3D%20Box2D.Dynamics.b2World%2C%0A%20%20%20%20%20%20b2AABB%20%3D%20Box2D.Collision.b2AABB%2C%0A%20%20%20%20%20%20b2Bound%20%3D%20Box2D.Collision.b2Bound%2C%0A%20%20%20%20%20%20b2BoundValues%20%3D%20Box2D.Collision.b2BoundValues%2C%0A%20%20%20%20%20%20b2Collision%20%3D%20Box2D.Collision.b2Collision%2C%0A%20%20%20%20%20%20b2ContactID%20%3D%20Box2D.Collision.b2ContactID%2C%0A%20%20%20%20%20%20b2ContactPoint%20%3D%20Box2D.Collision.b2ContactPoint%2C%0A%20%20%20%20%20%20b2Distance%20%3D%20Box2D.Collision.b2Distance%2C%0A%20%20%20%20%20%20b2DistanceInput%20%3D%20Box2D.Collision.b2DistanceInput%2C%0A%20%20%20%20%20%20b2DistanceOutput%20%3D%20Box2D.Collision.b2DistanceOutput%2C%0A%20%20%20%20%20%20b2DistanceProxy%20%3D%20Box2D.Collision.b2DistanceProxy%2C%0A%20%20%20%20%20%20b2DynamicTree%20%3D%20Box2D.Collision.b2DynamicTree%2C%0A%20%20%20%20%20%20b2DynamicTreeBroadPhase%20%3D%20Box2D.Collision.b2DynamicTreeBroadPhase%2C%0A%20%20%20%20%20%20b2DynamicTreeNode%20%3D%20Box2D.Collision.b2DynamicTreeNode%2C%0A%20%20%20%20%20%20b2DynamicTreePair%20%3D%20Box2D.Collision.b2DynamicTreePair%2C%0A%20%20%20%20%20%20b2Manifold%20%3D%20Box2D.Collision.b2Manifold%2C%0A%20%20%20%20%20%20b2ManifoldPoint%20%3D%20Box2D.Collision.b2ManifoldPoint%2C%0A%20%20%20%20%20%20b2Point%20%3D%20Box2D.Collision.b2Point%2C%0A%20%20%20%20%20%20b2RayCastInput%20%3D%20Box2D.Collision.b2RayCastInput%2C%0A%20%20%20%20%20%20b2RayCastOutput%20%3D%20Box2D.Collision.b2RayCastOutput%2C%0A%20%20%20%20%20%20b2Segment%20%3D%20Box2D.Collision.b2Segment%2C%0A%20%20%20%20%20%20b2SeparationFunction%20%3D%20Box2D.Collision.b2SeparationFunction%2C%0A%20%20%20%20%20%20b2Simplex%20%3D%20Box2D.Collision.b2Simplex%2C%0A%20%20%20%20%20%20b2SimplexCache%20%3D%20Box2D.Collision.b2SimplexCache%2C%0A%20%20%20%20%20%20b2SimplexVertex%20%3D%20Box2D.Collision.b2SimplexVertex%2C%0A%20%20%20%20%20%20b2TimeOfImpact%20%3D%20Box2D.Collision.b2TimeOfImpact%2C%0A%20%20%20%20%20%20b2TOIInput%20%3D%20Box2D.Collision.b2TOIInput%2C%0A%20%20%20%20%20%20b2WorldManifold%20%3D%20Box2D.Collision.b2WorldManifold%2C%0A%20%20%20%20%20%20ClipVertex%20%3D%20Box2D.Collision.ClipVertex%2C%0A%20%20%20%20%20%20Features%20%3D%20Box2D.Collision.Features%2C%0A%20%20%20%20%20%20IBroadPhase%20%3D%20Box2D.Collision.IBroadPhase%3B%0A%0A%20%20%20%20Box2D.inherit(b2CircleShape%2C%20Box2D.Collision.Shapes.b2Shape)%3B%0A%20%20%20%20b2CircleShape.prototype.__super%20%3D%20Box2D.Collision.Shapes.b2Shape.prototype%3B%0A%20%20%20%20b2CircleShape.b2CircleShape%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_p%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20s%20%3D%20new%20b2CircleShape()%3B%0A%20%20%20%20%20%20s.Set(this)%3B%0A%20%20%20%20%20%20return%20s%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.Set%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20this.__super.Set.call(this%2C%20other)%3B%0A%20%20%20%20%20%20if%20(Box2D.is(other%2C%20b2CircleShape))%20%7B%0A%20%20%20%20%20%20%20%20var%20other2%20%3D%20other%20instanceof%20b2CircleShape%20%3F%20other%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20this.m_p.SetV(other2.m_p)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.TestPoint%20%3D%20function%20(transform%2C%20p)%20%7B%0A%20%20%20%20%20%20var%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20dX%20%3D%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_p.x%20%2B%20tMat.col2.x%20*%20this.m_p.y)%3B%0A%20%20%20%20%20%20var%20dY%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_p.x%20%2B%20tMat.col2.y%20*%20this.m_p.y)%3B%0A%20%20%20%20%20%20dX%20%3D%20p.x%20-%20dX%3B%0A%20%20%20%20%20%20dY%20%3D%20p.y%20-%20dY%3B%0A%20%20%20%20%20%20return%20dX%20*%20dX%20%2B%20dY%20*%20dY%20%3C%3D%20this.m_radius%20*%20this.m_radius%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.RayCast%20%3D%20function%20(output%2C%20input%2C%20transform)%20%7B%0A%20%20%20%20%20%20var%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20positionX%20%3D%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_p.x%20%2B%20tMat.col2.x%20*%20this.m_p.y)%3B%0A%20%20%20%20%20%20var%20positionY%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_p.x%20%2B%20tMat.col2.y%20*%20this.m_p.y)%3B%0A%20%20%20%20%20%20var%20sX%20%3D%20input.p1.x%20-%20positionX%3B%0A%20%20%20%20%20%20var%20sY%20%3D%20input.p1.y%20-%20positionY%3B%0A%20%20%20%20%20%20var%20b%20%3D%20sX%20*%20sX%20%2B%20sY%20*%20sY%20-%20this.m_radius%20*%20this.m_radius%3B%0A%20%20%20%20%20%20var%20rX%20%3D%20input.p2.x%20-%20input.p1.x%3B%0A%20%20%20%20%20%20var%20rY%20%3D%20input.p2.y%20-%20input.p1.y%3B%0A%20%20%20%20%20%20var%20c%20%3D%20sX%20*%20rX%20%2B%20sY%20*%20rY%3B%0A%20%20%20%20%20%20var%20rr%20%3D%20rX%20*%20rX%20%2B%20rY%20*%20rY%3B%0A%20%20%20%20%20%20var%20sigma%20%3D%20c%20*%20c%20-%20rr%20*%20b%3B%0A%20%20%20%20%20%20if%20(sigma%20%3C%200.0%20%7C%7C%20rr%20%3C%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20a%20%3D%20-(c%20%2B%20Math.sqrt(sigma))%3B%0A%20%20%20%20%20%20if%20(0.0%20%3C%3D%20a%20%26%26%20a%20%3C%3D%20input.maxFraction%20*%20rr)%20%7B%0A%20%20%20%20%20%20%20%20a%20%2F%3D%20rr%3B%0A%20%20%20%20%20%20%20%20output.fraction%20%3D%20a%3B%0A%20%20%20%20%20%20%20%20output.normal.x%20%3D%20sX%20%2B%20a%20*%20rX%3B%0A%20%20%20%20%20%20%20%20output.normal.y%20%3D%20sY%20%2B%20a%20*%20rY%3B%0A%20%20%20%20%20%20%20%20output.normal.Normalize()%3B%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.ComputeAABB%20%3D%20function%20(aabb%2C%20transform)%20%7B%0A%20%20%20%20%20%20var%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20pX%20%3D%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_p.x%20%2B%20tMat.col2.x%20*%20this.m_p.y)%3B%0A%20%20%20%20%20%20var%20pY%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_p.x%20%2B%20tMat.col2.y%20*%20this.m_p.y)%3B%0A%20%20%20%20%20%20aabb.lowerBound.Set(pX%20-%20this.m_radius%2C%20pY%20-%20this.m_radius)%3B%0A%20%20%20%20%20%20aabb.upperBound.Set(pX%20%2B%20this.m_radius%2C%20pY%20%2B%20this.m_radius)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.ComputeMass%20%3D%20function%20(massData%2C%20density)%20%7B%0A%20%20%20%20%20%20if%20(density%20%3D%3D%3D%20undefined)%20density%20%3D%200%3B%0A%20%20%20%20%20%20massData.mass%20%3D%20density%20*%20b2Settings.b2_pi%20*%20this.m_radius%20*%20this.m_radius%3B%0A%20%20%20%20%20%20massData.center.SetV(this.m_p)%3B%0A%20%20%20%20%20%20massData.I%20%3D%0A%20%20%20%20%20%20%20%20massData.mass%20*%0A%20%20%20%20%20%20%20%20(0.5%20*%20this.m_radius%20*%20this.m_radius%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_p.x%20*%20this.m_p.x%20%2B%20this.m_p.y%20*%20this.m_p.y))%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.ComputeSubmergedArea%20%3D%20function%20(%0A%20%20%20%20%20%20normal%2C%0A%20%20%20%20%20%20offset%2C%0A%20%20%20%20%20%20xf%2C%0A%20%20%20%20%20%20c%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(offset%20%3D%3D%3D%20undefined)%20offset%20%3D%200%3B%0A%20%20%20%20%20%20var%20p%20%3D%20b2Math.MulX(xf%2C%20this.m_p)%3B%0A%20%20%20%20%20%20var%20l%20%3D%20-(b2Math.Dot(normal%2C%20p)%20-%20offset)%3B%0A%20%20%20%20%20%20if%20(l%20%3C%20-this.m_radius%20%2B%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(l%20%3E%20this.m_radius)%20%7B%0A%20%20%20%20%20%20%20%20c.SetV(p)%3B%0A%20%20%20%20%20%20%20%20return%20Math.PI%20*%20this.m_radius%20*%20this.m_radius%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20r2%20%3D%20this.m_radius%20*%20this.m_radius%3B%0A%20%20%20%20%20%20var%20l2%20%3D%20l%20*%20l%3B%0A%20%20%20%20%20%20var%20area%20%3D%0A%20%20%20%20%20%20%20%20r2%20*%20(Math.asin(l%20%2F%20this.m_radius)%20%2B%20Math.PI%20%2F%202)%20%2B%0A%20%20%20%20%20%20%20%20l%20*%20Math.sqrt(r2%20-%20l2)%3B%0A%20%20%20%20%20%20var%20com%20%3D%20((-2%20%2F%203)%20*%20Math.pow(r2%20-%20l2%2C%201.5))%20%2F%20area%3B%0A%20%20%20%20%20%20c.x%20%3D%20p.x%20%2B%20normal.x%20*%20com%3B%0A%20%20%20%20%20%20c.y%20%3D%20p.y%20%2B%20normal.y%20*%20com%3B%0A%20%20%20%20%20%20return%20area%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.GetLocalPosition%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_p%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.SetLocalPosition%20%3D%20function%20(position)%20%7B%0A%20%20%20%20%20%20this.m_p.SetV(position)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.GetRadius%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_radius%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.SetRadius%20%3D%20function%20(radius)%20%7B%0A%20%20%20%20%20%20if%20(radius%20%3D%3D%3D%20undefined)%20radius%20%3D%200%3B%0A%20%20%20%20%20%20this.m_radius%20%3D%20radius%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleShape.prototype.b2CircleShape%20%3D%20function%20(radius)%20%7B%0A%20%20%20%20%20%20if%20(radius%20%3D%3D%3D%20undefined)%20radius%20%3D%200%3B%0A%20%20%20%20%20%20this.__super.b2Shape.call(this)%3B%0A%20%20%20%20%20%20this.m_type%20%3D%20b2Shape.e_circleShape%3B%0A%20%20%20%20%20%20this.m_radius%20%3D%20radius%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeChainDef.b2EdgeChainDef%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2EdgeChainDef.prototype.b2EdgeChainDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.vertexCount%20%3D%200%3B%0A%20%20%20%20%20%20this.isALoop%20%3D%20true%3B%0A%20%20%20%20%20%20this.vertices%20%3D%20%5B%5D%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2EdgeShape%2C%20Box2D.Collision.Shapes.b2Shape)%3B%0A%20%20%20%20b2EdgeShape.prototype.__super%20%3D%20Box2D.Collision.Shapes.b2Shape.prototype%3B%0A%20%20%20%20b2EdgeShape.b2EdgeShape%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.s_supportVec%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_v1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_v2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_coreV1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_coreV2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_direction%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_cornerDir1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_cornerDir2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.TestPoint%20%3D%20function%20(transform%2C%20p)%20%7B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.RayCast%20%3D%20function%20(output%2C%20input%2C%20transform)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20rX%20%3D%20input.p2.x%20-%20input.p1.x%3B%0A%20%20%20%20%20%20var%20rY%20%3D%20input.p2.y%20-%20input.p1.y%3B%0A%20%20%20%20%20%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20v1X%20%3D%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_v1.x%20%2B%20tMat.col2.x%20*%20this.m_v1.y)%3B%0A%20%20%20%20%20%20var%20v1Y%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_v1.x%20%2B%20tMat.col2.y%20*%20this.m_v1.y)%3B%0A%20%20%20%20%20%20var%20nX%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_v2.x%20%2B%20tMat.col2.y%20*%20this.m_v2.y)%20-%0A%20%20%20%20%20%20%20%20v1Y%3B%0A%20%20%20%20%20%20var%20nY%20%3D%20-(%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_v2.x%20%2B%20tMat.col2.x%20*%20this.m_v2.y)%20-%0A%20%20%20%20%20%20%20%20v1X%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20k_slop%20%3D%20100.0%20*%20Number.MIN_VALUE%3B%0A%20%20%20%20%20%20var%20denom%20%3D%20-(rX%20*%20nX%20%2B%20rY%20*%20nY)%3B%0A%20%20%20%20%20%20if%20(denom%20%3E%20k_slop)%20%7B%0A%20%20%20%20%20%20%20%20var%20bX%20%3D%20input.p1.x%20-%20v1X%3B%0A%20%20%20%20%20%20%20%20var%20bY%20%3D%20input.p1.y%20-%20v1Y%3B%0A%20%20%20%20%20%20%20%20var%20a%20%3D%20bX%20*%20nX%20%2B%20bY%20*%20nY%3B%0A%20%20%20%20%20%20%20%20if%20(0.0%20%3C%3D%20a%20%26%26%20a%20%3C%3D%20input.maxFraction%20*%20denom)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20mu2%20%3D%20-rX%20*%20bY%20%2B%20rY%20*%20bX%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(-k_slop%20*%20denom%20%3C%3D%20mu2%20%26%26%20mu2%20%3C%3D%20denom%20*%20(1.0%20%2B%20k_slop))%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20a%20%2F%3D%20denom%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20output.fraction%20%3D%20a%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20nLen%20%3D%20Math.sqrt(nX%20*%20nX%20%2B%20nY%20*%20nY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20output.normal.x%20%3D%20nX%20%2F%20nLen%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20output.normal.y%20%3D%20nY%20%2F%20nLen%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.ComputeAABB%20%3D%20function%20(aabb%2C%20transform)%20%7B%0A%20%20%20%20%20%20var%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20v1X%20%3D%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_v1.x%20%2B%20tMat.col2.x%20*%20this.m_v1.y)%3B%0A%20%20%20%20%20%20var%20v1Y%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_v1.x%20%2B%20tMat.col2.y%20*%20this.m_v1.y)%3B%0A%20%20%20%20%20%20var%20v2X%20%3D%0A%20%20%20%20%20%20%20%20transform.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_v2.x%20%2B%20tMat.col2.x%20*%20this.m_v2.y)%3B%0A%20%20%20%20%20%20var%20v2Y%20%3D%0A%20%20%20%20%20%20%20%20transform.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_v2.x%20%2B%20tMat.col2.y%20*%20this.m_v2.y)%3B%0A%20%20%20%20%20%20if%20(v1X%20%3C%20v2X)%20%7B%0A%20%20%20%20%20%20%20%20aabb.lowerBound.x%20%3D%20v1X%3B%0A%20%20%20%20%20%20%20%20aabb.upperBound.x%20%3D%20v2X%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20aabb.lowerBound.x%20%3D%20v2X%3B%0A%20%20%20%20%20%20%20%20aabb.upperBound.x%20%3D%20v1X%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(v1Y%20%3C%20v2Y)%20%7B%0A%20%20%20%20%20%20%20%20aabb.lowerBound.y%20%3D%20v1Y%3B%0A%20%20%20%20%20%20%20%20aabb.upperBound.y%20%3D%20v2Y%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20aabb.lowerBound.y%20%3D%20v2Y%3B%0A%20%20%20%20%20%20%20%20aabb.upperBound.y%20%3D%20v1Y%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.ComputeMass%20%3D%20function%20(massData%2C%20density)%20%7B%0A%20%20%20%20%20%20if%20(density%20%3D%3D%3D%20undefined)%20density%20%3D%200%3B%0A%20%20%20%20%20%20massData.mass%20%3D%200%3B%0A%20%20%20%20%20%20massData.center.SetV(this.m_v1)%3B%0A%20%20%20%20%20%20massData.I%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.ComputeSubmergedArea%20%3D%20function%20(%0A%20%20%20%20%20%20normal%2C%0A%20%20%20%20%20%20offset%2C%0A%20%20%20%20%20%20xf%2C%0A%20%20%20%20%20%20c%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(offset%20%3D%3D%3D%20undefined)%20offset%20%3D%200%3B%0A%20%20%20%20%20%20var%20v0%20%3D%20new%20b2Vec2(normal.x%20*%20offset%2C%20normal.y%20*%20offset)%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20b2Math.MulX(xf%2C%20this.m_v1)%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20b2Math.MulX(xf%2C%20this.m_v2)%3B%0A%20%20%20%20%20%20var%20d1%20%3D%20b2Math.Dot(normal%2C%20v1)%20-%20offset%3B%0A%20%20%20%20%20%20var%20d2%20%3D%20b2Math.Dot(normal%2C%20v2)%20-%20offset%3B%0A%20%20%20%20%20%20if%20(d1%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20if%20(d2%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20v1.x%20%3D%20(-d2%20%2F%20(d1%20-%20d2))%20*%20v1.x%20%2B%20(d1%20%2F%20(d1%20-%20d2))%20*%20v2.x%3B%0A%20%20%20%20%20%20%20%20%20%20v1.y%20%3D%20(-d2%20%2F%20(d1%20-%20d2))%20*%20v1.y%20%2B%20(d1%20%2F%20(d1%20-%20d2))%20*%20v2.y%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20if%20(d2%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20v2.x%20%3D%20(-d2%20%2F%20(d1%20-%20d2))%20*%20v1.x%20%2B%20(d1%20%2F%20(d1%20-%20d2))%20*%20v2.x%3B%0A%20%20%20%20%20%20%20%20%20%20v2.y%20%3D%20(-d2%20%2F%20(d1%20-%20d2))%20*%20v1.y%20%2B%20(d1%20%2F%20(d1%20-%20d2))%20*%20v2.y%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20c.x%20%3D%20(v0.x%20%2B%20v1.x%20%2B%20v2.x)%20%2F%203%3B%0A%20%20%20%20%20%20c.y%20%3D%20(v0.y%20%2B%20v1.y%20%2B%20v2.y)%20%2F%203%3B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%200.5%20*%20((v1.x%20-%20v0.x)%20*%20(v2.y%20-%20v0.y)%20-%20(v1.y%20-%20v0.y)%20*%20(v2.x%20-%20v0.x))%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetLength%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_length%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetVertex1%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_v1%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetVertex2%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_v2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetCoreVertex1%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_coreV1%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetCoreVertex2%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_coreV2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetNormalVector%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_normal%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetDirectionVector%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_direction%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetCorner1Vector%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_cornerDir1%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetCorner2Vector%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_cornerDir2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.Corner1IsConvex%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_cornerConvex1%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.Corner2IsConvex%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_cornerConvex2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetFirstVertex%20%3D%20function%20(xf)%20%7B%0A%20%20%20%20%20%20var%20tMat%20%3D%20xf.R%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_coreV1.x%20%2B%20tMat.col2.x%20*%20this.m_coreV1.y)%2C%0A%20%20%20%20%20%20%20%20xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_coreV1.x%20%2B%20tMat.col2.y%20*%20this.m_coreV1.y)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetNextEdge%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_nextEdge%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.GetPrevEdge%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_prevEdge%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.Support%20%3D%20function%20(xf%2C%20dX%2C%20dY)%20%7B%0A%20%20%20%20%20%20if%20(dX%20%3D%3D%3D%20undefined)%20dX%20%3D%200%3B%0A%20%20%20%20%20%20if%20(dY%20%3D%3D%3D%20undefined)%20dY%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20xf.R%3B%0A%20%20%20%20%20%20var%20v1X%20%3D%0A%20%20%20%20%20%20%20%20xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_coreV1.x%20%2B%20tMat.col2.x%20*%20this.m_coreV1.y)%3B%0A%20%20%20%20%20%20var%20v1Y%20%3D%0A%20%20%20%20%20%20%20%20xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_coreV1.x%20%2B%20tMat.col2.y%20*%20this.m_coreV1.y)%3B%0A%20%20%20%20%20%20var%20v2X%20%3D%0A%20%20%20%20%20%20%20%20xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20this.m_coreV2.x%20%2B%20tMat.col2.x%20*%20this.m_coreV2.y)%3B%0A%20%20%20%20%20%20var%20v2Y%20%3D%0A%20%20%20%20%20%20%20%20xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20this.m_coreV2.x%20%2B%20tMat.col2.y%20*%20this.m_coreV2.y)%3B%0A%20%20%20%20%20%20if%20(v1X%20*%20dX%20%2B%20v1Y%20*%20dY%20%3E%20v2X%20*%20dX%20%2B%20v2Y%20*%20dY)%20%7B%0A%20%20%20%20%20%20%20%20this.s_supportVec.x%20%3D%20v1X%3B%0A%20%20%20%20%20%20%20%20this.s_supportVec.y%20%3D%20v1Y%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.s_supportVec.x%20%3D%20v2X%3B%0A%20%20%20%20%20%20%20%20this.s_supportVec.y%20%3D%20v2Y%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20this.s_supportVec%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.b2EdgeShape%20%3D%20function%20(v1%2C%20v2)%20%7B%0A%20%20%20%20%20%20this.__super.b2Shape.call(this)%3B%0A%20%20%20%20%20%20this.m_type%20%3D%20b2Shape.e_edgeShape%3B%0A%20%20%20%20%20%20this.m_prevEdge%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nextEdge%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_v1%20%3D%20v1%3B%0A%20%20%20%20%20%20this.m_v2%20%3D%20v2%3B%0A%20%20%20%20%20%20this.m_direction.Set(this.m_v2.x%20-%20this.m_v1.x%2C%20this.m_v2.y%20-%20this.m_v1.y)%3B%0A%20%20%20%20%20%20this.m_length%20%3D%20this.m_direction.Normalize()%3B%0A%20%20%20%20%20%20this.m_normal.Set(this.m_direction.y%2C%20-this.m_direction.x)%3B%0A%20%20%20%20%20%20this.m_coreV1.Set(%0A%20%20%20%20%20%20%20%20-b2Settings.b2_toiSlop%20*%20(this.m_normal.x%20-%20this.m_direction.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_v1.x%2C%0A%20%20%20%20%20%20%20%20-b2Settings.b2_toiSlop%20*%20(this.m_normal.y%20-%20this.m_direction.y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_v1.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.m_coreV2.Set(%0A%20%20%20%20%20%20%20%20-b2Settings.b2_toiSlop%20*%20(this.m_normal.x%20%2B%20this.m_direction.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_v2.x%2C%0A%20%20%20%20%20%20%20%20-b2Settings.b2_toiSlop%20*%20(this.m_normal.y%20%2B%20this.m_direction.y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_v2.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.m_cornerDir1%20%3D%20this.m_normal%3B%0A%20%20%20%20%20%20this.m_cornerDir2.Set(-this.m_normal.x%2C%20-this.m_normal.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.SetPrevEdge%20%3D%20function%20(edge%2C%20core%2C%20cornerDir%2C%20convex)%20%7B%0A%20%20%20%20%20%20this.m_prevEdge%20%3D%20edge%3B%0A%20%20%20%20%20%20this.m_coreV1%20%3D%20core%3B%0A%20%20%20%20%20%20this.m_cornerDir1%20%3D%20cornerDir%3B%0A%20%20%20%20%20%20this.m_cornerConvex1%20%3D%20convex%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeShape.prototype.SetNextEdge%20%3D%20function%20(edge%2C%20core%2C%20cornerDir%2C%20convex)%20%7B%0A%20%20%20%20%20%20this.m_nextEdge%20%3D%20edge%3B%0A%20%20%20%20%20%20this.m_coreV2%20%3D%20core%3B%0A%20%20%20%20%20%20this.m_cornerDir2%20%3D%20cornerDir%3B%0A%20%20%20%20%20%20this.m_cornerConvex2%20%3D%20convex%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MassData.b2MassData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.mass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.center%20%3D%20new%20b2Vec2(0%2C%200)%3B%0A%20%20%20%20%20%20this.I%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2PolygonShape%2C%20Box2D.Collision.Shapes.b2Shape)%3B%0A%20%20%20%20b2PolygonShape.prototype.__super%20%3D%20Box2D.Collision.Shapes.b2Shape.prototype%3B%0A%20%20%20%20b2PolygonShape.b2PolygonShape%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20s%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20%20%20s.Set(this)%3B%0A%20%20%20%20%20%20return%20s%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.Set%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20this.__super.Set.call(this%2C%20other)%3B%0A%20%20%20%20%20%20if%20(Box2D.is(other%2C%20b2PolygonShape))%20%7B%0A%20%20%20%20%20%20%20%20var%20other2%20%3D%20other%20instanceof%20b2PolygonShape%20%3F%20other%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20this.m_centroid.SetV(other2.m_centroid)%3B%0A%20%20%20%20%20%20%20%20this.m_vertexCount%20%3D%20other2.m_vertexCount%3B%0A%20%20%20%20%20%20%20%20this.Reserve(this.m_vertexCount)%3B%0A%20%20%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_vertices%5Bi%5D.SetV(other2.m_vertices%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_normals%5Bi%5D.SetV(other2.m_normals%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.SetAsArray%20%3D%20function%20(vertices%2C%20vertexCount)%20%7B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%3D%20undefined)%20vertexCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20v%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%2C%0A%20%20%20%20%20%20%20%20tVec%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20vertices.length%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20v.push(tVec)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.SetAsVector(v%2C%20vertexCount)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.AsArray%20%3D%20function%20(vertices%2C%20vertexCount)%20%7B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%3D%20undefined)%20vertexCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20polygonShape%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20%20%20polygonShape.SetAsArray(vertices%2C%20vertexCount)%3B%0A%20%20%20%20%20%20return%20polygonShape%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.SetAsVector%20%3D%20function%20(vertices%2C%20vertexCount)%20%7B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%3D%20undefined)%20vertexCount%20%3D%200%3B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%200)%20vertexCount%20%3D%20vertices.length%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(2%20%3C%3D%20vertexCount)%3B%0A%20%20%20%20%20%20this.m_vertexCount%20%3D%20vertexCount%3B%0A%20%20%20%20%20%20this.Reserve(vertexCount)%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.m_vertices%5Bi%5D.SetV(vertices%5Bi%5D)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20i1%20%3D%20parseInt(i)%3B%0A%20%20%20%20%20%20%20%20var%20i2%20%3D%20parseInt(i%20%2B%201%20%3C%20this.m_vertexCount%20%3F%20i%20%2B%201%20%3A%200)%3B%0A%20%20%20%20%20%20%20%20var%20edge%20%3D%20b2Math.SubtractVV(this.m_vertices%5Bi2%5D%2C%20this.m_vertices%5Bi1%5D)%3B%0A%20%20%20%20%20%20%20%20b2Settings.b2Assert(edge.LengthSquared()%20%3E%20Number.MIN_VALUE)%3B%0A%20%20%20%20%20%20%20%20this.m_normals%5Bi%5D.SetV(b2Math.CrossVF(edge%2C%201.0))%3B%0A%20%20%20%20%20%20%20%20this.m_normals%5Bi%5D.Normalize()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_centroid%20%3D%20b2PolygonShape.ComputeCentroid(%0A%20%20%20%20%20%20%20%20this.m_vertices%2C%0A%20%20%20%20%20%20%20%20this.m_vertexCount%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.AsVector%20%3D%20function%20(vertices%2C%20vertexCount)%20%7B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%3D%20undefined)%20vertexCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20polygonShape%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20%20%20polygonShape.SetAsVector(vertices%2C%20vertexCount)%3B%0A%20%20%20%20%20%20return%20polygonShape%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.SetAsBox%20%3D%20function%20(hx%2C%20hy)%20%7B%0A%20%20%20%20%20%20if%20(hx%20%3D%3D%3D%20undefined)%20hx%20%3D%200%3B%0A%20%20%20%20%20%20if%20(hy%20%3D%3D%3D%20undefined)%20hy%20%3D%200%3B%0A%20%20%20%20%20%20this.m_vertexCount%20%3D%204%3B%0A%20%20%20%20%20%20this.Reserve(4)%3B%0A%20%20%20%20%20%20this.m_vertices%5B0%5D.Set(-hx%2C%20-hy)%3B%0A%20%20%20%20%20%20this.m_vertices%5B1%5D.Set(hx%2C%20-hy)%3B%0A%20%20%20%20%20%20this.m_vertices%5B2%5D.Set(hx%2C%20hy)%3B%0A%20%20%20%20%20%20this.m_vertices%5B3%5D.Set(-hx%2C%20hy)%3B%0A%20%20%20%20%20%20this.m_normals%5B0%5D.Set(0.0%2C%20-1.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B1%5D.Set(1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B2%5D.Set(0.0%2C%201.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B3%5D.Set(-1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.m_centroid.SetZero()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.AsBox%20%3D%20function%20(hx%2C%20hy)%20%7B%0A%20%20%20%20%20%20if%20(hx%20%3D%3D%3D%20undefined)%20hx%20%3D%200%3B%0A%20%20%20%20%20%20if%20(hy%20%3D%3D%3D%20undefined)%20hy%20%3D%200%3B%0A%20%20%20%20%20%20var%20polygonShape%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20%20%20polygonShape.SetAsBox(hx%2C%20hy)%3B%0A%20%20%20%20%20%20return%20polygonShape%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.SetAsOrientedBox%20%3D%20function%20(hx%2C%20hy%2C%20center%2C%20angle)%20%7B%0A%20%20%20%20%20%20if%20(hx%20%3D%3D%3D%20undefined)%20hx%20%3D%200%3B%0A%20%20%20%20%20%20if%20(hy%20%3D%3D%3D%20undefined)%20hy%20%3D%200%3B%0A%20%20%20%20%20%20if%20(center%20%3D%3D%3D%20undefined)%20center%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(angle%20%3D%3D%3D%20undefined)%20angle%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_vertexCount%20%3D%204%3B%0A%20%20%20%20%20%20this.Reserve(4)%3B%0A%20%20%20%20%20%20this.m_vertices%5B0%5D.Set(-hx%2C%20-hy)%3B%0A%20%20%20%20%20%20this.m_vertices%5B1%5D.Set(hx%2C%20-hy)%3B%0A%20%20%20%20%20%20this.m_vertices%5B2%5D.Set(hx%2C%20hy)%3B%0A%20%20%20%20%20%20this.m_vertices%5B3%5D.Set(-hx%2C%20hy)%3B%0A%20%20%20%20%20%20this.m_normals%5B0%5D.Set(0.0%2C%20-1.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B1%5D.Set(1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B2%5D.Set(0.0%2C%201.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B3%5D.Set(-1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.m_centroid%20%3D%20center%3B%0A%20%20%20%20%20%20var%20xf%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20xf.position%20%3D%20center%3B%0A%20%20%20%20%20%20xf.R.Set(angle)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20this.m_vertices%5Bi%5D%20%3D%20b2Math.MulX(xf%2C%20this.m_vertices%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20this.m_normals%5Bi%5D%20%3D%20b2Math.MulMV(xf.R%2C%20this.m_normals%5Bi%5D)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.AsOrientedBox%20%3D%20function%20(hx%2C%20hy%2C%20center%2C%20angle)%20%7B%0A%20%20%20%20%20%20if%20(hx%20%3D%3D%3D%20undefined)%20hx%20%3D%200%3B%0A%20%20%20%20%20%20if%20(hy%20%3D%3D%3D%20undefined)%20hy%20%3D%200%3B%0A%20%20%20%20%20%20if%20(center%20%3D%3D%3D%20undefined)%20center%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(angle%20%3D%3D%3D%20undefined)%20angle%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20polygonShape%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20%20%20polygonShape.SetAsOrientedBox(hx%2C%20hy%2C%20center%2C%20angle)%3B%0A%20%20%20%20%20%20return%20polygonShape%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.SetAsEdge%20%3D%20function%20(v1%2C%20v2)%20%7B%0A%20%20%20%20%20%20this.m_vertexCount%20%3D%202%3B%0A%20%20%20%20%20%20this.Reserve(2)%3B%0A%20%20%20%20%20%20this.m_vertices%5B0%5D.SetV(v1)%3B%0A%20%20%20%20%20%20this.m_vertices%5B1%5D.SetV(v2)%3B%0A%20%20%20%20%20%20this.m_centroid.x%20%3D%200.5%20*%20(v1.x%20%2B%20v2.x)%3B%0A%20%20%20%20%20%20this.m_centroid.y%20%3D%200.5%20*%20(v1.y%20%2B%20v2.y)%3B%0A%20%20%20%20%20%20this.m_normals%5B0%5D%20%3D%20b2Math.CrossVF(b2Math.SubtractVV(v2%2C%20v1)%2C%201.0)%3B%0A%20%20%20%20%20%20this.m_normals%5B0%5D.Normalize()%3B%0A%20%20%20%20%20%20this.m_normals%5B1%5D.x%20%3D%20-this.m_normals%5B0%5D.x%3B%0A%20%20%20%20%20%20this.m_normals%5B1%5D.y%20%3D%20-this.m_normals%5B0%5D.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.AsEdge%20%3D%20function%20(v1%2C%20v2)%20%7B%0A%20%20%20%20%20%20var%20polygonShape%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20%20%20polygonShape.SetAsEdge(v1%2C%20v2)%3B%0A%20%20%20%20%20%20return%20polygonShape%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.TestPoint%20%3D%20function%20(xf%2C%20p)%20%7B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20xf.R%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20p.x%20-%20xf.position.x%3B%0A%20%20%20%20%20%20var%20tY%20%3D%20p.y%20-%20xf.position.y%3B%0A%20%20%20%20%20%20var%20pLocalX%20%3D%20tX%20*%20tMat.col1.x%20%2B%20tY%20*%20tMat.col1.y%3B%0A%20%20%20%20%20%20var%20pLocalY%20%3D%20tX%20*%20tMat.col2.x%20%2B%20tY%20*%20tMat.col2.y%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20pLocalX%20-%20tVec.x%3B%0A%20%20%20%20%20%20%20%20tY%20%3D%20pLocalY%20-%20tVec.y%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_normals%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20dot%20%3D%20tVec.x%20*%20tX%20%2B%20tVec.y%20*%20tY%3B%0A%20%20%20%20%20%20%20%20if%20(dot%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.RayCast%20%3D%20function%20(output%2C%20input%2C%20transform)%20%7B%0A%20%20%20%20%20%20var%20lower%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20upper%20%3D%20input.maxFraction%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20tX%20%3D%20input.p1.x%20-%20transform.position.x%3B%0A%20%20%20%20%20%20tY%20%3D%20input.p1.y%20-%20transform.position.y%3B%0A%20%20%20%20%20%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%20tX%20*%20tMat.col1.x%20%2B%20tY%20*%20tMat.col1.y%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%20tX%20*%20tMat.col2.x%20%2B%20tY%20*%20tMat.col2.y%3B%0A%20%20%20%20%20%20tX%20%3D%20input.p2.x%20-%20transform.position.x%3B%0A%20%20%20%20%20%20tY%20%3D%20input.p2.y%20-%20transform.position.y%3B%0A%20%20%20%20%20%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20var%20p2X%20%3D%20tX%20*%20tMat.col1.x%20%2B%20tY%20*%20tMat.col1.y%3B%0A%20%20%20%20%20%20var%20p2Y%20%3D%20tX%20*%20tMat.col2.x%20%2B%20tY%20*%20tMat.col2.y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p2X%20-%20p1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p2Y%20-%20p1Y%3B%0A%20%20%20%20%20%20var%20index%20%3D%20parseInt(-1)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tVec.x%20-%20p1X%3B%0A%20%20%20%20%20%20%20%20tY%20%3D%20tVec.y%20-%20p1Y%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_normals%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20numerator%20%3D%20tVec.x%20*%20tX%20%2B%20tVec.y%20*%20tY%3B%0A%20%20%20%20%20%20%20%20var%20denominator%20%3D%20tVec.x%20*%20dX%20%2B%20tVec.y%20*%20dY%3B%0A%20%20%20%20%20%20%20%20if%20(denominator%20%3D%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(numerator%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(denominator%20%3C%200.0%20%26%26%20numerator%20%3C%20lower%20*%20denominator)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20lower%20%3D%20numerator%20%2F%20denominator%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20index%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20if%20(denominator%20%3E%200.0%20%26%26%20numerator%20%3C%20upper%20*%20denominator)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20upper%20%3D%20numerator%20%2F%20denominator%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(upper%20%3C%20lower%20-%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(index%20%3E%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20output.fraction%20%3D%20lower%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20transform.R%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_normals%5Bindex%5D%3B%0A%20%20%20%20%20%20%20%20output.normal.x%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20output.normal.y%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.ComputeAABB%20%3D%20function%20(aabb%2C%20xf)%20%7B%0A%20%20%20%20%20%20var%20tMat%20%3D%20xf.R%3B%0A%20%20%20%20%20%20var%20tVec%20%3D%20this.m_vertices%5B0%5D%3B%0A%20%20%20%20%20%20var%20lowerX%20%3D%20xf.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20lowerY%20%3D%20xf.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20upperX%20%3D%20lowerX%3B%0A%20%20%20%20%20%20var%20upperY%20%3D%20lowerY%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20vX%20%3D%20xf.position.x%20%2B%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20var%20vY%20%3D%20xf.position.y%20%2B%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20lowerX%20%3D%20lowerX%20%3C%20vX%20%3F%20lowerX%20%3A%20vX%3B%0A%20%20%20%20%20%20%20%20lowerY%20%3D%20lowerY%20%3C%20vY%20%3F%20lowerY%20%3A%20vY%3B%0A%20%20%20%20%20%20%20%20upperX%20%3D%20upperX%20%3E%20vX%20%3F%20upperX%20%3A%20vX%3B%0A%20%20%20%20%20%20%20%20upperY%20%3D%20upperY%20%3E%20vY%20%3F%20upperY%20%3A%20vY%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20aabb.lowerBound.x%20%3D%20lowerX%20-%20this.m_radius%3B%0A%20%20%20%20%20%20aabb.lowerBound.y%20%3D%20lowerY%20-%20this.m_radius%3B%0A%20%20%20%20%20%20aabb.upperBound.x%20%3D%20upperX%20%2B%20this.m_radius%3B%0A%20%20%20%20%20%20aabb.upperBound.y%20%3D%20upperY%20%2B%20this.m_radius%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.ComputeMass%20%3D%20function%20(massData%2C%20density)%20%7B%0A%20%20%20%20%20%20if%20(density%20%3D%3D%3D%20undefined)%20density%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_vertexCount%20%3D%3D%202)%20%7B%0A%20%20%20%20%20%20%20%20massData.center.x%20%3D%200.5%20*%20(this.m_vertices%5B0%5D.x%20%2B%20this.m_vertices%5B1%5D.x)%3B%0A%20%20%20%20%20%20%20%20massData.center.y%20%3D%200.5%20*%20(this.m_vertices%5B0%5D.y%20%2B%20this.m_vertices%5B1%5D.y)%3B%0A%20%20%20%20%20%20%20%20massData.mass%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20massData.I%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20centerX%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20centerY%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20area%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20I%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20k_inv3%20%3D%201.0%20%2F%203.0%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20p2%20%3D%20this.m_vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20p3%20%3D%0A%20%20%20%20%20%20%20%20%20%20i%20%2B%201%20%3C%20this.m_vertexCount%0A%20%20%20%20%20%20%20%20%20%20%20%20%3F%20this.m_vertices%5BparseInt(i%20%2B%201)%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%3A%20this.m_vertices%5B0%5D%3B%0A%20%20%20%20%20%20%20%20var%20e1X%20%3D%20p2.x%20-%20p1X%3B%0A%20%20%20%20%20%20%20%20var%20e1Y%20%3D%20p2.y%20-%20p1Y%3B%0A%20%20%20%20%20%20%20%20var%20e2X%20%3D%20p3.x%20-%20p1X%3B%0A%20%20%20%20%20%20%20%20var%20e2Y%20%3D%20p3.y%20-%20p1Y%3B%0A%20%20%20%20%20%20%20%20var%20D%20%3D%20e1X%20*%20e2Y%20-%20e1Y%20*%20e2X%3B%0A%20%20%20%20%20%20%20%20var%20triangleArea%20%3D%200.5%20*%20D%3B%0A%20%20%20%20%20%20%20%20area%20%2B%3D%20triangleArea%3B%0A%20%20%20%20%20%20%20%20centerX%20%2B%3D%20triangleArea%20*%20k_inv3%20*%20(p1X%20%2B%20p2.x%20%2B%20p3.x)%3B%0A%20%20%20%20%20%20%20%20centerY%20%2B%3D%20triangleArea%20*%20k_inv3%20*%20(p1Y%20%2B%20p2.y%20%2B%20p3.y)%3B%0A%20%20%20%20%20%20%20%20var%20px%20%3D%20p1X%3B%0A%20%20%20%20%20%20%20%20var%20py%20%3D%20p1Y%3B%0A%20%20%20%20%20%20%20%20var%20ex1%20%3D%20e1X%3B%0A%20%20%20%20%20%20%20%20var%20ey1%20%3D%20e1Y%3B%0A%20%20%20%20%20%20%20%20var%20ex2%20%3D%20e2X%3B%0A%20%20%20%20%20%20%20%20var%20ey2%20%3D%20e2Y%3B%0A%20%20%20%20%20%20%20%20var%20intx2%20%3D%0A%20%20%20%20%20%20%20%20%20%20k_inv3%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20(0.25%20*%20(ex1%20*%20ex1%20%2B%20ex2%20*%20ex1%20%2B%20ex2%20*%20ex2)%20%2B%20(px%20*%20ex1%20%2B%20px%20*%20ex2))%20%2B%0A%20%20%20%20%20%20%20%20%20%200.5%20*%20px%20*%20px%3B%0A%20%20%20%20%20%20%20%20var%20inty2%20%3D%0A%20%20%20%20%20%20%20%20%20%20k_inv3%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20(0.25%20*%20(ey1%20*%20ey1%20%2B%20ey2%20*%20ey1%20%2B%20ey2%20*%20ey2)%20%2B%20(py%20*%20ey1%20%2B%20py%20*%20ey2))%20%2B%0A%20%20%20%20%20%20%20%20%20%200.5%20*%20py%20*%20py%3B%0A%20%20%20%20%20%20%20%20I%20%2B%3D%20D%20*%20(intx2%20%2B%20inty2)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20massData.mass%20%3D%20density%20*%20area%3B%0A%20%20%20%20%20%20centerX%20*%3D%201.0%20%2F%20area%3B%0A%20%20%20%20%20%20centerY%20*%3D%201.0%20%2F%20area%3B%0A%20%20%20%20%20%20massData.center.Set(centerX%2C%20centerY)%3B%0A%20%20%20%20%20%20massData.I%20%3D%20density%20*%20I%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.ComputeSubmergedArea%20%3D%20function%20(%0A%20%20%20%20%20%20normal%2C%0A%20%20%20%20%20%20offset%2C%0A%20%20%20%20%20%20xf%2C%0A%20%20%20%20%20%20c%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(offset%20%3D%3D%3D%20undefined)%20offset%20%3D%200%3B%0A%20%20%20%20%20%20var%20normalL%20%3D%20b2Math.MulTMV(xf.R%2C%20normal)%3B%0A%20%20%20%20%20%20var%20offsetL%20%3D%20offset%20-%20b2Math.Dot(normal%2C%20xf.position)%3B%0A%20%20%20%20%20%20var%20depths%20%3D%20new%20Vector_a2j_Number()%3B%0A%20%20%20%20%20%20var%20diveCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20intoIndex%20%3D%20parseInt(-1)%3B%0A%20%20%20%20%20%20var%20outoIndex%20%3D%20parseInt(-1)%3B%0A%20%20%20%20%20%20var%20lastSubmerged%20%3D%20false%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20depths%5Bi%5D%20%3D%20b2Math.Dot(normalL%2C%20this.m_vertices%5Bi%5D)%20-%20offsetL%3B%0A%20%20%20%20%20%20%20%20var%20isSubmerged%20%3D%20depths%5Bi%5D%20%3C%20-Number.MIN_VALUE%3B%0A%20%20%20%20%20%20%20%20if%20(i%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(isSubmerged)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(!lastSubmerged)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20intoIndex%20%3D%20i%20-%201%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20diveCount%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(lastSubmerged)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20outoIndex%20%3D%20i%20-%201%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20diveCount%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20lastSubmerged%20%3D%20isSubmerged%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20switch%20(diveCount)%20%7B%0A%20%20%20%20%20%20%20%20case%200%3A%0A%20%20%20%20%20%20%20%20%20%20if%20(lastSubmerged)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20md%20%3D%20new%20b2MassData()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.ComputeMass(md%2C%201)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20c.SetV(b2Math.MulX(xf%2C%20md.center))%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20md.mass%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%201%3A%0A%20%20%20%20%20%20%20%20%20%20if%20(intoIndex%20%3D%3D%20-1)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20intoIndex%20%3D%20this.m_vertexCount%20-%201%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20outoIndex%20%3D%20this.m_vertexCount%20-%201%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20intoIndex2%20%3D%20parseInt((intoIndex%20%2B%201)%20%25%20this.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20outoIndex2%20%3D%20parseInt((outoIndex%20%2B%201)%20%25%20this.m_vertexCount)%3B%0A%20%20%20%20%20%20var%20intoLamdda%20%3D%0A%20%20%20%20%20%20%20%20(0%20-%20depths%5BintoIndex%5D)%20%2F%20(depths%5BintoIndex2%5D%20-%20depths%5BintoIndex%5D)%3B%0A%20%20%20%20%20%20var%20outoLamdda%20%3D%0A%20%20%20%20%20%20%20%20(0%20-%20depths%5BoutoIndex%5D)%20%2F%20(depths%5BoutoIndex2%5D%20-%20depths%5BoutoIndex%5D)%3B%0A%20%20%20%20%20%20var%20intoVec%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20this.m_vertices%5BintoIndex%5D.x%20*%20(1%20-%20intoLamdda)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_vertices%5BintoIndex2%5D.x%20*%20intoLamdda%2C%0A%20%20%20%20%20%20%20%20this.m_vertices%5BintoIndex%5D.y%20*%20(1%20-%20intoLamdda)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_vertices%5BintoIndex2%5D.y%20*%20intoLamdda%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20outoVec%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20this.m_vertices%5BoutoIndex%5D.x%20*%20(1%20-%20outoLamdda)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_vertices%5BoutoIndex2%5D.x%20*%20outoLamdda%2C%0A%20%20%20%20%20%20%20%20this.m_vertices%5BoutoIndex%5D.y%20*%20(1%20-%20outoLamdda)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_vertices%5BoutoIndex2%5D.y%20*%20outoLamdda%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20area%20%3D%200%3B%0A%20%20%20%20%20%20var%20center%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20this.m_vertices%5BintoIndex2%5D%3B%0A%20%20%20%20%20%20var%20p3%3B%0A%20%20%20%20%20%20i%20%3D%20intoIndex2%3B%0A%20%20%20%20%20%20while%20(i%20!%3D%20outoIndex2)%20%7B%0A%20%20%20%20%20%20%20%20i%20%3D%20(i%20%2B%201)%20%25%20this.m_vertexCount%3B%0A%20%20%20%20%20%20%20%20if%20(i%20%3D%3D%20outoIndex2)%20p3%20%3D%20outoVec%3B%0A%20%20%20%20%20%20%20%20else%20p3%20%3D%20this.m_vertices%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20triangleArea%20%3D%0A%20%20%20%20%20%20%20%20%20%200.5%20*%0A%20%20%20%20%20%20%20%20%20%20((p2.x%20-%20intoVec.x)%20*%20(p3.y%20-%20intoVec.y)%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20(p2.y%20-%20intoVec.y)%20*%20(p3.x%20-%20intoVec.x))%3B%0A%20%20%20%20%20%20%20%20area%20%2B%3D%20triangleArea%3B%0A%20%20%20%20%20%20%20%20center.x%20%2B%3D%20(triangleArea%20*%20(intoVec.x%20%2B%20p2.x%20%2B%20p3.x))%20%2F%203%3B%0A%20%20%20%20%20%20%20%20center.y%20%2B%3D%20(triangleArea%20*%20(intoVec.y%20%2B%20p2.y%20%2B%20p3.y))%20%2F%203%3B%0A%20%20%20%20%20%20%20%20p2%20%3D%20p3%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20center.Multiply(1%20%2F%20area)%3B%0A%20%20%20%20%20%20c.SetV(b2Math.MulX(xf%2C%20center))%3B%0A%20%20%20%20%20%20return%20area%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.GetVertexCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_vertexCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.GetVertices%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_vertices%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.GetNormals%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_normals%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.GetSupport%20%3D%20function%20(d)%20%7B%0A%20%20%20%20%20%20var%20bestIndex%20%3D%200%3B%0A%20%20%20%20%20%20var%20bestValue%20%3D%20this.m_vertices%5B0%5D.x%20*%20d.x%20%2B%20this.m_vertices%5B0%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20value%20%3D%20this.m_vertices%5Bi%5D.x%20*%20d.x%20%2B%20this.m_vertices%5Bi%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20%20%20if%20(value%20%3E%20bestValue)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bestIndex%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%20%20bestValue%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20bestIndex%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.GetSupportVertex%20%3D%20function%20(d)%20%7B%0A%20%20%20%20%20%20var%20bestIndex%20%3D%200%3B%0A%20%20%20%20%20%20var%20bestValue%20%3D%20this.m_vertices%5B0%5D.x%20*%20d.x%20%2B%20this.m_vertices%5B0%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20this.m_vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20value%20%3D%20this.m_vertices%5Bi%5D.x%20*%20d.x%20%2B%20this.m_vertices%5Bi%5D.y%20*%20d.y%3B%0A%20%20%20%20%20%20%20%20if%20(value%20%3E%20bestValue)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bestIndex%20%3D%20i%3B%0A%20%20%20%20%20%20%20%20%20%20bestValue%20%3D%20value%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20this.m_vertices%5BbestIndex%5D%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.Validate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.b2PolygonShape%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2Shape.call(this)%3B%0A%20%20%20%20%20%20this.m_type%20%3D%20b2Shape.e_polygonShape%3B%0A%20%20%20%20%20%20this.m_centroid%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_vertices%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20this.m_normals%20%3D%20new%20Vector()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.prototype.Reserve%20%3D%20function%20(count)%20%7B%0A%20%20%20%20%20%20if%20(count%20%3D%3D%3D%20undefined)%20count%20%3D%200%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%20parseInt(this.m_vertices.length)%3B%20i%20%3C%20count%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.m_vertices%5Bi%5D%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20this.m_normals%5Bi%5D%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.ComputeCentroid%20%3D%20function%20(vs%2C%20count)%20%7B%0A%20%20%20%20%20%20if%20(count%20%3D%3D%3D%20undefined)%20count%20%3D%200%3B%0A%20%20%20%20%20%20var%20c%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20area%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20inv3%20%3D%201.0%20%2F%203.0%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20count%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20p2%20%3D%20vs%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20p3%20%3D%20i%20%2B%201%20%3C%20count%20%3F%20vs%5BparseInt(i%20%2B%201)%5D%20%3A%20vs%5B0%5D%3B%0A%20%20%20%20%20%20%20%20var%20e1X%20%3D%20p2.x%20-%20p1X%3B%0A%20%20%20%20%20%20%20%20var%20e1Y%20%3D%20p2.y%20-%20p1Y%3B%0A%20%20%20%20%20%20%20%20var%20e2X%20%3D%20p3.x%20-%20p1X%3B%0A%20%20%20%20%20%20%20%20var%20e2Y%20%3D%20p3.y%20-%20p1Y%3B%0A%20%20%20%20%20%20%20%20var%20D%20%3D%20e1X%20*%20e2Y%20-%20e1Y%20*%20e2X%3B%0A%20%20%20%20%20%20%20%20var%20triangleArea%20%3D%200.5%20*%20D%3B%0A%20%20%20%20%20%20%20%20area%20%2B%3D%20triangleArea%3B%0A%20%20%20%20%20%20%20%20c.x%20%2B%3D%20triangleArea%20*%20inv3%20*%20(p1X%20%2B%20p2.x%20%2B%20p3.x)%3B%0A%20%20%20%20%20%20%20%20c.y%20%2B%3D%20triangleArea%20*%20inv3%20*%20(p1Y%20%2B%20p2.y%20%2B%20p3.y)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20c.x%20*%3D%201.0%20%2F%20area%3B%0A%20%20%20%20%20%20c.y%20*%3D%201.0%20%2F%20area%3B%0A%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonShape.ComputeOBB%20%3D%20function%20(obb%2C%20vs%2C%20count)%20%7B%0A%20%20%20%20%20%20if%20(count%20%3D%3D%3D%20undefined)%20count%20%3D%200%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20p%20%3D%20new%20Vector(count%20%2B%201)%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20count%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20p%5Bi%5D%20%3D%20vs%5Bi%5D%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20p%5Bcount%5D%20%3D%20p%5B0%5D%3B%0A%20%20%20%20%20%20var%20minArea%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20for%20(i%20%3D%201%3B%20i%20%3C%3D%20count%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20root%20%3D%20p%5BparseInt(i%20-%201)%5D%3B%0A%20%20%20%20%20%20%20%20var%20uxX%20%3D%20p%5Bi%5D.x%20-%20root.x%3B%0A%20%20%20%20%20%20%20%20var%20uxY%20%3D%20p%5Bi%5D.y%20-%20root.y%3B%0A%20%20%20%20%20%20%20%20var%20length%20%3D%20Math.sqrt(uxX%20*%20uxX%20%2B%20uxY%20*%20uxY)%3B%0A%20%20%20%20%20%20%20%20uxX%20%2F%3D%20length%3B%0A%20%20%20%20%20%20%20%20uxY%20%2F%3D%20length%3B%0A%20%20%20%20%20%20%20%20var%20uyX%20%3D%20-uxY%3B%0A%20%20%20%20%20%20%20%20var%20uyY%20%3D%20uxX%3B%0A%20%20%20%20%20%20%20%20var%20lowerX%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20%20%20var%20lowerY%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20%20%20var%20upperX%20%3D%20-Number.MAX_VALUE%3B%0A%20%20%20%20%20%20%20%20var%20upperY%20%3D%20-Number.MAX_VALUE%3B%0A%20%20%20%20%20%20%20%20for%20(var%20j%20%3D%200%3B%20j%20%3C%20count%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20dX%20%3D%20p%5Bj%5D.x%20-%20root.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20dY%20%3D%20p%5Bj%5D.y%20-%20root.y%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rX%20%3D%20uxX%20*%20dX%20%2B%20uxY%20*%20dY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rY%20%3D%20uyX%20*%20dX%20%2B%20uyY%20*%20dY%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(rX%20%3C%20lowerX)%20lowerX%20%3D%20rX%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(rY%20%3C%20lowerY)%20lowerY%20%3D%20rY%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(rX%20%3E%20upperX)%20upperX%20%3D%20rX%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(rY%20%3E%20upperY)%20upperY%20%3D%20rY%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20area%20%3D%20(upperX%20-%20lowerX)%20*%20(upperY%20-%20lowerY)%3B%0A%20%20%20%20%20%20%20%20if%20(area%20%3C%200.95%20*%20minArea)%20%7B%0A%20%20%20%20%20%20%20%20%20%20minArea%20%3D%20area%3B%0A%20%20%20%20%20%20%20%20%20%20obb.R.col1.x%20%3D%20uxX%3B%0A%20%20%20%20%20%20%20%20%20%20obb.R.col1.y%20%3D%20uxY%3B%0A%20%20%20%20%20%20%20%20%20%20obb.R.col2.x%20%3D%20uyX%3B%0A%20%20%20%20%20%20%20%20%20%20obb.R.col2.y%20%3D%20uyY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20centerX%20%3D%200.5%20*%20(lowerX%20%2B%20upperX)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20centerY%20%3D%200.5%20*%20(lowerY%20%2B%20upperY)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tMat%20%3D%20obb.R%3B%0A%20%20%20%20%20%20%20%20%20%20obb.center.x%20%3D%20root.x%20%2B%20(tMat.col1.x%20*%20centerX%20%2B%20tMat.col2.x%20*%20centerY)%3B%0A%20%20%20%20%20%20%20%20%20%20obb.center.y%20%3D%20root.y%20%2B%20(tMat.col1.y%20*%20centerX%20%2B%20tMat.col2.y%20*%20centerY)%3B%0A%20%20%20%20%20%20%20%20%20%20obb.extents.x%20%3D%200.5%20*%20(upperX%20-%20lowerX)%3B%0A%20%20%20%20%20%20%20%20%20%20obb.extents.y%20%3D%200.5%20*%20(upperY%20-%20lowerY)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2PolygonShape.s_mat%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2Shape.b2Shape%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Shape.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.Set%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20this.m_radius%20%3D%20other.m_radius%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.GetType%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_type%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.TestPoint%20%3D%20function%20(xf%2C%20p)%20%7B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.RayCast%20%3D%20function%20(output%2C%20input%2C%20transform)%20%7B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.ComputeAABB%20%3D%20function%20(aabb%2C%20xf)%20%7B%7D%3B%0A%20%20%20%20b2Shape.prototype.ComputeMass%20%3D%20function%20(massData%2C%20density)%20%7B%0A%20%20%20%20%20%20if%20(density%20%3D%3D%3D%20undefined)%20density%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.ComputeSubmergedArea%20%3D%20function%20(normal%2C%20offset%2C%20xf%2C%20c)%20%7B%0A%20%20%20%20%20%20if%20(offset%20%3D%3D%3D%20undefined)%20offset%20%3D%200%3B%0A%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.TestOverlap%20%3D%20function%20(shape1%2C%20transform1%2C%20shape2%2C%20transform2)%20%7B%0A%20%20%20%20%20%20var%20input%20%3D%20new%20b2DistanceInput()%3B%0A%20%20%20%20%20%20input.proxyA%20%3D%20new%20b2DistanceProxy()%3B%0A%20%20%20%20%20%20input.proxyA.Set(shape1)%3B%0A%20%20%20%20%20%20input.proxyB%20%3D%20new%20b2DistanceProxy()%3B%0A%20%20%20%20%20%20input.proxyB.Set(shape2)%3B%0A%20%20%20%20%20%20input.transformA%20%3D%20transform1%3B%0A%20%20%20%20%20%20input.transformB%20%3D%20transform2%3B%0A%20%20%20%20%20%20input.useRadii%20%3D%20true%3B%0A%20%20%20%20%20%20var%20simplexCache%20%3D%20new%20b2SimplexCache()%3B%0A%20%20%20%20%20%20simplexCache.count%20%3D%200%3B%0A%20%20%20%20%20%20var%20output%20%3D%20new%20b2DistanceOutput()%3B%0A%20%20%20%20%20%20b2Distance.Distance(output%2C%20simplexCache%2C%20input)%3B%0A%20%20%20%20%20%20return%20output.distance%20%3C%2010.0%20*%20Number.MIN_VALUE%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Shape.prototype.b2Shape%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_type%20%3D%20b2Shape.e_unknownShape%3B%0A%20%20%20%20%20%20this.m_radius%20%3D%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_unknownShape%20%3D%20parseInt(-1)%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_circleShape%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_polygonShape%20%3D%201%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_edgeShape%20%3D%202%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount%20%3D%203%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_hitCollide%20%3D%201%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_missCollide%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide%20%3D%20parseInt(-1)%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%3B%0A%0A%20%20%20%20b2Color.b2Color%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this._r%20%3D%200%3B%0A%20%20%20%20%20%20this._g%20%3D%200%3B%0A%20%20%20%20%20%20this._b%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Color.prototype.b2Color%20%3D%20function%20(rr%2C%20gg%2C%20bb)%20%7B%0A%20%20%20%20%20%20if%20(rr%20%3D%3D%3D%20undefined)%20rr%20%3D%200%3B%0A%20%20%20%20%20%20if%20(gg%20%3D%3D%3D%20undefined)%20gg%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bb%20%3D%3D%3D%20undefined)%20bb%20%3D%200%3B%0A%20%20%20%20%20%20this._r%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(rr%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20this._g%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(gg%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20this._b%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(bb%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Color.prototype.Set%20%3D%20function%20(rr%2C%20gg%2C%20bb)%20%7B%0A%20%20%20%20%20%20if%20(rr%20%3D%3D%3D%20undefined)%20rr%20%3D%200%3B%0A%20%20%20%20%20%20if%20(gg%20%3D%3D%3D%20undefined)%20gg%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bb%20%3D%3D%3D%20undefined)%20bb%20%3D%200%3B%0A%20%20%20%20%20%20this._r%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(rr%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20this._g%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(gg%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20this._b%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(bb%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Object.defineProperty(b2Color.prototype%2C%20%22r%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(rr)%20%7B%0A%20%20%20%20%20%20%20%20if%20(rr%20%3D%3D%3D%20undefined)%20rr%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._r%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(rr%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(b2Color.prototype%2C%20%22g%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(gg)%20%7B%0A%20%20%20%20%20%20%20%20if%20(gg%20%3D%3D%3D%20undefined)%20gg%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._g%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(gg%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(b2Color.prototype%2C%20%22b%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20set%3A%20function%20(bb)%20%7B%0A%20%20%20%20%20%20%20%20if%20(bb%20%3D%3D%3D%20undefined)%20bb%20%3D%200%3B%0A%20%20%20%20%20%20%20%20this._b%20%3D%20Box2D.parseUInt(255%20*%20b2Math.Clamp(bb%2C%200.0%2C%201.0))%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Object.defineProperty(b2Color.prototype%2C%20%22color%22%2C%20%7B%0A%20%20%20%20%20%20enumerable%3A%20false%2C%0A%20%20%20%20%20%20configurable%3A%20true%2C%0A%20%20%20%20%20%20get%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20return%20(this._r%20%3C%3C%2016)%20%7C%20(this._g%20%3C%3C%208)%20%7C%20this._b%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2Settings.b2Settings%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Settings.b2MixFriction%20%3D%20function%20(friction1%2C%20friction2)%20%7B%0A%20%20%20%20%20%20if%20(friction1%20%3D%3D%3D%20undefined)%20friction1%20%3D%200%3B%0A%20%20%20%20%20%20if%20(friction2%20%3D%3D%3D%20undefined)%20friction2%20%3D%200%3B%0A%20%20%20%20%20%20return%20Math.sqrt(friction1%20*%20friction2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Settings.b2MixRestitution%20%3D%20function%20(restitution1%2C%20restitution2)%20%7B%0A%20%20%20%20%20%20if%20(restitution1%20%3D%3D%3D%20undefined)%20restitution1%20%3D%200%3B%0A%20%20%20%20%20%20if%20(restitution2%20%3D%3D%3D%20undefined)%20restitution2%20%3D%200%3B%0A%20%20%20%20%20%20return%20restitution1%20%3E%20restitution2%20%3F%20restitution1%20%3A%20restitution2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Settings.b2Assert%20%3D%20function%20(a)%20%7B%0A%20%20%20%20%20%20if%20(!a)%20%7B%0A%20%20%20%20%20%20%20%20throw%20%22Assertion%20Failed%22%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.VERSION%20%3D%20%222.1alpha%22%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.USHRT_MAX%20%3D%200x0000ffff%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_pi%20%3D%20Math.PI%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxManifoldPoints%20%3D%202%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_aabbExtension%20%3D%200.1%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_aabbMultiplier%20%3D%202.0%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_polygonRadius%20%3D%202.0%20*%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_linearSlop%20%3D%200.005%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_angularSlop%20%3D%20(2.0%20%2F%20180.0)%20*%20b2Settings.b2_pi%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_toiSlop%20%3D%208.0%20*%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland%20%3D%2032%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland%20%3D%2032%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_velocityThreshold%20%3D%201.0%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxLinearCorrection%20%3D%200.2%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxAngularCorrection%20%3D%0A%20%20%20%20%20%20%20%20(8.0%20%2F%20180.0)%20*%20b2Settings.b2_pi%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxTranslation%20%3D%202.0%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxTranslationSquared%20%3D%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxTranslation%20*%20b2Settings.b2_maxTranslation%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxRotation%20%3D%200.5%20*%20b2Settings.b2_pi%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_maxRotationSquared%20%3D%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxRotation%20*%20b2Settings.b2_maxRotation%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_contactBaumgarte%20%3D%200.2%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_timeToSleep%20%3D%200.5%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_linearSleepTolerance%20%3D%200.01%3B%0A%20%20%20%20%20%20Box2D.Common.b2Settings.b2_angularSleepTolerance%20%3D%0A%20%20%20%20%20%20%20%20(2.0%20%2F%20180.0)%20*%20b2Settings.b2_pi%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2AABB%20%3D%20Box2D.Collision.b2AABB%2C%0A%20%20%20%20%20%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%3B%0A%0A%20%20%20%20b2Mat22.b2Mat22%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.col2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.b2Mat22%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.SetIdentity()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.FromAngle%20%3D%20function%20(angle)%20%7B%0A%20%20%20%20%20%20if%20(angle%20%3D%3D%3D%20undefined)%20angle%20%3D%200%3B%0A%20%20%20%20%20%20var%20mat%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20mat.Set(angle)%3B%0A%20%20%20%20%20%20return%20mat%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.FromVV%20%3D%20function%20(c1%2C%20c2)%20%7B%0A%20%20%20%20%20%20var%20mat%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20mat.SetVV(c1%2C%20c2)%3B%0A%20%20%20%20%20%20return%20mat%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.Set%20%3D%20function%20(angle)%20%7B%0A%20%20%20%20%20%20if%20(angle%20%3D%3D%3D%20undefined)%20angle%20%3D%200%3B%0A%20%20%20%20%20%20var%20c%20%3D%20Math.cos(angle)%3B%0A%20%20%20%20%20%20var%20s%20%3D%20Math.sin(angle)%3B%0A%20%20%20%20%20%20this.col1.x%20%3D%20c%3B%0A%20%20%20%20%20%20this.col2.x%20%3D%20-s%3B%0A%20%20%20%20%20%20this.col1.y%20%3D%20s%3B%0A%20%20%20%20%20%20this.col2.y%20%3D%20c%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.SetVV%20%3D%20function%20(c1%2C%20c2)%20%7B%0A%20%20%20%20%20%20this.col1.SetV(c1)%3B%0A%20%20%20%20%20%20this.col2.SetV(c2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20mat%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20mat.SetM(this)%3B%0A%20%20%20%20%20%20return%20mat%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.SetM%20%3D%20function%20(m)%20%7B%0A%20%20%20%20%20%20this.col1.SetV(m.col1)%3B%0A%20%20%20%20%20%20this.col2.SetV(m.col2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.AddM%20%3D%20function%20(m)%20%7B%0A%20%20%20%20%20%20this.col1.x%20%2B%3D%20m.col1.x%3B%0A%20%20%20%20%20%20this.col1.y%20%2B%3D%20m.col1.y%3B%0A%20%20%20%20%20%20this.col2.x%20%2B%3D%20m.col2.x%3B%0A%20%20%20%20%20%20this.col2.y%20%2B%3D%20m.col2.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.SetIdentity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1.x%20%3D%201.0%3B%0A%20%20%20%20%20%20this.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.y%20%3D%201.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.SetZero%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.y%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.GetAngle%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20Math.atan2(this.col1.y%2C%20this.col1.x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.GetInverse%20%3D%20function%20(out)%20%7B%0A%20%20%20%20%20%20var%20a%20%3D%20this.col1.x%3B%0A%20%20%20%20%20%20var%20b%20%3D%20this.col2.x%3B%0A%20%20%20%20%20%20var%20c%20%3D%20this.col1.y%3B%0A%20%20%20%20%20%20var%20d%20%3D%20this.col2.y%3B%0A%20%20%20%20%20%20var%20det%20%3D%20a%20*%20d%20-%20b%20*%20c%3B%0A%20%20%20%20%20%20if%20(det%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20det%20%3D%201.0%20%2F%20det%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20out.col1.x%20%3D%20det%20*%20d%3B%0A%20%20%20%20%20%20out.col2.x%20%3D%20-det%20*%20b%3B%0A%20%20%20%20%20%20out.col1.y%20%3D%20-det%20*%20c%3B%0A%20%20%20%20%20%20out.col2.y%20%3D%20det%20*%20a%3B%0A%20%20%20%20%20%20return%20out%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.Solve%20%3D%20function%20(out%2C%20bX%2C%20bY)%20%7B%0A%20%20%20%20%20%20if%20(bX%20%3D%3D%3D%20undefined)%20bX%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bY%20%3D%3D%3D%20undefined)%20bY%20%3D%200%3B%0A%20%20%20%20%20%20var%20a11%20%3D%20this.col1.x%3B%0A%20%20%20%20%20%20var%20a12%20%3D%20this.col2.x%3B%0A%20%20%20%20%20%20var%20a21%20%3D%20this.col1.y%3B%0A%20%20%20%20%20%20var%20a22%20%3D%20this.col2.y%3B%0A%20%20%20%20%20%20var%20det%20%3D%20a11%20*%20a22%20-%20a12%20*%20a21%3B%0A%20%20%20%20%20%20if%20(det%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20det%20%3D%201.0%20%2F%20det%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20out.x%20%3D%20det%20*%20(a22%20*%20bX%20-%20a12%20*%20bY)%3B%0A%20%20%20%20%20%20out.y%20%3D%20det%20*%20(a11%20*%20bY%20-%20a21%20*%20bX)%3B%0A%20%20%20%20%20%20return%20out%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat22.prototype.Abs%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1.Abs()%3B%0A%20%20%20%20%20%20this.col2.Abs()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.b2Mat33%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.col2%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.col3%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.b2Mat33%20%3D%20function%20(c1%2C%20c2%2C%20c3)%20%7B%0A%20%20%20%20%20%20if%20(c1%20%3D%3D%3D%20undefined)%20c1%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(c2%20%3D%3D%3D%20undefined)%20c2%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(c3%20%3D%3D%3D%20undefined)%20c3%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(!c1%20%26%26%20!c2%20%26%26%20!c3)%20%7B%0A%20%20%20%20%20%20%20%20this.col1.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.col2.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.col3.SetZero()%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.col1.SetV(c1)%3B%0A%20%20%20%20%20%20%20%20this.col2.SetV(c2)%3B%0A%20%20%20%20%20%20%20%20this.col3.SetV(c3)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.SetVVV%20%3D%20function%20(c1%2C%20c2%2C%20c3)%20%7B%0A%20%20%20%20%20%20this.col1.SetV(c1)%3B%0A%20%20%20%20%20%20this.col2.SetV(c2)%3B%0A%20%20%20%20%20%20this.col3.SetV(c3)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Mat33(this.col1%2C%20this.col2%2C%20this.col3)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.SetM%20%3D%20function%20(m)%20%7B%0A%20%20%20%20%20%20this.col1.SetV(m.col1)%3B%0A%20%20%20%20%20%20this.col2.SetV(m.col2)%3B%0A%20%20%20%20%20%20this.col3.SetV(m.col3)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.AddM%20%3D%20function%20(m)%20%7B%0A%20%20%20%20%20%20this.col1.x%20%2B%3D%20m.col1.x%3B%0A%20%20%20%20%20%20this.col1.y%20%2B%3D%20m.col1.y%3B%0A%20%20%20%20%20%20this.col1.z%20%2B%3D%20m.col1.z%3B%0A%20%20%20%20%20%20this.col2.x%20%2B%3D%20m.col2.x%3B%0A%20%20%20%20%20%20this.col2.y%20%2B%3D%20m.col2.y%3B%0A%20%20%20%20%20%20this.col2.z%20%2B%3D%20m.col2.z%3B%0A%20%20%20%20%20%20this.col3.x%20%2B%3D%20m.col3.x%3B%0A%20%20%20%20%20%20this.col3.y%20%2B%3D%20m.col3.y%3B%0A%20%20%20%20%20%20this.col3.z%20%2B%3D%20m.col3.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.SetIdentity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1.x%20%3D%201.0%3B%0A%20%20%20%20%20%20this.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col3.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.y%20%3D%201.0%3B%0A%20%20%20%20%20%20this.col3.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col1.z%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.z%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col3.z%20%3D%201.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.SetZero%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.col1.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col3.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col3.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col1.z%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col2.z%20%3D%200.0%3B%0A%20%20%20%20%20%20this.col3.z%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.Solve22%20%3D%20function%20(out%2C%20bX%2C%20bY)%20%7B%0A%20%20%20%20%20%20if%20(bX%20%3D%3D%3D%20undefined)%20bX%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bY%20%3D%3D%3D%20undefined)%20bY%20%3D%200%3B%0A%20%20%20%20%20%20var%20a11%20%3D%20this.col1.x%3B%0A%20%20%20%20%20%20var%20a12%20%3D%20this.col2.x%3B%0A%20%20%20%20%20%20var%20a21%20%3D%20this.col1.y%3B%0A%20%20%20%20%20%20var%20a22%20%3D%20this.col2.y%3B%0A%20%20%20%20%20%20var%20det%20%3D%20a11%20*%20a22%20-%20a12%20*%20a21%3B%0A%20%20%20%20%20%20if%20(det%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20det%20%3D%201.0%20%2F%20det%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20out.x%20%3D%20det%20*%20(a22%20*%20bX%20-%20a12%20*%20bY)%3B%0A%20%20%20%20%20%20out.y%20%3D%20det%20*%20(a11%20*%20bY%20-%20a21%20*%20bX)%3B%0A%20%20%20%20%20%20return%20out%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Mat33.prototype.Solve33%20%3D%20function%20(out%2C%20bX%2C%20bY%2C%20bZ)%20%7B%0A%20%20%20%20%20%20if%20(bX%20%3D%3D%3D%20undefined)%20bX%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bY%20%3D%3D%3D%20undefined)%20bY%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bZ%20%3D%3D%3D%20undefined)%20bZ%20%3D%200%3B%0A%20%20%20%20%20%20var%20a11%20%3D%20this.col1.x%3B%0A%20%20%20%20%20%20var%20a21%20%3D%20this.col1.y%3B%0A%20%20%20%20%20%20var%20a31%20%3D%20this.col1.z%3B%0A%20%20%20%20%20%20var%20a12%20%3D%20this.col2.x%3B%0A%20%20%20%20%20%20var%20a22%20%3D%20this.col2.y%3B%0A%20%20%20%20%20%20var%20a32%20%3D%20this.col2.z%3B%0A%20%20%20%20%20%20var%20a13%20%3D%20this.col3.x%3B%0A%20%20%20%20%20%20var%20a23%20%3D%20this.col3.y%3B%0A%20%20%20%20%20%20var%20a33%20%3D%20this.col3.z%3B%0A%20%20%20%20%20%20var%20det%20%3D%0A%20%20%20%20%20%20%20%20a11%20*%20(a22%20*%20a33%20-%20a32%20*%20a23)%20%2B%0A%20%20%20%20%20%20%20%20a21%20*%20(a32%20*%20a13%20-%20a12%20*%20a33)%20%2B%0A%20%20%20%20%20%20%20%20a31%20*%20(a12%20*%20a23%20-%20a22%20*%20a13)%3B%0A%20%20%20%20%20%20if%20(det%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20det%20%3D%201.0%20%2F%20det%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20out.x%20%3D%0A%20%20%20%20%20%20%20%20det%20*%0A%20%20%20%20%20%20%20%20(bX%20*%20(a22%20*%20a33%20-%20a32%20*%20a23)%20%2B%0A%20%20%20%20%20%20%20%20%20%20bY%20*%20(a32%20*%20a13%20-%20a12%20*%20a33)%20%2B%0A%20%20%20%20%20%20%20%20%20%20bZ%20*%20(a12%20*%20a23%20-%20a22%20*%20a13))%3B%0A%20%20%20%20%20%20out.y%20%3D%0A%20%20%20%20%20%20%20%20det%20*%0A%20%20%20%20%20%20%20%20(a11%20*%20(bY%20*%20a33%20-%20bZ%20*%20a23)%20%2B%0A%20%20%20%20%20%20%20%20%20%20a21%20*%20(bZ%20*%20a13%20-%20bX%20*%20a33)%20%2B%0A%20%20%20%20%20%20%20%20%20%20a31%20*%20(bX%20*%20a23%20-%20bY%20*%20a13))%3B%0A%20%20%20%20%20%20out.z%20%3D%0A%20%20%20%20%20%20%20%20det%20*%0A%20%20%20%20%20%20%20%20(a11%20*%20(a22%20*%20bZ%20-%20a32%20*%20bY)%20%2B%0A%20%20%20%20%20%20%20%20%20%20a21%20*%20(a32%20*%20bX%20-%20a12%20*%20bZ)%20%2B%0A%20%20%20%20%20%20%20%20%20%20a31%20*%20(a12%20*%20bY%20-%20a22%20*%20bX))%3B%0A%20%20%20%20%20%20return%20out%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.b2Math%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Math.IsValid%20%3D%20function%20(x)%20%7B%0A%20%20%20%20%20%20if%20(x%20%3D%3D%3D%20undefined)%20x%20%3D%200%3B%0A%20%20%20%20%20%20return%20isFinite(x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Dot%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20return%20a.x%20*%20b.x%20%2B%20a.y%20*%20b.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.CrossVV%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20return%20a.x%20*%20b.y%20-%20a.y%20*%20b.x%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.CrossVF%20%3D%20function%20(a%2C%20s)%20%7B%0A%20%20%20%20%20%20if%20(s%20%3D%3D%3D%20undefined)%20s%20%3D%200%3B%0A%20%20%20%20%20%20var%20v%20%3D%20new%20b2Vec2(s%20*%20a.y%2C%20-s%20*%20a.x)%3B%0A%20%20%20%20%20%20return%20v%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.CrossFV%20%3D%20function%20(s%2C%20a)%20%7B%0A%20%20%20%20%20%20if%20(s%20%3D%3D%3D%20undefined)%20s%20%3D%200%3B%0A%20%20%20%20%20%20var%20v%20%3D%20new%20b2Vec2(-s%20*%20a.y%2C%20s%20*%20a.x)%3B%0A%20%20%20%20%20%20return%20v%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulMV%20%3D%20function%20(A%2C%20v)%20%7B%0A%20%20%20%20%20%20var%20u%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20A.col1.x%20*%20v.x%20%2B%20A.col2.x%20*%20v.y%2C%0A%20%20%20%20%20%20%20%20A.col1.y%20*%20v.x%20%2B%20A.col2.y%20*%20v.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20return%20u%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulTMV%20%3D%20function%20(A%2C%20v)%20%7B%0A%20%20%20%20%20%20var%20u%20%3D%20new%20b2Vec2(b2Math.Dot(v%2C%20A.col1)%2C%20b2Math.Dot(v%2C%20A.col2))%3B%0A%20%20%20%20%20%20return%20u%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulX%20%3D%20function%20(T%2C%20v)%20%7B%0A%20%20%20%20%20%20var%20a%20%3D%20b2Math.MulMV(T.R%2C%20v)%3B%0A%20%20%20%20%20%20a.x%20%2B%3D%20T.position.x%3B%0A%20%20%20%20%20%20a.y%20%2B%3D%20T.position.y%3B%0A%20%20%20%20%20%20return%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulXT%20%3D%20function%20(T%2C%20v)%20%7B%0A%20%20%20%20%20%20var%20a%20%3D%20b2Math.SubtractVV(v%2C%20T.position)%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20a.x%20*%20T.R.col1.x%20%2B%20a.y%20*%20T.R.col1.y%3B%0A%20%20%20%20%20%20a.y%20%3D%20a.x%20*%20T.R.col2.x%20%2B%20a.y%20*%20T.R.col2.y%3B%0A%20%20%20%20%20%20a.x%20%3D%20tX%3B%0A%20%20%20%20%20%20return%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.AddVV%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20v%20%3D%20new%20b2Vec2(a.x%20%2B%20b.x%2C%20a.y%20%2B%20b.y)%3B%0A%20%20%20%20%20%20return%20v%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.SubtractVV%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20v%20%3D%20new%20b2Vec2(a.x%20-%20b.x%2C%20a.y%20-%20b.y)%3B%0A%20%20%20%20%20%20return%20v%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Distance%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20cX%20%3D%20a.x%20-%20b.x%3B%0A%20%20%20%20%20%20var%20cY%20%3D%20a.y%20-%20b.y%3B%0A%20%20%20%20%20%20return%20Math.sqrt(cX%20*%20cX%20%2B%20cY%20*%20cY)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.DistanceSquared%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20cX%20%3D%20a.x%20-%20b.x%3B%0A%20%20%20%20%20%20var%20cY%20%3D%20a.y%20-%20b.y%3B%0A%20%20%20%20%20%20return%20cX%20*%20cX%20%2B%20cY%20*%20cY%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulFV%20%3D%20function%20(s%2C%20a)%20%7B%0A%20%20%20%20%20%20if%20(s%20%3D%3D%3D%20undefined)%20s%20%3D%200%3B%0A%20%20%20%20%20%20var%20v%20%3D%20new%20b2Vec2(s%20*%20a.x%2C%20s%20*%20a.y)%3B%0A%20%20%20%20%20%20return%20v%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.AddMM%20%3D%20function%20(A%2C%20B)%20%7B%0A%20%20%20%20%20%20var%20C%20%3D%20b2Mat22.FromVV(%0A%20%20%20%20%20%20%20%20b2Math.AddVV(A.col1%2C%20B.col1)%2C%0A%20%20%20%20%20%20%20%20b2Math.AddVV(A.col2%2C%20B.col2)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20return%20C%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulMM%20%3D%20function%20(A%2C%20B)%20%7B%0A%20%20%20%20%20%20var%20C%20%3D%20b2Mat22.FromVV(b2Math.MulMV(A%2C%20B.col1)%2C%20b2Math.MulMV(A%2C%20B.col2))%3B%0A%20%20%20%20%20%20return%20C%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MulTMM%20%3D%20function%20(A%2C%20B)%20%7B%0A%20%20%20%20%20%20var%20c1%20%3D%20new%20b2Vec2(b2Math.Dot(A.col1%2C%20B.col1)%2C%20b2Math.Dot(A.col2%2C%20B.col1))%3B%0A%20%20%20%20%20%20var%20c2%20%3D%20new%20b2Vec2(b2Math.Dot(A.col1%2C%20B.col2)%2C%20b2Math.Dot(A.col2%2C%20B.col2))%3B%0A%20%20%20%20%20%20var%20C%20%3D%20b2Mat22.FromVV(c1%2C%20c2)%3B%0A%20%20%20%20%20%20return%20C%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Abs%20%3D%20function%20(a)%20%7B%0A%20%20%20%20%20%20if%20(a%20%3D%3D%3D%20undefined)%20a%20%3D%200%3B%0A%20%20%20%20%20%20return%20a%20%3E%200.0%20%3F%20a%20%3A%20-a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.AbsV%20%3D%20function%20(a)%20%7B%0A%20%20%20%20%20%20var%20b%20%3D%20new%20b2Vec2(b2Math.Abs(a.x)%2C%20b2Math.Abs(a.y))%3B%0A%20%20%20%20%20%20return%20b%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.AbsM%20%3D%20function%20(A)%20%7B%0A%20%20%20%20%20%20var%20B%20%3D%20b2Mat22.FromVV(b2Math.AbsV(A.col1)%2C%20b2Math.AbsV(A.col2))%3B%0A%20%20%20%20%20%20return%20B%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Min%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20if%20(a%20%3D%3D%3D%20undefined)%20a%20%3D%200%3B%0A%20%20%20%20%20%20if%20(b%20%3D%3D%3D%20undefined)%20b%20%3D%200%3B%0A%20%20%20%20%20%20return%20a%20%3C%20b%20%3F%20a%20%3A%20b%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MinV%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20c%20%3D%20new%20b2Vec2(b2Math.Min(a.x%2C%20b.x)%2C%20b2Math.Min(a.y%2C%20b.y))%3B%0A%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Max%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20if%20(a%20%3D%3D%3D%20undefined)%20a%20%3D%200%3B%0A%20%20%20%20%20%20if%20(b%20%3D%3D%3D%20undefined)%20b%20%3D%200%3B%0A%20%20%20%20%20%20return%20a%20%3E%20b%20%3F%20a%20%3A%20b%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.MaxV%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20c%20%3D%20new%20b2Vec2(b2Math.Max(a.x%2C%20b.x)%2C%20b2Math.Max(a.y%2C%20b.y))%3B%0A%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Clamp%20%3D%20function%20(a%2C%20low%2C%20high)%20%7B%0A%20%20%20%20%20%20if%20(a%20%3D%3D%3D%20undefined)%20a%20%3D%200%3B%0A%20%20%20%20%20%20if%20(low%20%3D%3D%3D%20undefined)%20low%20%3D%200%3B%0A%20%20%20%20%20%20if%20(high%20%3D%3D%3D%20undefined)%20high%20%3D%200%3B%0A%20%20%20%20%20%20return%20a%20%3C%20low%20%3F%20low%20%3A%20a%20%3E%20high%20%3F%20high%20%3A%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.ClampV%20%3D%20function%20(a%2C%20low%2C%20high)%20%7B%0A%20%20%20%20%20%20return%20b2Math.MaxV(low%2C%20b2Math.MinV(a%2C%20high))%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Swap%20%3D%20function%20(a%2C%20b)%20%7B%0A%20%20%20%20%20%20var%20tmp%20%3D%20a%5B0%5D%3B%0A%20%20%20%20%20%20a%5B0%5D%20%3D%20b%5B0%5D%3B%0A%20%20%20%20%20%20b%5B0%5D%20%3D%20tmp%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.Random%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20Math.random()%20*%202%20-%201%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.RandomRange%20%3D%20function%20(lo%2C%20hi)%20%7B%0A%20%20%20%20%20%20if%20(lo%20%3D%3D%3D%20undefined)%20lo%20%3D%200%3B%0A%20%20%20%20%20%20if%20(hi%20%3D%3D%3D%20undefined)%20hi%20%3D%200%3B%0A%20%20%20%20%20%20var%20r%20%3D%20Math.random()%3B%0A%20%20%20%20%20%20r%20%3D%20(hi%20-%20lo)%20*%20r%20%2B%20lo%3B%0A%20%20%20%20%20%20return%20r%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.NextPowerOfTwo%20%3D%20function%20(x)%20%7B%0A%20%20%20%20%20%20if%20(x%20%3D%3D%3D%20undefined)%20x%20%3D%200%3B%0A%20%20%20%20%20%20x%20%7C%3D%20(x%20%3E%3E%201)%20%26%200x7fffffff%3B%0A%20%20%20%20%20%20x%20%7C%3D%20(x%20%3E%3E%202)%20%26%200x3fffffff%3B%0A%20%20%20%20%20%20x%20%7C%3D%20(x%20%3E%3E%204)%20%26%200x0fffffff%3B%0A%20%20%20%20%20%20x%20%7C%3D%20(x%20%3E%3E%208)%20%26%200x00ffffff%3B%0A%20%20%20%20%20%20x%20%7C%3D%20(x%20%3E%3E%2016)%20%26%200x0000ffff%3B%0A%20%20%20%20%20%20return%20x%20%2B%201%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Math.IsPowerOfTwo%20%3D%20function%20(x)%20%7B%0A%20%20%20%20%20%20if%20(x%20%3D%3D%3D%20undefined)%20x%20%3D%200%3B%0A%20%20%20%20%20%20var%20result%20%3D%20x%20%3E%200%20%26%26%20(x%20%26%20(x%20-%201))%20%3D%3D%200%3B%0A%20%20%20%20%20%20return%20result%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Common.Math.b2Math.b2Vec2_zero%20%3D%20new%20b2Vec2(0.0%2C%200.0)%3B%0A%20%20%20%20%20%20Box2D.Common.Math.b2Math.b2Mat22_identity%20%3D%20b2Mat22.FromVV(%0A%20%20%20%20%20%20%20%20new%20b2Vec2(1.0%2C%200.0)%2C%0A%20%20%20%20%20%20%20%20new%20b2Vec2(0.0%2C%201.0)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20Box2D.Common.Math.b2Math.b2Transform_identity%20%3D%20new%20b2Transform(%0A%20%20%20%20%20%20%20%20b2Math.b2Vec2_zero%2C%0A%20%20%20%20%20%20%20%20b2Math.b2Mat22_identity%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2Sweep.b2Sweep%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.localCenter%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.c0%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.c%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Sweep.prototype.Set%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20this.localCenter.SetV(other.localCenter)%3B%0A%20%20%20%20%20%20this.c0.SetV(other.c0)%3B%0A%20%20%20%20%20%20this.c.SetV(other.c)%3B%0A%20%20%20%20%20%20this.a0%20%3D%20other.a0%3B%0A%20%20%20%20%20%20this.a%20%3D%20other.a%3B%0A%20%20%20%20%20%20this.t0%20%3D%20other.t0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Sweep.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20copy%20%3D%20new%20b2Sweep()%3B%0A%20%20%20%20%20%20copy.localCenter.SetV(this.localCenter)%3B%0A%20%20%20%20%20%20copy.c0.SetV(this.c0)%3B%0A%20%20%20%20%20%20copy.c.SetV(this.c)%3B%0A%20%20%20%20%20%20copy.a0%20%3D%20this.a0%3B%0A%20%20%20%20%20%20copy.a%20%3D%20this.a%3B%0A%20%20%20%20%20%20copy.t0%20%3D%20this.t0%3B%0A%20%20%20%20%20%20return%20copy%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Sweep.prototype.GetTransform%20%3D%20function%20(xf%2C%20alpha)%20%7B%0A%20%20%20%20%20%20if%20(alpha%20%3D%3D%3D%20undefined)%20alpha%20%3D%200%3B%0A%20%20%20%20%20%20xf.position.x%20%3D%20(1.0%20-%20alpha)%20*%20this.c0.x%20%2B%20alpha%20*%20this.c.x%3B%0A%20%20%20%20%20%20xf.position.y%20%3D%20(1.0%20-%20alpha)%20*%20this.c0.y%20%2B%20alpha%20*%20this.c.y%3B%0A%20%20%20%20%20%20var%20angle%20%3D%20(1.0%20-%20alpha)%20*%20this.a0%20%2B%20alpha%20*%20this.a%3B%0A%20%20%20%20%20%20xf.R.Set(angle)%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20xf.R%3B%0A%20%20%20%20%20%20xf.position.x%20-%3D%0A%20%20%20%20%20%20%20%20tMat.col1.x%20*%20this.localCenter.x%20%2B%20tMat.col2.x%20*%20this.localCenter.y%3B%0A%20%20%20%20%20%20xf.position.y%20-%3D%0A%20%20%20%20%20%20%20%20tMat.col1.y%20*%20this.localCenter.x%20%2B%20tMat.col2.y%20*%20this.localCenter.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Sweep.prototype.Advance%20%3D%20function%20(t)%20%7B%0A%20%20%20%20%20%20if%20(t%20%3D%3D%3D%20undefined)%20t%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.t0%20%3C%20t%20%26%26%201.0%20-%20this.t0%20%3E%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20var%20alpha%20%3D%20(t%20-%20this.t0)%20%2F%20(1.0%20-%20this.t0)%3B%0A%20%20%20%20%20%20%20%20this.c0.x%20%3D%20(1.0%20-%20alpha)%20*%20this.c0.x%20%2B%20alpha%20*%20this.c.x%3B%0A%20%20%20%20%20%20%20%20this.c0.y%20%3D%20(1.0%20-%20alpha)%20*%20this.c0.y%20%2B%20alpha%20*%20this.c.y%3B%0A%20%20%20%20%20%20%20%20this.a0%20%3D%20(1.0%20-%20alpha)%20*%20this.a0%20%2B%20alpha%20*%20this.a%3B%0A%20%20%20%20%20%20%20%20this.t0%20%3D%20t%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Transform.b2Transform%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.position%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.R%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Transform.prototype.b2Transform%20%3D%20function%20(pos%2C%20r)%20%7B%0A%20%20%20%20%20%20if%20(pos%20%3D%3D%3D%20undefined)%20pos%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(r%20%3D%3D%3D%20undefined)%20r%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(pos)%20%7B%0A%20%20%20%20%20%20%20%20this.position.SetV(pos)%3B%0A%20%20%20%20%20%20%20%20this.R.SetM(r)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Transform.prototype.Initialize%20%3D%20function%20(pos%2C%20r)%20%7B%0A%20%20%20%20%20%20this.position.SetV(pos)%3B%0A%20%20%20%20%20%20this.R.SetM(r)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Transform.prototype.SetIdentity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.position.SetZero()%3B%0A%20%20%20%20%20%20this.R.SetIdentity()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Transform.prototype.Set%20%3D%20function%20(x)%20%7B%0A%20%20%20%20%20%20this.position.SetV(x.position)%3B%0A%20%20%20%20%20%20this.R.SetM(x.R)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Transform.prototype.GetAngle%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20Math.atan2(this.R.col1.y%2C%20this.R.col1.x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.b2Vec2%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Vec2.prototype.b2Vec2%20%3D%20function%20(x_%2C%20y_)%20%7B%0A%20%20%20%20%20%20if%20(x_%20%3D%3D%3D%20undefined)%20x_%20%3D%200%3B%0A%20%20%20%20%20%20if%20(y_%20%3D%3D%3D%20undefined)%20y_%20%3D%200%3B%0A%20%20%20%20%20%20this.x%20%3D%20x_%3B%0A%20%20%20%20%20%20this.y%20%3D%20y_%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.SetZero%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.y%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Set%20%3D%20function%20(x_%2C%20y_)%20%7B%0A%20%20%20%20%20%20if%20(x_%20%3D%3D%3D%20undefined)%20x_%20%3D%200%3B%0A%20%20%20%20%20%20if%20(y_%20%3D%3D%3D%20undefined)%20y_%20%3D%200%3B%0A%20%20%20%20%20%20this.x%20%3D%20x_%3B%0A%20%20%20%20%20%20this.y%20%3D%20y_%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.SetV%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20v.x%3B%0A%20%20%20%20%20%20this.y%20%3D%20v.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.GetNegative%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec2(-this.x%2C%20-this.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.NegativeSelf%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20-this.x%3B%0A%20%20%20%20%20%20this.y%20%3D%20-this.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.Make%20%3D%20function%20(x_%2C%20y_)%20%7B%0A%20%20%20%20%20%20if%20(x_%20%3D%3D%3D%20undefined)%20x_%20%3D%200%3B%0A%20%20%20%20%20%20if%20(y_%20%3D%3D%3D%20undefined)%20y_%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(x_%2C%20y_)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec2(this.x%2C%20this.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Add%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20this.x%20%2B%3D%20v.x%3B%0A%20%20%20%20%20%20this.y%20%2B%3D%20v.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Subtract%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20this.x%20-%3D%20v.x%3B%0A%20%20%20%20%20%20this.y%20-%3D%20v.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Multiply%20%3D%20function%20(a)%20%7B%0A%20%20%20%20%20%20if%20(a%20%3D%3D%3D%20undefined)%20a%20%3D%200%3B%0A%20%20%20%20%20%20this.x%20*%3D%20a%3B%0A%20%20%20%20%20%20this.y%20*%3D%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.MulM%20%3D%20function%20(A)%20%7B%0A%20%20%20%20%20%20var%20tX%20%3D%20this.x%3B%0A%20%20%20%20%20%20this.x%20%3D%20A.col1.x%20*%20tX%20%2B%20A.col2.x%20*%20this.y%3B%0A%20%20%20%20%20%20this.y%20%3D%20A.col1.y%20*%20tX%20%2B%20A.col2.y%20*%20this.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.MulTM%20%3D%20function%20(A)%20%7B%0A%20%20%20%20%20%20var%20tX%20%3D%20b2Math.Dot(this%2C%20A.col1)%3B%0A%20%20%20%20%20%20this.y%20%3D%20b2Math.Dot(this%2C%20A.col2)%3B%0A%20%20%20%20%20%20this.x%20%3D%20tX%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.CrossVF%20%3D%20function%20(s)%20%7B%0A%20%20%20%20%20%20if%20(s%20%3D%3D%3D%20undefined)%20s%20%3D%200%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20this.x%3B%0A%20%20%20%20%20%20this.x%20%3D%20s%20*%20this.y%3B%0A%20%20%20%20%20%20this.y%20%3D%20-s%20*%20tX%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.CrossFV%20%3D%20function%20(s)%20%7B%0A%20%20%20%20%20%20if%20(s%20%3D%3D%3D%20undefined)%20s%20%3D%200%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20this.x%3B%0A%20%20%20%20%20%20this.x%20%3D%20-s%20*%20this.y%3B%0A%20%20%20%20%20%20this.y%20%3D%20s%20*%20tX%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.MinV%20%3D%20function%20(b)%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20this.x%20%3C%20b.x%20%3F%20this.x%20%3A%20b.x%3B%0A%20%20%20%20%20%20this.y%20%3D%20this.y%20%3C%20b.y%20%3F%20this.y%20%3A%20b.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.MaxV%20%3D%20function%20(b)%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20this.x%20%3E%20b.x%20%3F%20this.x%20%3A%20b.x%3B%0A%20%20%20%20%20%20this.y%20%3D%20this.y%20%3E%20b.y%20%3F%20this.y%20%3A%20b.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Abs%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20if%20(this.x%20%3C%200)%20this.x%20%3D%20-this.x%3B%0A%20%20%20%20%20%20if%20(this.y%20%3C%200)%20this.y%20%3D%20-this.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Length%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20Math.sqrt(this.x%20*%20this.x%20%2B%20this.y%20*%20this.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.LengthSquared%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.x%20*%20this.x%20%2B%20this.y%20*%20this.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.Normalize%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20length%20%3D%20Math.sqrt(this.x%20*%20this.x%20%2B%20this.y%20*%20this.y)%3B%0A%20%20%20%20%20%20if%20(length%20%3C%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20invLength%20%3D%201.0%20%2F%20length%3B%0A%20%20%20%20%20%20this.x%20*%3D%20invLength%3B%0A%20%20%20%20%20%20this.y%20*%3D%20invLength%3B%0A%20%20%20%20%20%20return%20length%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec2.prototype.IsValid%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20b2Math.IsValid(this.x)%20%26%26%20b2Math.IsValid(this.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.b2Vec3%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Vec3.prototype.b2Vec3%20%3D%20function%20(x%2C%20y%2C%20z)%20%7B%0A%20%20%20%20%20%20if%20(x%20%3D%3D%3D%20undefined)%20x%20%3D%200%3B%0A%20%20%20%20%20%20if%20(y%20%3D%3D%3D%20undefined)%20y%20%3D%200%3B%0A%20%20%20%20%20%20if%20(z%20%3D%3D%3D%20undefined)%20z%20%3D%200%3B%0A%20%20%20%20%20%20this.x%20%3D%20x%3B%0A%20%20%20%20%20%20this.y%20%3D%20y%3B%0A%20%20%20%20%20%20this.z%20%3D%20z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.SetZero%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20this.y%20%3D%20this.z%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.Set%20%3D%20function%20(x%2C%20y%2C%20z)%20%7B%0A%20%20%20%20%20%20if%20(x%20%3D%3D%3D%20undefined)%20x%20%3D%200%3B%0A%20%20%20%20%20%20if%20(y%20%3D%3D%3D%20undefined)%20y%20%3D%200%3B%0A%20%20%20%20%20%20if%20(z%20%3D%3D%3D%20undefined)%20z%20%3D%200%3B%0A%20%20%20%20%20%20this.x%20%3D%20x%3B%0A%20%20%20%20%20%20this.y%20%3D%20y%3B%0A%20%20%20%20%20%20this.z%20%3D%20z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.SetV%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20v.x%3B%0A%20%20%20%20%20%20this.y%20%3D%20v.y%3B%0A%20%20%20%20%20%20this.z%20%3D%20v.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.GetNegative%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec3(-this.x%2C%20-this.y%2C%20-this.z)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.NegativeSelf%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.x%20%3D%20-this.x%3B%0A%20%20%20%20%20%20this.y%20%3D%20-this.y%3B%0A%20%20%20%20%20%20this.z%20%3D%20-this.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec3(this.x%2C%20this.y%2C%20this.z)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.Add%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20this.x%20%2B%3D%20v.x%3B%0A%20%20%20%20%20%20this.y%20%2B%3D%20v.y%3B%0A%20%20%20%20%20%20this.z%20%2B%3D%20v.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.Subtract%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20this.x%20-%3D%20v.x%3B%0A%20%20%20%20%20%20this.y%20-%3D%20v.y%3B%0A%20%20%20%20%20%20this.z%20-%3D%20v.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Vec3.prototype.Multiply%20%3D%20function%20(a)%20%7B%0A%20%20%20%20%20%20if%20(a%20%3D%3D%3D%20undefined)%20a%20%3D%200%3B%0A%20%20%20%20%20%20this.x%20*%3D%20a%3B%0A%20%20%20%20%20%20this.y%20*%3D%20a%3B%0A%20%20%20%20%20%20this.z%20*%3D%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2ControllerEdge%20%3D%20Box2D.Dynamics.Controllers.b2ControllerEdge%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%2C%0A%20%20%20%20%20%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2AABB%20%3D%20Box2D.Collision.b2AABB%2C%0A%20%20%20%20%20%20b2Bound%20%3D%20Box2D.Collision.b2Bound%2C%0A%20%20%20%20%20%20b2BoundValues%20%3D%20Box2D.Collision.b2BoundValues%2C%0A%20%20%20%20%20%20b2Collision%20%3D%20Box2D.Collision.b2Collision%2C%0A%20%20%20%20%20%20b2ContactID%20%3D%20Box2D.Collision.b2ContactID%2C%0A%20%20%20%20%20%20b2ContactPoint%20%3D%20Box2D.Collision.b2ContactPoint%2C%0A%20%20%20%20%20%20b2Distance%20%3D%20Box2D.Collision.b2Distance%2C%0A%20%20%20%20%20%20b2DistanceInput%20%3D%20Box2D.Collision.b2DistanceInput%2C%0A%20%20%20%20%20%20b2DistanceOutput%20%3D%20Box2D.Collision.b2DistanceOutput%2C%0A%20%20%20%20%20%20b2DistanceProxy%20%3D%20Box2D.Collision.b2DistanceProxy%2C%0A%20%20%20%20%20%20b2DynamicTree%20%3D%20Box2D.Collision.b2DynamicTree%2C%0A%20%20%20%20%20%20b2DynamicTreeBroadPhase%20%3D%20Box2D.Collision.b2DynamicTreeBroadPhase%2C%0A%20%20%20%20%20%20b2DynamicTreeNode%20%3D%20Box2D.Collision.b2DynamicTreeNode%2C%0A%20%20%20%20%20%20b2DynamicTreePair%20%3D%20Box2D.Collision.b2DynamicTreePair%2C%0A%20%20%20%20%20%20b2Manifold%20%3D%20Box2D.Collision.b2Manifold%2C%0A%20%20%20%20%20%20b2ManifoldPoint%20%3D%20Box2D.Collision.b2ManifoldPoint%2C%0A%20%20%20%20%20%20b2Point%20%3D%20Box2D.Collision.b2Point%2C%0A%20%20%20%20%20%20b2RayCastInput%20%3D%20Box2D.Collision.b2RayCastInput%2C%0A%20%20%20%20%20%20b2RayCastOutput%20%3D%20Box2D.Collision.b2RayCastOutput%2C%0A%20%20%20%20%20%20b2Segment%20%3D%20Box2D.Collision.b2Segment%2C%0A%20%20%20%20%20%20b2SeparationFunction%20%3D%20Box2D.Collision.b2SeparationFunction%2C%0A%20%20%20%20%20%20b2Simplex%20%3D%20Box2D.Collision.b2Simplex%2C%0A%20%20%20%20%20%20b2SimplexCache%20%3D%20Box2D.Collision.b2SimplexCache%2C%0A%20%20%20%20%20%20b2SimplexVertex%20%3D%20Box2D.Collision.b2SimplexVertex%2C%0A%20%20%20%20%20%20b2TimeOfImpact%20%3D%20Box2D.Collision.b2TimeOfImpact%2C%0A%20%20%20%20%20%20b2TOIInput%20%3D%20Box2D.Collision.b2TOIInput%2C%0A%20%20%20%20%20%20b2WorldManifold%20%3D%20Box2D.Collision.b2WorldManifold%2C%0A%20%20%20%20%20%20ClipVertex%20%3D%20Box2D.Collision.ClipVertex%2C%0A%20%20%20%20%20%20Features%20%3D%20Box2D.Collision.Features%2C%0A%20%20%20%20%20%20IBroadPhase%20%3D%20Box2D.Collision.IBroadPhase%2C%0A%20%20%20%20%20%20b2CircleShape%20%3D%20Box2D.Collision.Shapes.b2CircleShape%2C%0A%20%20%20%20%20%20b2EdgeChainDef%20%3D%20Box2D.Collision.Shapes.b2EdgeChainDef%2C%0A%20%20%20%20%20%20b2EdgeShape%20%3D%20Box2D.Collision.Shapes.b2EdgeShape%2C%0A%20%20%20%20%20%20b2MassData%20%3D%20Box2D.Collision.Shapes.b2MassData%2C%0A%20%20%20%20%20%20b2PolygonShape%20%3D%20Box2D.Collision.Shapes.b2PolygonShape%2C%0A%20%20%20%20%20%20b2Shape%20%3D%20Box2D.Collision.Shapes.b2Shape%2C%0A%20%20%20%20%20%20b2Body%20%3D%20Box2D.Dynamics.b2Body%2C%0A%20%20%20%20%20%20b2BodyDef%20%3D%20Box2D.Dynamics.b2BodyDef%2C%0A%20%20%20%20%20%20b2ContactFilter%20%3D%20Box2D.Dynamics.b2ContactFilter%2C%0A%20%20%20%20%20%20b2ContactImpulse%20%3D%20Box2D.Dynamics.b2ContactImpulse%2C%0A%20%20%20%20%20%20b2ContactListener%20%3D%20Box2D.Dynamics.b2ContactListener%2C%0A%20%20%20%20%20%20b2ContactManager%20%3D%20Box2D.Dynamics.b2ContactManager%2C%0A%20%20%20%20%20%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%2C%0A%20%20%20%20%20%20b2DestructionListener%20%3D%20Box2D.Dynamics.b2DestructionListener%2C%0A%20%20%20%20%20%20b2FilterData%20%3D%20Box2D.Dynamics.b2FilterData%2C%0A%20%20%20%20%20%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%2C%0A%20%20%20%20%20%20b2FixtureDef%20%3D%20Box2D.Dynamics.b2FixtureDef%2C%0A%20%20%20%20%20%20b2Island%20%3D%20Box2D.Dynamics.b2Island%2C%0A%20%20%20%20%20%20b2TimeStep%20%3D%20Box2D.Dynamics.b2TimeStep%2C%0A%20%20%20%20%20%20b2World%20%3D%20Box2D.Dynamics.b2World%2C%0A%20%20%20%20%20%20b2CircleContact%20%3D%20Box2D.Dynamics.Contacts.b2CircleContact%2C%0A%20%20%20%20%20%20b2Contact%20%3D%20Box2D.Dynamics.Contacts.b2Contact%2C%0A%20%20%20%20%20%20b2ContactConstraint%20%3D%20Box2D.Dynamics.Contacts.b2ContactConstraint%2C%0A%20%20%20%20%20%20b2ContactConstraintPoint%20%3D%20Box2D.Dynamics.Contacts.b2ContactConstraintPoint%2C%0A%20%20%20%20%20%20b2ContactEdge%20%3D%20Box2D.Dynamics.Contacts.b2ContactEdge%2C%0A%20%20%20%20%20%20b2ContactFactory%20%3D%20Box2D.Dynamics.Contacts.b2ContactFactory%2C%0A%20%20%20%20%20%20b2ContactRegister%20%3D%20Box2D.Dynamics.Contacts.b2ContactRegister%2C%0A%20%20%20%20%20%20b2ContactResult%20%3D%20Box2D.Dynamics.Contacts.b2ContactResult%2C%0A%20%20%20%20%20%20b2ContactSolver%20%3D%20Box2D.Dynamics.Contacts.b2ContactSolver%2C%0A%20%20%20%20%20%20b2EdgeAndCircleContact%20%3D%20Box2D.Dynamics.Contacts.b2EdgeAndCircleContact%2C%0A%20%20%20%20%20%20b2NullContact%20%3D%20Box2D.Dynamics.Contacts.b2NullContact%2C%0A%20%20%20%20%20%20b2PolyAndCircleContact%20%3D%20Box2D.Dynamics.Contacts.b2PolyAndCircleContact%2C%0A%20%20%20%20%20%20b2PolyAndEdgeContact%20%3D%20Box2D.Dynamics.Contacts.b2PolyAndEdgeContact%2C%0A%20%20%20%20%20%20b2PolygonContact%20%3D%20Box2D.Dynamics.Contacts.b2PolygonContact%2C%0A%20%20%20%20%20%20b2PositionSolverManifold%20%3D%20Box2D.Dynamics.Contacts.b2PositionSolverManifold%2C%0A%20%20%20%20%20%20b2Controller%20%3D%20Box2D.Dynamics.Controllers.b2Controller%2C%0A%20%20%20%20%20%20b2DistanceJoint%20%3D%20Box2D.Dynamics.Joints.b2DistanceJoint%2C%0A%20%20%20%20%20%20b2DistanceJointDef%20%3D%20Box2D.Dynamics.Joints.b2DistanceJointDef%2C%0A%20%20%20%20%20%20b2FrictionJoint%20%3D%20Box2D.Dynamics.Joints.b2FrictionJoint%2C%0A%20%20%20%20%20%20b2FrictionJointDef%20%3D%20Box2D.Dynamics.Joints.b2FrictionJointDef%2C%0A%20%20%20%20%20%20b2GearJoint%20%3D%20Box2D.Dynamics.Joints.b2GearJoint%2C%0A%20%20%20%20%20%20b2GearJointDef%20%3D%20Box2D.Dynamics.Joints.b2GearJointDef%2C%0A%20%20%20%20%20%20b2Jacobian%20%3D%20Box2D.Dynamics.Joints.b2Jacobian%2C%0A%20%20%20%20%20%20b2Joint%20%3D%20Box2D.Dynamics.Joints.b2Joint%2C%0A%20%20%20%20%20%20b2JointDef%20%3D%20Box2D.Dynamics.Joints.b2JointDef%2C%0A%20%20%20%20%20%20b2JointEdge%20%3D%20Box2D.Dynamics.Joints.b2JointEdge%2C%0A%20%20%20%20%20%20b2LineJoint%20%3D%20Box2D.Dynamics.Joints.b2LineJoint%2C%0A%20%20%20%20%20%20b2LineJointDef%20%3D%20Box2D.Dynamics.Joints.b2LineJointDef%2C%0A%20%20%20%20%20%20b2MouseJoint%20%3D%20Box2D.Dynamics.Joints.b2MouseJoint%2C%0A%20%20%20%20%20%20b2MouseJointDef%20%3D%20Box2D.Dynamics.Joints.b2MouseJointDef%2C%0A%20%20%20%20%20%20b2PrismaticJoint%20%3D%20Box2D.Dynamics.Joints.b2PrismaticJoint%2C%0A%20%20%20%20%20%20b2PrismaticJointDef%20%3D%20Box2D.Dynamics.Joints.b2PrismaticJointDef%2C%0A%20%20%20%20%20%20b2PulleyJoint%20%3D%20Box2D.Dynamics.Joints.b2PulleyJoint%2C%0A%20%20%20%20%20%20b2PulleyJointDef%20%3D%20Box2D.Dynamics.Joints.b2PulleyJointDef%2C%0A%20%20%20%20%20%20b2RevoluteJoint%20%3D%20Box2D.Dynamics.Joints.b2RevoluteJoint%2C%0A%20%20%20%20%20%20b2RevoluteJointDef%20%3D%20Box2D.Dynamics.Joints.b2RevoluteJointDef%2C%0A%20%20%20%20%20%20b2WeldJoint%20%3D%20Box2D.Dynamics.Joints.b2WeldJoint%2C%0A%20%20%20%20%20%20b2WeldJointDef%20%3D%20Box2D.Dynamics.Joints.b2WeldJointDef%3B%0A%0A%20%20%20%20b2Body.b2Body%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_xf%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20this.m_sweep%20%3D%20new%20b2Sweep()%3B%0A%20%20%20%20%20%20this.m_linearVelocity%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_force%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.connectEdges%20%3D%20function%20(s1%2C%20s2%2C%20angle1)%20%7B%0A%20%20%20%20%20%20if%20(angle1%20%3D%3D%3D%20undefined)%20angle1%20%3D%200%3B%0A%20%20%20%20%20%20var%20angle2%20%3D%20Math.atan2(%0A%20%20%20%20%20%20%20%20s2.GetDirectionVector().y%2C%0A%20%20%20%20%20%20%20%20s2.GetDirectionVector().x%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20coreOffset%20%3D%20Math.tan((angle2%20-%20angle1)%20*%200.5)%3B%0A%20%20%20%20%20%20var%20core%20%3D%20b2Math.MulFV(coreOffset%2C%20s2.GetDirectionVector())%3B%0A%20%20%20%20%20%20core%20%3D%20b2Math.SubtractVV(core%2C%20s2.GetNormalVector())%3B%0A%20%20%20%20%20%20core%20%3D%20b2Math.MulFV(b2Settings.b2_toiSlop%2C%20core)%3B%0A%20%20%20%20%20%20core%20%3D%20b2Math.AddVV(core%2C%20s2.GetVertex1())%3B%0A%20%20%20%20%20%20var%20cornerDir%20%3D%20b2Math.AddVV(%0A%20%20%20%20%20%20%20%20s1.GetDirectionVector()%2C%0A%20%20%20%20%20%20%20%20s2.GetDirectionVector()%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20cornerDir.Normalize()%3B%0A%20%20%20%20%20%20var%20convex%20%3D%0A%20%20%20%20%20%20%20%20b2Math.Dot(s1.GetDirectionVector()%2C%20s2.GetNormalVector())%20%3E%200.0%3B%0A%20%20%20%20%20%20s1.SetNextEdge(s2%2C%20core%2C%20cornerDir%2C%20convex)%3B%0A%20%20%20%20%20%20s2.SetPrevEdge(s1%2C%20core%2C%20cornerDir%2C%20convex)%3B%0A%20%20%20%20%20%20return%20angle2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.CreateFixture%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20if%20(this.m_world.IsLocked()%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20fixture%20%3D%20new%20b2Fixture()%3B%0A%20%20%20%20%20%20fixture.Create(this%2C%20this.m_xf%2C%20def)%3B%0A%20%20%20%20%20%20if%20(this.m_flags%20%26%20b2Body.e_activeFlag)%20%7B%0A%20%20%20%20%20%20%20%20var%20broadPhase%20%3D%20this.m_world.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20%20%20fixture.CreateProxy(broadPhase%2C%20this.m_xf)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20fixture.m_next%20%3D%20this.m_fixtureList%3B%0A%20%20%20%20%20%20this.m_fixtureList%20%3D%20fixture%3B%0A%20%20%20%20%20%20%2B%2Bthis.m_fixtureCount%3B%0A%20%20%20%20%20%20fixture.m_body%20%3D%20this%3B%0A%20%20%20%20%20%20if%20(fixture.m_density%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.ResetMassData()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_world.m_flags%20%7C%3D%20b2World.e_newFixture%3B%0A%20%20%20%20%20%20return%20fixture%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.CreateFixture2%20%3D%20function%20(shape%2C%20density)%20%7B%0A%20%20%20%20%20%20if%20(density%20%3D%3D%3D%20undefined)%20density%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20def%20%3D%20new%20b2FixtureDef()%3B%0A%20%20%20%20%20%20def.shape%20%3D%20shape%3B%0A%20%20%20%20%20%20def.density%20%3D%20density%3B%0A%20%20%20%20%20%20return%20this.CreateFixture(def)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.DestroyFixture%20%3D%20function%20(fixture)%20%7B%0A%20%20%20%20%20%20if%20(this.m_world.IsLocked()%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20node%20%3D%20this.m_fixtureList%3B%0A%20%20%20%20%20%20var%20ppF%20%3D%20null%3B%0A%20%20%20%20%20%20var%20found%20%3D%20false%3B%0A%20%20%20%20%20%20while%20(node%20!%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20if%20(node%20%3D%3D%20fixture)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(ppF)%20ppF.m_next%20%3D%20fixture.m_next%3B%0A%20%20%20%20%20%20%20%20%20%20else%20this.m_fixtureList%20%3D%20fixture.m_next%3B%0A%20%20%20%20%20%20%20%20%20%20found%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20ppF%20%3D%20node%3B%0A%20%20%20%20%20%20%20%20node%20%3D%20node.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20edge%20%3D%20this.m_contactList%3B%0A%20%20%20%20%20%20while%20(edge)%20%7B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20edge.contact%3B%0A%20%20%20%20%20%20%20%20edge%20%3D%20edge.next%3B%0A%20%20%20%20%20%20%20%20var%20fixtureA%20%3D%20c.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20var%20fixtureB%20%3D%20c.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20if%20(fixture%20%3D%3D%20fixtureA%20%7C%7C%20fixture%20%3D%3D%20fixtureB)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_world.m_contactManager.Destroy(c)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_flags%20%26%20b2Body.e_activeFlag)%20%7B%0A%20%20%20%20%20%20%20%20var%20broadPhase%20%3D%20this.m_world.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20%20%20fixture.DestroyProxy(broadPhase)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20fixture.Destroy()%3B%0A%20%20%20%20%20%20fixture.m_body%20%3D%20null%3B%0A%20%20%20%20%20%20fixture.m_next%20%3D%20null%3B%0A%20%20%20%20%20%20--this.m_fixtureCount%3B%0A%20%20%20%20%20%20this.ResetMassData()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetPositionAndAngle%20%3D%20function%20(position%2C%20angle)%20%7B%0A%20%20%20%20%20%20if%20(angle%20%3D%3D%3D%20undefined)%20angle%20%3D%200%3B%0A%20%20%20%20%20%20var%20f%3B%0A%20%20%20%20%20%20if%20(this.m_world.IsLocked()%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_xf.R.Set(angle)%3B%0A%20%20%20%20%20%20this.m_xf.position.SetV(position)%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20this.m_xf.R%3B%0A%20%20%20%20%20%20var%20tVec%20%3D%20this.m_sweep.localCenter%3B%0A%20%20%20%20%20%20this.m_sweep.c.x%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20this.m_sweep.c.y%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20this.m_sweep.c.x%20%2B%3D%20this.m_xf.position.x%3B%0A%20%20%20%20%20%20this.m_sweep.c.y%20%2B%3D%20this.m_xf.position.y%3B%0A%20%20%20%20%20%20this.m_sweep.c0.SetV(this.m_sweep.c)%3B%0A%20%20%20%20%20%20this.m_sweep.a0%20%3D%20this.m_sweep.a%20%3D%20angle%3B%0A%20%20%20%20%20%20var%20broadPhase%20%3D%20this.m_world.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20for%20(f%20%3D%20this.m_fixtureList%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20f.Synchronize(broadPhase%2C%20this.m_xf%2C%20this.m_xf)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_world.m_contactManager.FindNewContacts()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetTransform%20%3D%20function%20(xf)%20%7B%0A%20%20%20%20%20%20this.SetPositionAndAngle(xf.position%2C%20xf.GetAngle())%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetTransform%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_xf%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetPosition%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_xf.position%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetPosition%20%3D%20function%20(position)%20%7B%0A%20%20%20%20%20%20this.SetPositionAndAngle(position%2C%20this.GetAngle())%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetAngle%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_sweep.a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetAngle%20%3D%20function%20(angle)%20%7B%0A%20%20%20%20%20%20if%20(angle%20%3D%3D%3D%20undefined)%20angle%20%3D%200%3B%0A%20%20%20%20%20%20this.SetPositionAndAngle(this.GetPosition()%2C%20angle)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetWorldCenter%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_sweep.c%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLocalCenter%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_sweep.localCenter%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetLinearVelocity%20%3D%20function%20(v)%20%7B%0A%20%20%20%20%20%20if%20(this.m_type%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_linearVelocity.SetV(v)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLinearVelocity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_linearVelocity%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetAngularVelocity%20%3D%20function%20(omega)%20%7B%0A%20%20%20%20%20%20if%20(omega%20%3D%3D%3D%20undefined)%20omega%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_type%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_angularVelocity%20%3D%20omega%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetAngularVelocity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_angularVelocity%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetDefinition%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bd%20%3D%20new%20b2BodyDef()%3B%0A%20%20%20%20%20%20bd.type%20%3D%20this.GetType()%3B%0A%20%20%20%20%20%20bd.allowSleep%20%3D%0A%20%20%20%20%20%20%20%20(this.m_flags%20%26%20b2Body.e_allowSleepFlag)%20%3D%3D%20b2Body.e_allowSleepFlag%3B%0A%20%20%20%20%20%20bd.angle%20%3D%20this.GetAngle()%3B%0A%20%20%20%20%20%20bd.angularDamping%20%3D%20this.m_angularDamping%3B%0A%20%20%20%20%20%20bd.angularVelocity%20%3D%20this.m_angularVelocity%3B%0A%20%20%20%20%20%20bd.fixedRotation%20%3D%0A%20%20%20%20%20%20%20%20(this.m_flags%20%26%20b2Body.e_fixedRotationFlag)%20%3D%3D%20b2Body.e_fixedRotationFlag%3B%0A%20%20%20%20%20%20bd.bullet%20%3D%20(this.m_flags%20%26%20b2Body.e_bulletFlag)%20%3D%3D%20b2Body.e_bulletFlag%3B%0A%20%20%20%20%20%20bd.awake%20%3D%20(this.m_flags%20%26%20b2Body.e_awakeFlag)%20%3D%3D%20b2Body.e_awakeFlag%3B%0A%20%20%20%20%20%20bd.linearDamping%20%3D%20this.m_linearDamping%3B%0A%20%20%20%20%20%20bd.linearVelocity.SetV(this.GetLinearVelocity())%3B%0A%20%20%20%20%20%20bd.position%20%3D%20this.GetPosition()%3B%0A%20%20%20%20%20%20bd.userData%20%3D%20this.GetUserData()%3B%0A%20%20%20%20%20%20return%20bd%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.ApplyForce%20%3D%20function%20(force%2C%20point)%20%7B%0A%20%20%20%20%20%20if%20(this.m_type%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_force.x%20%2B%3D%20force.x%3B%0A%20%20%20%20%20%20this.m_force.y%20%2B%3D%20force.y%3B%0A%20%20%20%20%20%20this.m_torque%20%2B%3D%0A%20%20%20%20%20%20%20%20(point.x%20-%20this.m_sweep.c.x)%20*%20force.y%20-%0A%20%20%20%20%20%20%20%20(point.y%20-%20this.m_sweep.c.y)%20*%20force.x%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.ApplyTorque%20%3D%20function%20(torque)%20%7B%0A%20%20%20%20%20%20if%20(torque%20%3D%3D%3D%20undefined)%20torque%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_type%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_torque%20%2B%3D%20torque%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.ApplyImpulse%20%3D%20function%20(impulse%2C%20point)%20%7B%0A%20%20%20%20%20%20if%20(this.m_type%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_linearVelocity.x%20%2B%3D%20this.m_invMass%20*%20impulse.x%3B%0A%20%20%20%20%20%20this.m_linearVelocity.y%20%2B%3D%20this.m_invMass%20*%20impulse.y%3B%0A%20%20%20%20%20%20this.m_angularVelocity%20%2B%3D%0A%20%20%20%20%20%20%20%20this.m_invI%20*%0A%20%20%20%20%20%20%20%20((point.x%20-%20this.m_sweep.c.x)%20*%20impulse.y%20-%0A%20%20%20%20%20%20%20%20%20%20(point.y%20-%20this.m_sweep.c.y)%20*%20impulse.x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.Split%20%3D%20function%20(callback)%20%7B%0A%20%20%20%20%20%20var%20linearVelocity%20%3D%20this.GetLinearVelocity().Copy()%3B%0A%20%20%20%20%20%20var%20angularVelocity%20%3D%20this.GetAngularVelocity()%3B%0A%20%20%20%20%20%20var%20center%20%3D%20this.GetWorldCenter()%3B%0A%20%20%20%20%20%20var%20body1%20%3D%20this%3B%0A%20%20%20%20%20%20var%20body2%20%3D%20this.m_world.CreateBody(this.GetDefinition())%3B%0A%20%20%20%20%20%20var%20prev%3B%0A%20%20%20%20%20%20for%20(var%20f%20%3D%20body1.m_fixtureList%3B%20f%3B%20)%20%7B%0A%20%20%20%20%20%20%20%20if%20(callback(f))%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20next%20%3D%20f.m_next%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(prev)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20prev.m_next%20%3D%20next%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20body1.m_fixtureList%20%3D%20next%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20body1.m_fixtureCount--%3B%0A%20%20%20%20%20%20%20%20%20%20f.m_next%20%3D%20body2.m_fixtureList%3B%0A%20%20%20%20%20%20%20%20%20%20body2.m_fixtureList%20%3D%20f%3B%0A%20%20%20%20%20%20%20%20%20%20body2.m_fixtureCount%2B%2B%3B%0A%20%20%20%20%20%20%20%20%20%20f.m_body%20%3D%20body2%3B%0A%20%20%20%20%20%20%20%20%20%20f%20%3D%20next%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20prev%20%3D%20f%3B%0A%20%20%20%20%20%20%20%20%20%20f%20%3D%20f.m_next%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20body1.ResetMassData()%3B%0A%20%20%20%20%20%20body2.ResetMassData()%3B%0A%20%20%20%20%20%20var%20center1%20%3D%20body1.GetWorldCenter()%3B%0A%20%20%20%20%20%20var%20center2%20%3D%20body2.GetWorldCenter()%3B%0A%20%20%20%20%20%20var%20velocity1%20%3D%20b2Math.AddVV(%0A%20%20%20%20%20%20%20%20linearVelocity%2C%0A%20%20%20%20%20%20%20%20b2Math.CrossFV(angularVelocity%2C%20b2Math.SubtractVV(center1%2C%20center))%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20velocity2%20%3D%20b2Math.AddVV(%0A%20%20%20%20%20%20%20%20linearVelocity%2C%0A%20%20%20%20%20%20%20%20b2Math.CrossFV(angularVelocity%2C%20b2Math.SubtractVV(center2%2C%20center))%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20body1.SetLinearVelocity(velocity1)%3B%0A%20%20%20%20%20%20body2.SetLinearVelocity(velocity2)%3B%0A%20%20%20%20%20%20body1.SetAngularVelocity(angularVelocity)%3B%0A%20%20%20%20%20%20body2.SetAngularVelocity(angularVelocity)%3B%0A%20%20%20%20%20%20body1.SynchronizeFixtures()%3B%0A%20%20%20%20%20%20body2.SynchronizeFixtures()%3B%0A%20%20%20%20%20%20return%20body2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.Merge%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20var%20f%3B%0A%20%20%20%20%20%20for%20(f%20%3D%20other.m_fixtureList%3B%20f%3B%20)%20%7B%0A%20%20%20%20%20%20%20%20var%20next%20%3D%20f.m_next%3B%0A%20%20%20%20%20%20%20%20other.m_fixtureCount--%3B%0A%20%20%20%20%20%20%20%20f.m_next%20%3D%20this.m_fixtureList%3B%0A%20%20%20%20%20%20%20%20this.m_fixtureList%20%3D%20f%3B%0A%20%20%20%20%20%20%20%20this.m_fixtureCount%2B%2B%3B%0A%20%20%20%20%20%20%20%20f.m_body%20%3D%20body2%3B%0A%20%20%20%20%20%20%20%20f%20%3D%20next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20body1.m_fixtureCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20body1%20%3D%20this%3B%0A%20%20%20%20%20%20var%20body2%20%3D%20other%3B%0A%20%20%20%20%20%20var%20center1%20%3D%20body1.GetWorldCenter()%3B%0A%20%20%20%20%20%20var%20center2%20%3D%20body2.GetWorldCenter()%3B%0A%20%20%20%20%20%20var%20velocity1%20%3D%20body1.GetLinearVelocity().Copy()%3B%0A%20%20%20%20%20%20var%20velocity2%20%3D%20body2.GetLinearVelocity().Copy()%3B%0A%20%20%20%20%20%20var%20angular1%20%3D%20body1.GetAngularVelocity()%3B%0A%20%20%20%20%20%20var%20angular%20%3D%20body2.GetAngularVelocity()%3B%0A%20%20%20%20%20%20body1.ResetMassData()%3B%0A%20%20%20%20%20%20this.SynchronizeFixtures()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetMass%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_mass%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetInertia%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_I%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetMassData%20%3D%20function%20(data)%20%7B%0A%20%20%20%20%20%20data.mass%20%3D%20this.m_mass%3B%0A%20%20%20%20%20%20data.I%20%3D%20this.m_I%3B%0A%20%20%20%20%20%20data.center.SetV(this.m_sweep.localCenter)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetMassData%20%3D%20function%20(massData)%20%7B%0A%20%20%20%20%20%20b2Settings.b2Assert(this.m_world.IsLocked()%20%3D%3D%20false)%3B%0A%20%20%20%20%20%20if%20(this.m_world.IsLocked()%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_type%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_invMass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_I%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_invI%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_mass%20%3D%20massData.mass%3B%0A%20%20%20%20%20%20if%20(this.m_mass%20%3C%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_mass%20%3D%201.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_invMass%20%3D%201.0%20%2F%20this.m_mass%3B%0A%20%20%20%20%20%20if%20(massData.I%20%3E%200.0%20%26%26%20(this.m_flags%20%26%20b2Body.e_fixedRotationFlag)%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20this.m_I%20%3D%0A%20%20%20%20%20%20%20%20%20%20massData.I%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_mass%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20(massData.center.x%20*%20massData.center.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20massData.center.y%20*%20massData.center.y)%3B%0A%20%20%20%20%20%20%20%20this.m_invI%20%3D%201.0%20%2F%20this.m_I%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20oldCenter%20%3D%20this.m_sweep.c.Copy()%3B%0A%20%20%20%20%20%20this.m_sweep.localCenter.SetV(massData.center)%3B%0A%20%20%20%20%20%20this.m_sweep.c0.SetV(b2Math.MulX(this.m_xf%2C%20this.m_sweep.localCenter))%3B%0A%20%20%20%20%20%20this.m_sweep.c.SetV(this.m_sweep.c0)%3B%0A%20%20%20%20%20%20this.m_linearVelocity.x%20%2B%3D%0A%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20-(this.m_sweep.c.y%20-%20oldCenter.y)%3B%0A%20%20%20%20%20%20this.m_linearVelocity.y%20%2B%3D%0A%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20%2B(this.m_sweep.c.x%20-%20oldCenter.x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.ResetMassData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_mass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_invMass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_I%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_invI%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_sweep.localCenter.SetZero()%3B%0A%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20this.m_type%20%3D%3D%20b2Body.b2_staticBody%20%7C%7C%0A%20%20%20%20%20%20%20%20this.m_type%20%3D%3D%20b2Body.b2_kinematicBody%0A%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20center%20%3D%20b2Vec2.Make(0%2C%200)%3B%0A%20%20%20%20%20%20for%20(var%20f%20%3D%20this.m_fixtureList%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20if%20(f.m_density%20%3D%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20massData%20%3D%20f.GetMassData()%3B%0A%20%20%20%20%20%20%20%20this.m_mass%20%2B%3D%20massData.mass%3B%0A%20%20%20%20%20%20%20%20center.x%20%2B%3D%20massData.center.x%20*%20massData.mass%3B%0A%20%20%20%20%20%20%20%20center.y%20%2B%3D%20massData.center.y%20*%20massData.mass%3B%0A%20%20%20%20%20%20%20%20this.m_I%20%2B%3D%20massData.I%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_mass%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_invMass%20%3D%201.0%20%2F%20this.m_mass%3B%0A%20%20%20%20%20%20%20%20center.x%20*%3D%20this.m_invMass%3B%0A%20%20%20%20%20%20%20%20center.y%20*%3D%20this.m_invMass%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_mass%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_invMass%20%3D%201.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_I%20%3E%200.0%20%26%26%20(this.m_flags%20%26%20b2Body.e_fixedRotationFlag)%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20this.m_I%20-%3D%20this.m_mass%20*%20(center.x%20*%20center.x%20%2B%20center.y%20*%20center.y)%3B%0A%20%20%20%20%20%20%20%20this.m_I%20*%3D%20this.m_inertiaScale%3B%0A%20%20%20%20%20%20%20%20b2Settings.b2Assert(this.m_I%20%3E%200)%3B%0A%20%20%20%20%20%20%20%20this.m_invI%20%3D%201.0%20%2F%20this.m_I%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_I%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_invI%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20oldCenter%20%3D%20this.m_sweep.c.Copy()%3B%0A%20%20%20%20%20%20this.m_sweep.localCenter.SetV(center)%3B%0A%20%20%20%20%20%20this.m_sweep.c0.SetV(b2Math.MulX(this.m_xf%2C%20this.m_sweep.localCenter))%3B%0A%20%20%20%20%20%20this.m_sweep.c.SetV(this.m_sweep.c0)%3B%0A%20%20%20%20%20%20this.m_linearVelocity.x%20%2B%3D%0A%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20-(this.m_sweep.c.y%20-%20oldCenter.y)%3B%0A%20%20%20%20%20%20this.m_linearVelocity.y%20%2B%3D%0A%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20%2B(this.m_sweep.c.x%20-%20oldCenter.x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetWorldPoint%20%3D%20function%20(localPoint)%20%7B%0A%20%20%20%20%20%20var%20A%20%3D%20this.m_xf.R%3B%0A%20%20%20%20%20%20var%20u%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20A.col1.x%20*%20localPoint.x%20%2B%20A.col2.x%20*%20localPoint.y%2C%0A%20%20%20%20%20%20%20%20A.col1.y%20*%20localPoint.x%20%2B%20A.col2.y%20*%20localPoint.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20u.x%20%2B%3D%20this.m_xf.position.x%3B%0A%20%20%20%20%20%20u.y%20%2B%3D%20this.m_xf.position.y%3B%0A%20%20%20%20%20%20return%20u%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetWorldVector%20%3D%20function%20(localVector)%20%7B%0A%20%20%20%20%20%20return%20b2Math.MulMV(this.m_xf.R%2C%20localVector)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLocalPoint%20%3D%20function%20(worldPoint)%20%7B%0A%20%20%20%20%20%20return%20b2Math.MulXT(this.m_xf%2C%20worldPoint)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLocalVector%20%3D%20function%20(worldVector)%20%7B%0A%20%20%20%20%20%20return%20b2Math.MulTMV(this.m_xf.R%2C%20worldVector)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLinearVelocityFromWorldPoint%20%3D%20function%20(worldPoint)%20%7B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20this.m_linearVelocity.x%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20(worldPoint.y%20-%20this.m_sweep.c.y)%2C%0A%20%20%20%20%20%20%20%20this.m_linearVelocity.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20(worldPoint.x%20-%20this.m_sweep.c.x)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLinearVelocityFromLocalPoint%20%3D%20function%20(localPoint)%20%7B%0A%20%20%20%20%20%20var%20A%20%3D%20this.m_xf.R%3B%0A%20%20%20%20%20%20var%20worldPoint%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20A.col1.x%20*%20localPoint.x%20%2B%20A.col2.x%20*%20localPoint.y%2C%0A%20%20%20%20%20%20%20%20A.col1.y%20*%20localPoint.x%20%2B%20A.col2.y%20*%20localPoint.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20worldPoint.x%20%2B%3D%20this.m_xf.position.x%3B%0A%20%20%20%20%20%20worldPoint.y%20%2B%3D%20this.m_xf.position.y%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20this.m_linearVelocity.x%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20(worldPoint.y%20-%20this.m_sweep.c.y)%2C%0A%20%20%20%20%20%20%20%20this.m_linearVelocity.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_angularVelocity%20*%20(worldPoint.x%20-%20this.m_sweep.c.x)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetLinearDamping%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_linearDamping%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetLinearDamping%20%3D%20function%20(linearDamping)%20%7B%0A%20%20%20%20%20%20if%20(linearDamping%20%3D%3D%3D%20undefined)%20linearDamping%20%3D%200%3B%0A%20%20%20%20%20%20this.m_linearDamping%20%3D%20linearDamping%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetAngularDamping%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_angularDamping%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetAngularDamping%20%3D%20function%20(angularDamping)%20%7B%0A%20%20%20%20%20%20if%20(angularDamping%20%3D%3D%3D%20undefined)%20angularDamping%20%3D%200%3B%0A%20%20%20%20%20%20this.m_angularDamping%20%3D%20angularDamping%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetType%20%3D%20function%20(type)%20%7B%0A%20%20%20%20%20%20if%20(type%20%3D%3D%3D%20undefined)%20type%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_type%20%3D%3D%20type)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_type%20%3D%20type%3B%0A%20%20%20%20%20%20this.ResetMassData()%3B%0A%20%20%20%20%20%20if%20(this.m_type%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20this.m_linearVelocity.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_angularVelocity%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_force.SetZero()%3B%0A%20%20%20%20%20%20this.m_torque%20%3D%200.0%3B%0A%20%20%20%20%20%20for%20(var%20ce%20%3D%20this.m_contactList%3B%20ce%3B%20ce%20%3D%20ce.next)%20%7B%0A%20%20%20%20%20%20%20%20ce.contact.FlagForFiltering()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetType%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_type%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetBullet%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20if%20(flag)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_bulletFlag%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Body.e_bulletFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.IsBullet%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2Body.e_bulletFlag)%20%3D%3D%20b2Body.e_bulletFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetSleepingAllowed%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20if%20(flag)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_allowSleepFlag%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Body.e_allowSleepFlag%3B%0A%20%20%20%20%20%20%20%20this.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetAwake%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20if%20(flag)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_awakeFlag%3B%0A%20%20%20%20%20%20%20%20this.m_sleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Body.e_awakeFlag%3B%0A%20%20%20%20%20%20%20%20this.m_sleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_linearVelocity.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_angularVelocity%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_force.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_torque%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.IsAwake%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2Body.e_awakeFlag)%20%3D%3D%20b2Body.e_awakeFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetFixedRotation%20%3D%20function%20(fixed)%20%7B%0A%20%20%20%20%20%20if%20(fixed)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_fixedRotationFlag%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Body.e_fixedRotationFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.ResetMassData()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.IsFixedRotation%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20(this.m_flags%20%26%20b2Body.e_fixedRotationFlag)%20%3D%3D%20b2Body.e_fixedRotationFlag%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetActive%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20if%20(flag%20%3D%3D%20this.IsActive())%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20broadPhase%3B%0A%20%20%20%20%20%20var%20f%3B%0A%20%20%20%20%20%20if%20(flag)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_activeFlag%3B%0A%20%20%20%20%20%20%20%20broadPhase%20%3D%20this.m_world.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20%20%20for%20(f%20%3D%20this.m_fixtureList%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20f.CreateProxy(broadPhase%2C%20this.m_xf)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Body.e_activeFlag%3B%0A%20%20%20%20%20%20%20%20broadPhase%20%3D%20this.m_world.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20%20%20for%20(f%20%3D%20this.m_fixtureList%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20f.DestroyProxy(broadPhase)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20ce%20%3D%20this.m_contactList%3B%0A%20%20%20%20%20%20%20%20while%20(ce)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20ce0%20%3D%20ce%3B%0A%20%20%20%20%20%20%20%20%20%20ce%20%3D%20ce.next%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_world.m_contactManager.Destroy(ce0.contact)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.m_contactList%20%3D%20null%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.IsActive%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2Body.e_activeFlag)%20%3D%3D%20b2Body.e_activeFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.IsSleepingAllowed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2Body.e_allowSleepFlag)%20%3D%3D%20b2Body.e_allowSleepFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetFixtureList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_fixtureList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetJointList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_jointList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetControllerList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_controllerList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetContactList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_contactList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetNext%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_next%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetUserData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_userData%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SetUserData%20%3D%20function%20(data)%20%7B%0A%20%20%20%20%20%20this.m_userData%20%3D%20data%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.GetWorld%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_world%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.b2Body%20%3D%20function%20(bd%2C%20world)%20%7B%0A%20%20%20%20%20%20this.m_flags%20%3D%200%3B%0A%20%20%20%20%20%20if%20(bd.bullet)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_bulletFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(bd.fixedRotation)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_fixedRotationFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(bd.allowSleep)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_allowSleepFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(bd.awake)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_awakeFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(bd.active)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Body.e_activeFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_world%20%3D%20world%3B%0A%20%20%20%20%20%20this.m_xf.position.SetV(bd.position)%3B%0A%20%20%20%20%20%20this.m_xf.R.Set(bd.angle)%3B%0A%20%20%20%20%20%20this.m_sweep.localCenter.SetZero()%3B%0A%20%20%20%20%20%20this.m_sweep.t0%20%3D%201.0%3B%0A%20%20%20%20%20%20this.m_sweep.a0%20%3D%20this.m_sweep.a%20%3D%20bd.angle%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20this.m_xf.R%3B%0A%20%20%20%20%20%20var%20tVec%20%3D%20this.m_sweep.localCenter%3B%0A%20%20%20%20%20%20this.m_sweep.c.x%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20this.m_sweep.c.y%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20this.m_sweep.c.x%20%2B%3D%20this.m_xf.position.x%3B%0A%20%20%20%20%20%20this.m_sweep.c.y%20%2B%3D%20this.m_xf.position.y%3B%0A%20%20%20%20%20%20this.m_sweep.c0.SetV(this.m_sweep.c)%3B%0A%20%20%20%20%20%20this.m_jointList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_controllerList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_contactList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_controllerCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_linearVelocity.SetV(bd.linearVelocity)%3B%0A%20%20%20%20%20%20this.m_angularVelocity%20%3D%20bd.angularVelocity%3B%0A%20%20%20%20%20%20this.m_linearDamping%20%3D%20bd.linearDamping%3B%0A%20%20%20%20%20%20this.m_angularDamping%20%3D%20bd.angularDamping%3B%0A%20%20%20%20%20%20this.m_force.Set(0.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.m_torque%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_sleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_type%20%3D%20bd.type%3B%0A%20%20%20%20%20%20if%20(this.m_type%20%3D%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20this.m_mass%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20this.m_invMass%20%3D%201.0%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_mass%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_invMass%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_I%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_invI%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_inertiaScale%20%3D%20bd.inertiaScale%3B%0A%20%20%20%20%20%20this.m_userData%20%3D%20bd.userData%3B%0A%20%20%20%20%20%20this.m_fixtureList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_fixtureCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SynchronizeFixtures%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20xf1%20%3D%20b2Body.s_xf1%3B%0A%20%20%20%20%20%20xf1.R.Set(this.m_sweep.a0)%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20xf1.R%3B%0A%20%20%20%20%20%20var%20tVec%20%3D%20this.m_sweep.localCenter%3B%0A%20%20%20%20%20%20xf1.position.x%20%3D%0A%20%20%20%20%20%20%20%20this.m_sweep.c0.x%20-%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20xf1.position.y%20%3D%0A%20%20%20%20%20%20%20%20this.m_sweep.c0.y%20-%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20var%20f%3B%0A%20%20%20%20%20%20var%20broadPhase%20%3D%20this.m_world.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20for%20(f%20%3D%20this.m_fixtureList%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20f.Synchronize(broadPhase%2C%20xf1%2C%20this.m_xf)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.SynchronizeTransform%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_xf.R.Set(this.m_sweep.a)%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20this.m_xf.R%3B%0A%20%20%20%20%20%20var%20tVec%20%3D%20this.m_sweep.localCenter%3B%0A%20%20%20%20%20%20this.m_xf.position.x%20%3D%0A%20%20%20%20%20%20%20%20this.m_sweep.c.x%20-%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20this.m_xf.position.y%20%3D%0A%20%20%20%20%20%20%20%20this.m_sweep.c.y%20-%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.ShouldCollide%20%3D%20function%20(other)%20%7B%0A%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20this.m_type%20!%3D%20b2Body.b2_dynamicBody%20%26%26%0A%20%20%20%20%20%20%20%20other.m_type%20!%3D%20b2Body.b2_dynamicBody%0A%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(var%20jn%20%3D%20this.m_jointList%3B%20jn%3B%20jn%20%3D%20jn.next)%20%7B%0A%20%20%20%20%20%20%20%20if%20(jn.other%20%3D%3D%20other)%0A%20%20%20%20%20%20%20%20%20%20if%20(jn.joint.m_collideConnected%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Body.prototype.Advance%20%3D%20function%20(t)%20%7B%0A%20%20%20%20%20%20if%20(t%20%3D%3D%3D%20undefined)%20t%20%3D%200%3B%0A%20%20%20%20%20%20this.m_sweep.Advance(t)%3B%0A%20%20%20%20%20%20this.m_sweep.c.SetV(this.m_sweep.c0)%3B%0A%20%20%20%20%20%20this.m_sweep.a%20%3D%20this.m_sweep.a0%3B%0A%20%20%20%20%20%20this.SynchronizeTransform()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.s_xf1%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.e_islandFlag%20%3D%200x0001%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.e_awakeFlag%20%3D%200x0002%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.e_allowSleepFlag%20%3D%200x0004%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.e_bulletFlag%20%3D%200x0008%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.e_fixedRotationFlag%20%3D%200x0010%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.e_activeFlag%20%3D%200x0020%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.b2_staticBody%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.b2_kinematicBody%20%3D%201%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Body.b2_dynamicBody%20%3D%202%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2BodyDef.b2BodyDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.position%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.linearVelocity%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2BodyDef.prototype.b2BodyDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.userData%20%3D%20null%3B%0A%20%20%20%20%20%20this.position.Set(0.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.angle%20%3D%200.0%3B%0A%20%20%20%20%20%20this.linearVelocity.Set(0%2C%200)%3B%0A%20%20%20%20%20%20this.angularVelocity%20%3D%200.0%3B%0A%20%20%20%20%20%20this.linearDamping%20%3D%200.0%3B%0A%20%20%20%20%20%20this.angularDamping%20%3D%200.0%3B%0A%20%20%20%20%20%20this.allowSleep%20%3D%20true%3B%0A%20%20%20%20%20%20this.awake%20%3D%20true%3B%0A%20%20%20%20%20%20this.fixedRotation%20%3D%20false%3B%0A%20%20%20%20%20%20this.bullet%20%3D%20false%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Body.b2_staticBody%3B%0A%20%20%20%20%20%20this.active%20%3D%20true%3B%0A%20%20%20%20%20%20this.inertiaScale%20%3D%201.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactFilter.b2ContactFilter%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactFilter.prototype.ShouldCollide%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20var%20filter1%20%3D%20fixtureA.GetFilterData()%3B%0A%20%20%20%20%20%20var%20filter2%20%3D%20fixtureB.GetFilterData()%3B%0A%20%20%20%20%20%20if%20(filter1.groupIndex%20%3D%3D%20filter2.groupIndex%20%26%26%20filter1.groupIndex%20!%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20return%20filter1.groupIndex%20%3E%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20collide%20%3D%0A%20%20%20%20%20%20%20%20(filter1.maskBits%20%26%20filter2.categoryBits)%20!%3D%200%20%26%26%0A%20%20%20%20%20%20%20%20(filter1.categoryBits%20%26%20filter2.maskBits)%20!%3D%200%3B%0A%20%20%20%20%20%20return%20collide%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactFilter.prototype.RayCollide%20%3D%20function%20(userData%2C%20fixture)%20%7B%0A%20%20%20%20%20%20if%20(!userData)%20return%20true%3B%0A%20%20%20%20%20%20return%20this.ShouldCollide(%0A%20%20%20%20%20%20%20%20userData%20instanceof%20b2Fixture%20%3F%20userData%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20fixture%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2ContactFilter.b2_defaultFilter%20%3D%20new%20b2ContactFilter()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2ContactImpulse.b2ContactImpulse%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.normalImpulses%20%3D%20new%20Vector_a2j_Number(%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxManifoldPoints%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.tangentImpulses%20%3D%20new%20Vector_a2j_Number(%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxManifoldPoints%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactListener.b2ContactListener%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactListener.prototype.BeginContact%20%3D%20function%20(contact)%20%7B%7D%3B%0A%20%20%20%20b2ContactListener.prototype.EndContact%20%3D%20function%20(contact)%20%7B%7D%3B%0A%20%20%20%20b2ContactListener.prototype.PreSolve%20%3D%20function%20(contact%2C%20oldManifold)%20%7B%7D%3B%0A%20%20%20%20b2ContactListener.prototype.PostSolve%20%3D%20function%20(contact%2C%20impulse)%20%7B%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2ContactListener.b2_defaultListener%20%3D%0A%20%20%20%20%20%20%20%20new%20b2ContactListener()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2ContactManager.b2ContactManager%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactManager.prototype.b2ContactManager%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_world%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_contactCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_contactFilter%20%3D%20b2ContactFilter.b2_defaultFilter%3B%0A%20%20%20%20%20%20this.m_contactListener%20%3D%20b2ContactListener.b2_defaultListener%3B%0A%20%20%20%20%20%20this.m_contactFactory%20%3D%20new%20b2ContactFactory(this.m_allocator)%3B%0A%20%20%20%20%20%20this.m_broadPhase%20%3D%20new%20b2DynamicTreeBroadPhase()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactManager.prototype.AddPair%20%3D%20function%20(%0A%20%20%20%20%20%20proxyUserDataA%2C%0A%20%20%20%20%20%20proxyUserDataB%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20var%20fixtureA%20%3D%20proxyUserDataA%20instanceof%20b2Fixture%20%3F%20proxyUserDataA%20%3A%20null%3B%0A%20%20%20%20%20%20var%20fixtureB%20%3D%20proxyUserDataB%20instanceof%20b2Fixture%20%3F%20proxyUserDataB%20%3A%20null%3B%0A%20%20%20%20%20%20var%20bodyA%20%3D%20fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20fixtureB.GetBody()%3B%0A%20%20%20%20%20%20if%20(bodyA%20%3D%3D%20bodyB)%20return%3B%0A%20%20%20%20%20%20var%20edge%20%3D%20bodyB.GetContactList()%3B%0A%20%20%20%20%20%20while%20(edge)%20%7B%0A%20%20%20%20%20%20%20%20if%20(edge.other%20%3D%3D%20bodyA)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20fA%20%3D%20edge.contact.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20fB%20%3D%20edge.contact.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(fA%20%3D%3D%20fixtureA%20%26%26%20fB%20%3D%3D%20fixtureB)%20return%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(fA%20%3D%3D%20fixtureB%20%26%26%20fB%20%3D%3D%20fixtureA)%20return%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20edge%20%3D%20edge.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(bodyB.ShouldCollide(bodyA)%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_contactFilter.ShouldCollide(fixtureA%2C%20fixtureB)%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20c%20%3D%20this.m_contactFactory.Create(fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%20%20fixtureA%20%3D%20c.GetFixtureA()%3B%0A%20%20%20%20%20%20fixtureB%20%3D%20c.GetFixtureB()%3B%0A%20%20%20%20%20%20bodyA%20%3D%20fixtureA.m_body%3B%0A%20%20%20%20%20%20bodyB%20%3D%20fixtureB.m_body%3B%0A%20%20%20%20%20%20c.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20c.m_next%20%3D%20this.m_world.m_contactList%3B%0A%20%20%20%20%20%20if%20(this.m_world.m_contactList%20!%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20this.m_world.m_contactList.m_prev%20%3D%20c%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_world.m_contactList%20%3D%20c%3B%0A%20%20%20%20%20%20c.m_nodeA.contact%20%3D%20c%3B%0A%20%20%20%20%20%20c.m_nodeA.other%20%3D%20bodyB%3B%0A%20%20%20%20%20%20c.m_nodeA.prev%20%3D%20null%3B%0A%20%20%20%20%20%20c.m_nodeA.next%20%3D%20bodyA.m_contactList%3B%0A%20%20%20%20%20%20if%20(bodyA.m_contactList%20!%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20bodyA.m_contactList.prev%20%3D%20c.m_nodeA%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20bodyA.m_contactList%20%3D%20c.m_nodeA%3B%0A%20%20%20%20%20%20c.m_nodeB.contact%20%3D%20c%3B%0A%20%20%20%20%20%20c.m_nodeB.other%20%3D%20bodyA%3B%0A%20%20%20%20%20%20c.m_nodeB.prev%20%3D%20null%3B%0A%20%20%20%20%20%20c.m_nodeB.next%20%3D%20bodyB.m_contactList%3B%0A%20%20%20%20%20%20if%20(bodyB.m_contactList%20!%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20bodyB.m_contactList.prev%20%3D%20c.m_nodeB%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20bodyB.m_contactList%20%3D%20c.m_nodeB%3B%0A%20%20%20%20%20%20%2B%2Bthis.m_world.m_contactCount%3B%0A%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactManager.prototype.FindNewContacts%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_broadPhase.UpdatePairs(Box2D.generateCallback(this%2C%20this.AddPair))%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactManager.prototype.Destroy%20%3D%20function%20(c)%20%7B%0A%20%20%20%20%20%20var%20fixtureA%20%3D%20c.GetFixtureA()%3B%0A%20%20%20%20%20%20var%20fixtureB%20%3D%20c.GetFixtureB()%3B%0A%20%20%20%20%20%20var%20bodyA%20%3D%20fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20fixtureB.GetBody()%3B%0A%20%20%20%20%20%20if%20(c.IsTouching())%20%7B%0A%20%20%20%20%20%20%20%20this.m_contactListener.EndContact(c)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_prev)%20%7B%0A%20%20%20%20%20%20%20%20c.m_prev.m_next%20%3D%20c.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_next)%20%7B%0A%20%20%20%20%20%20%20%20c.m_next.m_prev%20%3D%20c.m_prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c%20%3D%3D%20this.m_world.m_contactList)%20%7B%0A%20%20%20%20%20%20%20%20this.m_world.m_contactList%20%3D%20c.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_nodeA.prev)%20%7B%0A%20%20%20%20%20%20%20%20c.m_nodeA.prev.next%20%3D%20c.m_nodeA.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_nodeA.next)%20%7B%0A%20%20%20%20%20%20%20%20c.m_nodeA.next.prev%20%3D%20c.m_nodeA.prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_nodeA%20%3D%3D%20bodyA.m_contactList)%20%7B%0A%20%20%20%20%20%20%20%20bodyA.m_contactList%20%3D%20c.m_nodeA.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_nodeB.prev)%20%7B%0A%20%20%20%20%20%20%20%20c.m_nodeB.prev.next%20%3D%20c.m_nodeB.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_nodeB.next)%20%7B%0A%20%20%20%20%20%20%20%20c.m_nodeB.next.prev%20%3D%20c.m_nodeB.prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(c.m_nodeB%20%3D%3D%20bodyB.m_contactList)%20%7B%0A%20%20%20%20%20%20%20%20bodyB.m_contactList%20%3D%20c.m_nodeB.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_contactFactory.Destroy(c)%3B%0A%20%20%20%20%20%20--this.m_contactCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactManager.prototype.Collide%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20c%20%3D%20this.m_world.m_contactList%3B%0A%20%20%20%20%20%20while%20(c)%20%7B%0A%20%20%20%20%20%20%20%20var%20fixtureA%20%3D%20c.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20var%20fixtureB%20%3D%20c.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20var%20bodyA%20%3D%20fixtureA.GetBody()%3B%0A%20%20%20%20%20%20%20%20var%20bodyB%20%3D%20fixtureB.GetBody()%3B%0A%20%20%20%20%20%20%20%20if%20(bodyA.IsAwake()%20%3D%3D%20false%20%26%26%20bodyB.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20c%20%3D%20c.GetNext()%3B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(c.m_flags%20%26%20b2Contact.e_filterFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(bodyB.ShouldCollide(bodyA)%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20cNuke%20%3D%20c%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20c%20%3D%20cNuke.GetNext()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.Destroy(cNuke)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_contactFilter.ShouldCollide(fixtureA%2C%20fixtureB)%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20cNuke%20%3D%20c%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20c%20%3D%20cNuke.GetNext()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.Destroy(cNuke)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20c.m_flags%20%26%3D%20~b2Contact.e_filterFlag%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20proxyA%20%3D%20fixtureA.m_proxy%3B%0A%20%20%20%20%20%20%20%20var%20proxyB%20%3D%20fixtureB.m_proxy%3B%0A%20%20%20%20%20%20%20%20var%20overlap%20%3D%20this.m_broadPhase.TestOverlap(proxyA%2C%20proxyB)%3B%0A%20%20%20%20%20%20%20%20if%20(overlap%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20cNuke%20%3D%20c%3B%0A%20%20%20%20%20%20%20%20%20%20c%20%3D%20cNuke.GetNext()%3B%0A%20%20%20%20%20%20%20%20%20%20this.Destroy(cNuke)%3B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20c.Update(this.m_contactListener)%3B%0A%20%20%20%20%20%20%20%20c%20%3D%20c.GetNext()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2ContactManager.s_evalCP%20%3D%20new%20b2ContactPoint()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2DebugDraw.b2DebugDraw%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.b2DebugDraw%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetFlags%20%3D%20function%20(flags)%20%7B%0A%20%20%20%20%20%20if%20(flags%20%3D%3D%3D%20undefined)%20flags%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetFlags%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.AppendFlags%20%3D%20function%20(flags)%20%7B%0A%20%20%20%20%20%20if%20(flags%20%3D%3D%3D%20undefined)%20flags%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.ClearFlags%20%3D%20function%20(flags)%20%7B%0A%20%20%20%20%20%20if%20(flags%20%3D%3D%3D%20undefined)%20flags%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetSprite%20%3D%20function%20(sprite)%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetSprite%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetDrawScale%20%3D%20function%20(drawScale)%20%7B%0A%20%20%20%20%20%20if%20(drawScale%20%3D%3D%3D%20undefined)%20drawScale%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetDrawScale%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetLineThickness%20%3D%20function%20(lineThickness)%20%7B%0A%20%20%20%20%20%20if%20(lineThickness%20%3D%3D%3D%20undefined)%20lineThickness%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetLineThickness%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetAlpha%20%3D%20function%20(alpha)%20%7B%0A%20%20%20%20%20%20if%20(alpha%20%3D%3D%3D%20undefined)%20alpha%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetAlpha%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetFillAlpha%20%3D%20function%20(alpha)%20%7B%0A%20%20%20%20%20%20if%20(alpha%20%3D%3D%3D%20undefined)%20alpha%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetFillAlpha%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetXFormScale%20%3D%20function%20(xformScale)%20%7B%0A%20%20%20%20%20%20if%20(xformScale%20%3D%3D%3D%20undefined)%20xformScale%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetXFormScale%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawPolygon%20%3D%20function%20(vertices%2C%20vertexCount%2C%20color)%20%7B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%3D%20undefined)%20vertexCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawSolidPolygon%20%3D%20function%20(%0A%20%20%20%20%20%20vertices%2C%0A%20%20%20%20%20%20vertexCount%2C%0A%20%20%20%20%20%20color%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(vertexCount%20%3D%3D%3D%20undefined)%20vertexCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawCircle%20%3D%20function%20(center%2C%20radius%2C%20color)%20%7B%0A%20%20%20%20%20%20if%20(radius%20%3D%3D%3D%20undefined)%20radius%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawSolidCircle%20%3D%20function%20(%0A%20%20%20%20%20%20center%2C%0A%20%20%20%20%20%20radius%2C%0A%20%20%20%20%20%20axis%2C%0A%20%20%20%20%20%20color%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(radius%20%3D%3D%3D%20undefined)%20radius%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawSegment%20%3D%20function%20(p1%2C%20p2%2C%20color)%20%7B%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawTransform%20%3D%20function%20(xf)%20%7B%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2DebugDraw.e_shapeBit%20%3D%200x0001%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2DebugDraw.e_jointBit%20%3D%200x0002%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2DebugDraw.e_aabbBit%20%3D%200x0004%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2DebugDraw.e_pairBit%20%3D%200x0008%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit%20%3D%200x0010%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2DebugDraw.e_controllerBit%20%3D%200x0020%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2DestructionListener.b2DestructionListener%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2DestructionListener.prototype.SayGoodbyeJoint%20%3D%20function%20(joint)%20%7B%7D%3B%0A%20%20%20%20b2DestructionListener.prototype.SayGoodbyeFixture%20%3D%20function%20(fixture)%20%7B%7D%3B%0A%20%20%20%20b2FilterData.b2FilterData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.categoryBits%20%3D%200x0001%3B%0A%20%20%20%20%20%20this.maskBits%20%3D%200xffff%3B%0A%20%20%20%20%20%20this.groupIndex%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FilterData.prototype.Copy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20copy%20%3D%20new%20b2FilterData()%3B%0A%20%20%20%20%20%20copy.categoryBits%20%3D%20this.categoryBits%3B%0A%20%20%20%20%20%20copy.maskBits%20%3D%20this.maskBits%3B%0A%20%20%20%20%20%20copy.groupIndex%20%3D%20this.groupIndex%3B%0A%20%20%20%20%20%20return%20copy%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.b2Fixture%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_filter%20%3D%20new%20b2FilterData()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetType%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_shape.GetType()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetShape%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_shape%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.SetSensor%20%3D%20function%20(sensor)%20%7B%0A%20%20%20%20%20%20if%20(this.m_isSensor%20%3D%3D%20sensor)%20return%3B%0A%20%20%20%20%20%20this.m_isSensor%20%3D%20sensor%3B%0A%20%20%20%20%20%20if%20(this.m_body%20%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20var%20edge%20%3D%20this.m_body.GetContactList()%3B%0A%20%20%20%20%20%20while%20(edge)%20%7B%0A%20%20%20%20%20%20%20%20var%20contact%20%3D%20edge.contact%3B%0A%20%20%20%20%20%20%20%20var%20fixtureA%20%3D%20contact.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20var%20fixtureB%20%3D%20contact.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20if%20(fixtureA%20%3D%3D%20this%20%7C%7C%20fixtureB%20%3D%3D%20this)%0A%20%20%20%20%20%20%20%20%20%20contact.SetSensor(fixtureA.IsSensor()%20%7C%7C%20fixtureB.IsSensor())%3B%0A%20%20%20%20%20%20%20%20edge%20%3D%20edge.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.IsSensor%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_isSensor%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.SetFilterData%20%3D%20function%20(filter)%20%7B%0A%20%20%20%20%20%20this.m_filter%20%3D%20filter.Copy()%3B%0A%20%20%20%20%20%20if%20(this.m_body)%20return%3B%0A%20%20%20%20%20%20var%20edge%20%3D%20this.m_body.GetContactList()%3B%0A%20%20%20%20%20%20while%20(edge)%20%7B%0A%20%20%20%20%20%20%20%20var%20contact%20%3D%20edge.contact%3B%0A%20%20%20%20%20%20%20%20var%20fixtureA%20%3D%20contact.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20var%20fixtureB%20%3D%20contact.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20if%20(fixtureA%20%3D%3D%20this%20%7C%7C%20fixtureB%20%3D%3D%20this)%20contact.FlagForFiltering()%3B%0A%20%20%20%20%20%20%20%20edge%20%3D%20edge.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetFilterData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_filter.Copy()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetBody%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_body%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetNext%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_next%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetUserData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_userData%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.SetUserData%20%3D%20function%20(data)%20%7B%0A%20%20%20%20%20%20this.m_userData%20%3D%20data%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.TestPoint%20%3D%20function%20(p)%20%7B%0A%20%20%20%20%20%20return%20this.m_shape.TestPoint(this.m_body.GetTransform()%2C%20p)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.RayCast%20%3D%20function%20(output%2C%20input)%20%7B%0A%20%20%20%20%20%20return%20this.m_shape.RayCast(output%2C%20input%2C%20this.m_body.GetTransform())%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetMassData%20%3D%20function%20(massData)%20%7B%0A%20%20%20%20%20%20if%20(massData%20%3D%3D%3D%20undefined)%20massData%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(massData%20%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20massData%20%3D%20new%20b2MassData()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_shape.ComputeMass(massData%2C%20this.m_density)%3B%0A%20%20%20%20%20%20return%20massData%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.SetDensity%20%3D%20function%20(density)%20%7B%0A%20%20%20%20%20%20if%20(density%20%3D%3D%3D%20undefined)%20density%20%3D%200%3B%0A%20%20%20%20%20%20this.m_density%20%3D%20density%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetDensity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_density%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetFriction%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_friction%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.SetFriction%20%3D%20function%20(friction)%20%7B%0A%20%20%20%20%20%20if%20(friction%20%3D%3D%3D%20undefined)%20friction%20%3D%200%3B%0A%20%20%20%20%20%20this.m_friction%20%3D%20friction%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetRestitution%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_restitution%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.SetRestitution%20%3D%20function%20(restitution)%20%7B%0A%20%20%20%20%20%20if%20(restitution%20%3D%3D%3D%20undefined)%20restitution%20%3D%200%3B%0A%20%20%20%20%20%20this.m_restitution%20%3D%20restitution%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.GetAABB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_aabb%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.b2Fixture%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_aabb%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20this.m_userData%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_body%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_shape%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_density%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_friction%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_restitution%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.Create%20%3D%20function%20(body%2C%20xf%2C%20def)%20%7B%0A%20%20%20%20%20%20this.m_userData%20%3D%20def.userData%3B%0A%20%20%20%20%20%20this.m_friction%20%3D%20def.friction%3B%0A%20%20%20%20%20%20this.m_restitution%20%3D%20def.restitution%3B%0A%20%20%20%20%20%20this.m_body%20%3D%20body%3B%0A%20%20%20%20%20%20this.m_next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_filter%20%3D%20def.filter.Copy()%3B%0A%20%20%20%20%20%20this.m_isSensor%20%3D%20def.isSensor%3B%0A%20%20%20%20%20%20this.m_shape%20%3D%20def.shape.Copy()%3B%0A%20%20%20%20%20%20this.m_density%20%3D%20def.density%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.Destroy%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_shape%20%3D%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.CreateProxy%20%3D%20function%20(broadPhase%2C%20xf)%20%7B%0A%20%20%20%20%20%20this.m_shape.ComputeAABB(this.m_aabb%2C%20xf)%3B%0A%20%20%20%20%20%20this.m_proxy%20%3D%20broadPhase.CreateProxy(this.m_aabb%2C%20this)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.DestroyProxy%20%3D%20function%20(broadPhase)%20%7B%0A%20%20%20%20%20%20if%20(this.m_proxy%20%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20broadPhase.DestroyProxy(this.m_proxy)%3B%0A%20%20%20%20%20%20this.m_proxy%20%3D%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Fixture.prototype.Synchronize%20%3D%20function%20(%0A%20%20%20%20%20%20broadPhase%2C%0A%20%20%20%20%20%20transform1%2C%0A%20%20%20%20%20%20transform2%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(!this.m_proxy)%20return%3B%0A%20%20%20%20%20%20var%20aabb1%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20var%20aabb2%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20this.m_shape.ComputeAABB(aabb1%2C%20transform1)%3B%0A%20%20%20%20%20%20this.m_shape.ComputeAABB(aabb2%2C%20transform2)%3B%0A%20%20%20%20%20%20this.m_aabb.Combine(aabb1%2C%20aabb2)%3B%0A%20%20%20%20%20%20var%20displacement%20%3D%20b2Math.SubtractVV(%0A%20%20%20%20%20%20%20%20transform2.position%2C%0A%20%20%20%20%20%20%20%20transform1.position%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20broadPhase.MoveProxy(this.m_proxy%2C%20this.m_aabb%2C%20displacement)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FixtureDef.b2FixtureDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.filter%20%3D%20new%20b2FilterData()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FixtureDef.prototype.b2FixtureDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.shape%20%3D%20null%3B%0A%20%20%20%20%20%20this.userData%20%3D%20null%3B%0A%20%20%20%20%20%20this.friction%20%3D%200.2%3B%0A%20%20%20%20%20%20this.restitution%20%3D%200.0%3B%0A%20%20%20%20%20%20this.density%20%3D%200.0%3B%0A%20%20%20%20%20%20this.filter.categoryBits%20%3D%200x0001%3B%0A%20%20%20%20%20%20this.filter.maskBits%20%3D%200xffff%3B%0A%20%20%20%20%20%20this.filter.groupIndex%20%3D%200%3B%0A%20%20%20%20%20%20this.isSensor%20%3D%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.b2Island%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Island.prototype.b2Island%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_bodies%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20this.m_contacts%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20this.m_joints%20%3D%20new%20Vector()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.Initialize%20%3D%20function%20(%0A%20%20%20%20%20%20bodyCapacity%2C%0A%20%20%20%20%20%20contactCapacity%2C%0A%20%20%20%20%20%20jointCapacity%2C%0A%20%20%20%20%20%20allocator%2C%0A%20%20%20%20%20%20listener%2C%0A%20%20%20%20%20%20contactSolver%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(bodyCapacity%20%3D%3D%3D%20undefined)%20bodyCapacity%20%3D%200%3B%0A%20%20%20%20%20%20if%20(contactCapacity%20%3D%3D%3D%20undefined)%20contactCapacity%20%3D%200%3B%0A%20%20%20%20%20%20if%20(jointCapacity%20%3D%3D%3D%20undefined)%20jointCapacity%20%3D%200%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyCapacity%20%3D%20bodyCapacity%3B%0A%20%20%20%20%20%20this.m_contactCapacity%20%3D%20contactCapacity%3B%0A%20%20%20%20%20%20this.m_jointCapacity%20%3D%20jointCapacity%3B%0A%20%20%20%20%20%20this.m_bodyCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_contactCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_jointCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_allocator%20%3D%20allocator%3B%0A%20%20%20%20%20%20this.m_listener%20%3D%20listener%3B%0A%20%20%20%20%20%20this.m_contactSolver%20%3D%20contactSolver%3B%0A%20%20%20%20%20%20for%20(i%20%3D%20this.m_bodies.length%3B%20i%20%3C%20bodyCapacity%3B%20i%2B%2B)%0A%20%20%20%20%20%20%20%20this.m_bodies%5Bi%5D%20%3D%20null%3B%0A%20%20%20%20%20%20for%20(i%20%3D%20this.m_contacts.length%3B%20i%20%3C%20contactCapacity%3B%20i%2B%2B)%0A%20%20%20%20%20%20%20%20this.m_contacts%5Bi%5D%20%3D%20null%3B%0A%20%20%20%20%20%20for%20(i%20%3D%20this.m_joints.length%3B%20i%20%3C%20jointCapacity%3B%20i%2B%2B)%0A%20%20%20%20%20%20%20%20this.m_joints%5Bi%5D%20%3D%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.Clear%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_bodyCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_contactCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_jointCount%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.Solve%20%3D%20function%20(step%2C%20gravity%2C%20allowSleep)%20%7B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20j%20%3D%200%3B%0A%20%20%20%20%20%20var%20b%3B%0A%20%20%20%20%20%20var%20joint%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20b%20%3D%20this.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20if%20(b.GetType()%20!%3D%20b2Body.b2_dynamicBody)%20continue%3B%0A%20%20%20%20%20%20%20%20b.m_linearVelocity.x%20%2B%3D%20step.dt%20*%20(gravity.x%20%2B%20b.m_invMass%20*%20b.m_force.x)%3B%0A%20%20%20%20%20%20%20%20b.m_linearVelocity.y%20%2B%3D%20step.dt%20*%20(gravity.y%20%2B%20b.m_invMass%20*%20b.m_force.y)%3B%0A%20%20%20%20%20%20%20%20b.m_angularVelocity%20%2B%3D%20step.dt%20*%20b.m_invI%20*%20b.m_torque%3B%0A%20%20%20%20%20%20%20%20b.m_linearVelocity.Multiply(%0A%20%20%20%20%20%20%20%20%20%20b2Math.Clamp(1.0%20-%20step.dt%20*%20b.m_linearDamping%2C%200.0%2C%201.0)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20b.m_angularVelocity%20*%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%201.0%20-%20step.dt%20*%20b.m_angularDamping%2C%0A%20%20%20%20%20%20%20%20%20%200.0%2C%0A%20%20%20%20%20%20%20%20%20%201.0%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_contactSolver.Initialize(%0A%20%20%20%20%20%20%20%20step%2C%0A%20%20%20%20%20%20%20%20this.m_contacts%2C%0A%20%20%20%20%20%20%20%20this.m_contactCount%2C%0A%20%20%20%20%20%20%20%20this.m_allocator%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20contactSolver%20%3D%20this.m_contactSolver%3B%0A%20%20%20%20%20%20contactSolver.InitVelocityConstraints(step)%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_jointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20joint%20%3D%20this.m_joints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20joint.InitVelocityConstraints(step)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20step.velocityIterations%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20this.m_jointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20joint%20%3D%20this.m_joints%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20joint.SolveVelocityConstraints(step)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20contactSolver.SolveVelocityConstraints()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_jointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20joint%20%3D%20this.m_joints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20joint.FinalizeVelocityConstraints()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20contactSolver.FinalizeVelocityConstraints()%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20b%20%3D%20this.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20continue%3B%0A%20%20%20%20%20%20%20%20var%20translationX%20%3D%20step.dt%20*%20b.m_linearVelocity.x%3B%0A%20%20%20%20%20%20%20%20var%20translationY%20%3D%20step.dt%20*%20b.m_linearVelocity.y%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20translationX%20*%20translationX%20%2B%20translationY%20*%20translationY%20%3E%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxTranslationSquared%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b.m_linearVelocity.Normalize()%3B%0A%20%20%20%20%20%20%20%20%20%20b.m_linearVelocity.x%20*%3D%20b2Settings.b2_maxTranslation%20*%20step.inv_dt%3B%0A%20%20%20%20%20%20%20%20%20%20b.m_linearVelocity.y%20*%3D%20b2Settings.b2_maxTranslation%20*%20step.inv_dt%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20rotation%20%3D%20step.dt%20*%20b.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20if%20(rotation%20*%20rotation%20%3E%20b2Settings.b2_maxRotationSquared)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.m_angularVelocity%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_angularVelocity%20%3D%20-b2Settings.b2_maxRotation%20*%20step.inv_dt%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_angularVelocity%20%3D%20b2Settings.b2_maxRotation%20*%20step.inv_dt%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20b.m_sweep.c0.SetV(b.m_sweep.c)%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.a0%20%3D%20b.m_sweep.a%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.c.x%20%2B%3D%20step.dt%20*%20b.m_linearVelocity.x%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.c.y%20%2B%3D%20step.dt%20*%20b.m_linearVelocity.y%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.a%20%2B%3D%20step.dt%20*%20b.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20b.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20step.positionIterations%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20contactsOkay%20%3D%20contactSolver.SolvePositionConstraints(%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2_contactBaumgarte%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20jointsOkay%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20this.m_jointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20joint%20%3D%20this.m_joints%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20jointOkay%20%3D%20joint.SolvePositionConstraints(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_contactBaumgarte%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20jointsOkay%20%3D%20jointsOkay%20%26%26%20jointOkay%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(contactsOkay%20%26%26%20jointsOkay)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.Report(contactSolver.m_constraints)%3B%0A%20%20%20%20%20%20if%20(allowSleep)%20%7B%0A%20%20%20%20%20%20%20%20var%20minSleepTime%20%3D%20Number.MAX_VALUE%3B%0A%20%20%20%20%20%20%20%20var%20linTolSqr%20%3D%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2_linearSleepTolerance%20*%20b2Settings.b2_linearSleepTolerance%3B%0A%20%20%20%20%20%20%20%20var%20angTolSqr%20%3D%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2_angularSleepTolerance%20*%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2_angularSleepTolerance%3B%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b%20%3D%20this.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20((b.m_flags%20%26%20b2Body.e_allowSleepFlag)%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_sleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20minSleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20(b.m_flags%20%26%20b2Body.e_allowSleepFlag)%20%3D%3D%200%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_angularVelocity%20*%20b.m_angularVelocity%20%3E%20angTolSqr%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Math.Dot(b.m_linearVelocity%2C%20b.m_linearVelocity)%20%3E%20linTolSqr%0A%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_sleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20minSleepTime%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_sleepTime%20%2B%3D%20step.dt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20minSleepTime%20%3D%20b2Math.Min(minSleepTime%2C%20b.m_sleepTime)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(minSleepTime%20%3E%3D%20b2Settings.b2_timeToSleep)%20%7B%0A%20%20%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b%20%3D%20this.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.SetAwake(false)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.SolveTOI%20%3D%20function%20(subStep)%20%7B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20j%20%3D%200%3B%0A%20%20%20%20%20%20this.m_contactSolver.Initialize(%0A%20%20%20%20%20%20%20%20subStep%2C%0A%20%20%20%20%20%20%20%20this.m_contacts%2C%0A%20%20%20%20%20%20%20%20this.m_contactCount%2C%0A%20%20%20%20%20%20%20%20this.m_allocator%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20contactSolver%20%3D%20this.m_contactSolver%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_jointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20this.m_joints%5Bi%5D.InitVelocityConstraints(subStep)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20subStep.velocityIterations%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20contactSolver.SolveVelocityConstraints()%3B%0A%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20this.m_jointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_joints%5Bj%5D.SolveVelocityConstraints(subStep)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20this.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20b%20%3D%20this.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20continue%3B%0A%20%20%20%20%20%20%20%20var%20translationX%20%3D%20subStep.dt%20*%20b.m_linearVelocity.x%3B%0A%20%20%20%20%20%20%20%20var%20translationY%20%3D%20subStep.dt%20*%20b.m_linearVelocity.y%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20translationX%20*%20translationX%20%2B%20translationY%20*%20translationY%20%3E%0A%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxTranslationSquared%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b.m_linearVelocity.Normalize()%3B%0A%20%20%20%20%20%20%20%20%20%20b.m_linearVelocity.x%20*%3D%20b2Settings.b2_maxTranslation%20*%20subStep.inv_dt%3B%0A%20%20%20%20%20%20%20%20%20%20b.m_linearVelocity.y%20*%3D%20b2Settings.b2_maxTranslation%20*%20subStep.inv_dt%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20rotation%20%3D%20subStep.dt%20*%20b.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20if%20(rotation%20*%20rotation%20%3E%20b2Settings.b2_maxRotationSquared)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.m_angularVelocity%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_angularVelocity%20%3D%20-b2Settings.b2_maxRotation%20*%20subStep.inv_dt%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_angularVelocity%20%3D%20b2Settings.b2_maxRotation%20*%20subStep.inv_dt%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20b.m_sweep.c0.SetV(b.m_sweep.c)%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.a0%20%3D%20b.m_sweep.a%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.c.x%20%2B%3D%20subStep.dt%20*%20b.m_linearVelocity.x%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.c.y%20%2B%3D%20subStep.dt%20*%20b.m_linearVelocity.y%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.a%20%2B%3D%20subStep.dt%20*%20b.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20b.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20k_toiBaumgarte%20%3D%200.75%3B%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20subStep.positionIterations%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20contactsOkay%20%3D%20contactSolver.SolvePositionConstraints(k_toiBaumgarte)%3B%0A%20%20%20%20%20%20%20%20var%20jointsOkay%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20this.m_jointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20jointOkay%20%3D%20this.m_joints%5Bj%5D.SolvePositionConstraints(%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_contactBaumgarte%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20jointsOkay%20%3D%20jointsOkay%20%26%26%20jointOkay%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(contactsOkay%20%26%26%20jointsOkay)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.Report(contactSolver.m_constraints)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.Report%20%3D%20function%20(constraints)%20%7B%0A%20%20%20%20%20%20if%20(this.m_listener%20%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_contactCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20this.m_contacts%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20cc%20%3D%20constraints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20for%20(var%20j%20%3D%200%3B%20j%20%3C%20cc.pointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b2Island.s_impulse.normalImpulses%5Bj%5D%20%3D%20cc.points%5Bj%5D.normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20b2Island.s_impulse.tangentImpulses%5Bj%5D%20%3D%20cc.points%5Bj%5D.tangentImpulse%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.m_listener.PostSolve(c%2C%20b2Island.s_impulse)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.AddBody%20%3D%20function%20(body)%20%7B%0A%20%20%20%20%20%20body.m_islandIndex%20%3D%20this.m_bodyCount%3B%0A%20%20%20%20%20%20this.m_bodies%5Bthis.m_bodyCount%2B%2B%5D%20%3D%20body%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.AddContact%20%3D%20function%20(contact)%20%7B%0A%20%20%20%20%20%20this.m_contacts%5Bthis.m_contactCount%2B%2B%5D%20%3D%20contact%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Island.prototype.AddJoint%20%3D%20function%20(joint)%20%7B%0A%20%20%20%20%20%20this.m_joints%5Bthis.m_jointCount%2B%2B%5D%20%3D%20joint%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2Island.s_impulse%20%3D%20new%20b2ContactImpulse()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2TimeStep.b2TimeStep%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2TimeStep.prototype.Set%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20this.dt%20%3D%20step.dt%3B%0A%20%20%20%20%20%20this.inv_dt%20%3D%20step.inv_dt%3B%0A%20%20%20%20%20%20this.positionIterations%20%3D%20step.positionIterations%3B%0A%20%20%20%20%20%20this.velocityIterations%20%3D%20step.velocityIterations%3B%0A%20%20%20%20%20%20this.warmStarting%20%3D%20step.warmStarting%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.b2World%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.s_stack%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20this.m_contactManager%20%3D%20new%20b2ContactManager()%3B%0A%20%20%20%20%20%20this.m_contactSolver%20%3D%20new%20b2ContactSolver()%3B%0A%20%20%20%20%20%20this.m_island%20%3D%20new%20b2Island()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.b2World%20%3D%20function%20(gravity%2C%20doSleep)%20%7B%0A%20%20%20%20%20%20this.m_destructionListener%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_debugDraw%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_bodyList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_contactList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_jointList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_controllerList%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_bodyCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_contactCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_jointCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_controllerCount%20%3D%200%3B%0A%20%20%20%20%20%20b2World.m_warmStarting%20%3D%20true%3B%0A%20%20%20%20%20%20b2World.m_continuousPhysics%20%3D%20true%3B%0A%20%20%20%20%20%20this.m_allowSleep%20%3D%20doSleep%3B%0A%20%20%20%20%20%20this.m_gravity%20%3D%20gravity%3B%0A%20%20%20%20%20%20this.m_inv_dt0%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_contactManager.m_world%20%3D%20this%3B%0A%20%20%20%20%20%20var%20bd%20%3D%20new%20b2BodyDef()%3B%0A%20%20%20%20%20%20this.m_groundBody%20%3D%20this.CreateBody(bd)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetDestructionListener%20%3D%20function%20(listener)%20%7B%0A%20%20%20%20%20%20this.m_destructionListener%20%3D%20listener%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetContactFilter%20%3D%20function%20(filter)%20%7B%0A%20%20%20%20%20%20this.m_contactManager.m_contactFilter%20%3D%20filter%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetContactListener%20%3D%20function%20(listener)%20%7B%0A%20%20%20%20%20%20this.m_contactManager.m_contactListener%20%3D%20listener%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetDebugDraw%20%3D%20function%20(debugDraw)%20%7B%0A%20%20%20%20%20%20this.m_debugDraw%20%3D%20debugDraw%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetBroadPhase%20%3D%20function%20(broadPhase)%20%7B%0A%20%20%20%20%20%20var%20oldBroadPhase%20%3D%20this.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20this.m_contactManager.m_broadPhase%20%3D%20broadPhase%3B%0A%20%20%20%20%20%20for%20(var%20b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20for%20(var%20f%20%3D%20b.m_fixtureList%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20f.m_proxy%20%3D%20broadPhase.CreateProxy(%0A%20%20%20%20%20%20%20%20%20%20%20%20oldBroadPhase.GetFatAABB(f.m_proxy)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20f%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.Validate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_contactManager.m_broadPhase.Validate()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetProxyCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_contactManager.m_broadPhase.GetProxyCount()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.CreateBody%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20if%20(this.IsLocked()%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20b%20%3D%20new%20b2Body(def%2C%20this)%3B%0A%20%20%20%20%20%20b.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20b.m_next%20%3D%20this.m_bodyList%3B%0A%20%20%20%20%20%20if%20(this.m_bodyList)%20%7B%0A%20%20%20%20%20%20%20%20this.m_bodyList.m_prev%20%3D%20b%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_bodyList%20%3D%20b%3B%0A%20%20%20%20%20%20%2B%2Bthis.m_bodyCount%3B%0A%20%20%20%20%20%20return%20b%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.DestroyBody%20%3D%20function%20(b)%20%7B%0A%20%20%20%20%20%20if%20(this.IsLocked()%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20jn%20%3D%20b.m_jointList%3B%0A%20%20%20%20%20%20while%20(jn)%20%7B%0A%20%20%20%20%20%20%20%20var%20jn0%20%3D%20jn%3B%0A%20%20%20%20%20%20%20%20jn%20%3D%20jn.next%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_destructionListener)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_destructionListener.SayGoodbyeJoint(jn0.joint)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.DestroyJoint(jn0.joint)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20coe%20%3D%20b.m_controllerList%3B%0A%20%20%20%20%20%20while%20(coe)%20%7B%0A%20%20%20%20%20%20%20%20var%20coe0%20%3D%20coe%3B%0A%20%20%20%20%20%20%20%20coe%20%3D%20coe.nextController%3B%0A%20%20%20%20%20%20%20%20coe0.controller.RemoveBody(b)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20ce%20%3D%20b.m_contactList%3B%0A%20%20%20%20%20%20while%20(ce)%20%7B%0A%20%20%20%20%20%20%20%20var%20ce0%20%3D%20ce%3B%0A%20%20%20%20%20%20%20%20ce%20%3D%20ce.next%3B%0A%20%20%20%20%20%20%20%20this.m_contactManager.Destroy(ce0.contact)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20b.m_contactList%20%3D%20null%3B%0A%20%20%20%20%20%20var%20f%20%3D%20b.m_fixtureList%3B%0A%20%20%20%20%20%20while%20(f)%20%7B%0A%20%20%20%20%20%20%20%20var%20f0%20%3D%20f%3B%0A%20%20%20%20%20%20%20%20f%20%3D%20f.m_next%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_destructionListener)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_destructionListener.SayGoodbyeFixture(f0)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20f0.DestroyProxy(this.m_contactManager.m_broadPhase)%3B%0A%20%20%20%20%20%20%20%20f0.Destroy()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20b.m_fixtureList%20%3D%20null%3B%0A%20%20%20%20%20%20b.m_fixtureCount%20%3D%200%3B%0A%20%20%20%20%20%20if%20(b.m_prev)%20%7B%0A%20%20%20%20%20%20%20%20b.m_prev.m_next%20%3D%20b.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20b.m_next.m_prev%20%3D%20b.m_prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(b%20%3D%3D%20this.m_bodyList)%20%7B%0A%20%20%20%20%20%20%20%20this.m_bodyList%20%3D%20b.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20--this.m_bodyCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.CreateJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20var%20j%20%3D%20b2Joint.Create(def%2C%20null)%3B%0A%20%20%20%20%20%20j.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20j.m_next%20%3D%20this.m_jointList%3B%0A%20%20%20%20%20%20if%20(this.m_jointList)%20%7B%0A%20%20%20%20%20%20%20%20this.m_jointList.m_prev%20%3D%20j%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_jointList%20%3D%20j%3B%0A%20%20%20%20%20%20%2B%2Bthis.m_jointCount%3B%0A%20%20%20%20%20%20j.m_edgeA.joint%20%3D%20j%3B%0A%20%20%20%20%20%20j.m_edgeA.other%20%3D%20j.m_bodyB%3B%0A%20%20%20%20%20%20j.m_edgeA.prev%20%3D%20null%3B%0A%20%20%20%20%20%20j.m_edgeA.next%20%3D%20j.m_bodyA.m_jointList%3B%0A%20%20%20%20%20%20if%20(j.m_bodyA.m_jointList)%20j.m_bodyA.m_jointList.prev%20%3D%20j.m_edgeA%3B%0A%20%20%20%20%20%20j.m_bodyA.m_jointList%20%3D%20j.m_edgeA%3B%0A%20%20%20%20%20%20j.m_edgeB.joint%20%3D%20j%3B%0A%20%20%20%20%20%20j.m_edgeB.other%20%3D%20j.m_bodyA%3B%0A%20%20%20%20%20%20j.m_edgeB.prev%20%3D%20null%3B%0A%20%20%20%20%20%20j.m_edgeB.next%20%3D%20j.m_bodyB.m_jointList%3B%0A%20%20%20%20%20%20if%20(j.m_bodyB.m_jointList)%20j.m_bodyB.m_jointList.prev%20%3D%20j.m_edgeB%3B%0A%20%20%20%20%20%20j.m_bodyB.m_jointList%20%3D%20j.m_edgeB%3B%0A%20%20%20%20%20%20var%20bodyA%20%3D%20def.bodyA%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20def.bodyB%3B%0A%20%20%20%20%20%20if%20(def.collideConnected%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20var%20edge%20%3D%20bodyB.GetContactList()%3B%0A%20%20%20%20%20%20%20%20while%20(edge)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(edge.other%20%3D%3D%20bodyA)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20edge.contact.FlagForFiltering()%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20edge%20%3D%20edge.next%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20j%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.DestroyJoint%20%3D%20function%20(j)%20%7B%0A%20%20%20%20%20%20var%20collideConnected%20%3D%20j.m_collideConnected%3B%0A%20%20%20%20%20%20if%20(j.m_prev)%20%7B%0A%20%20%20%20%20%20%20%20j.m_prev.m_next%20%3D%20j.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(j.m_next)%20%7B%0A%20%20%20%20%20%20%20%20j.m_next.m_prev%20%3D%20j.m_prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(j%20%3D%3D%20this.m_jointList)%20%7B%0A%20%20%20%20%20%20%20%20this.m_jointList%20%3D%20j.m_next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20bodyA%20%3D%20j.m_bodyA%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20j.m_bodyB%3B%0A%20%20%20%20%20%20bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20if%20(j.m_edgeA.prev)%20%7B%0A%20%20%20%20%20%20%20%20j.m_edgeA.prev.next%20%3D%20j.m_edgeA.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(j.m_edgeA.next)%20%7B%0A%20%20%20%20%20%20%20%20j.m_edgeA.next.prev%20%3D%20j.m_edgeA.prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(j.m_edgeA%20%3D%3D%20bodyA.m_jointList)%20%7B%0A%20%20%20%20%20%20%20%20bodyA.m_jointList%20%3D%20j.m_edgeA.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20j.m_edgeA.prev%20%3D%20null%3B%0A%20%20%20%20%20%20j.m_edgeA.next%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(j.m_edgeB.prev)%20%7B%0A%20%20%20%20%20%20%20%20j.m_edgeB.prev.next%20%3D%20j.m_edgeB.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(j.m_edgeB.next)%20%7B%0A%20%20%20%20%20%20%20%20j.m_edgeB.next.prev%20%3D%20j.m_edgeB.prev%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(j.m_edgeB%20%3D%3D%20bodyB.m_jointList)%20%7B%0A%20%20%20%20%20%20%20%20bodyB.m_jointList%20%3D%20j.m_edgeB.next%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20j.m_edgeB.prev%20%3D%20null%3B%0A%20%20%20%20%20%20j.m_edgeB.next%20%3D%20null%3B%0A%20%20%20%20%20%20b2Joint.Destroy(j%2C%20null)%3B%0A%20%20%20%20%20%20--this.m_jointCount%3B%0A%20%20%20%20%20%20if%20(collideConnected%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20var%20edge%20%3D%20bodyB.GetContactList()%3B%0A%20%20%20%20%20%20%20%20while%20(edge)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(edge.other%20%3D%3D%20bodyA)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20edge.contact.FlagForFiltering()%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20edge%20%3D%20edge.next%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.AddController%20%3D%20function%20(c)%20%7B%0A%20%20%20%20%20%20c.m_next%20%3D%20this.m_controllerList%3B%0A%20%20%20%20%20%20c.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_controllerList%20%3D%20c%3B%0A%20%20%20%20%20%20c.m_world%20%3D%20this%3B%0A%20%20%20%20%20%20this.m_controllerCount%2B%2B%3B%0A%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.RemoveController%20%3D%20function%20(c)%20%7B%0A%20%20%20%20%20%20if%20(c.m_prev)%20c.m_prev.m_next%20%3D%20c.m_next%3B%0A%20%20%20%20%20%20if%20(c.m_next)%20c.m_next.m_prev%20%3D%20c.m_prev%3B%0A%20%20%20%20%20%20if%20(this.m_controllerList%20%3D%3D%20c)%20this.m_controllerList%20%3D%20c.m_next%3B%0A%20%20%20%20%20%20this.m_controllerCount--%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.CreateController%20%3D%20function%20(controller)%20%7B%0A%20%20%20%20%20%20if%20(controller.m_world%20!%3D%20this)%0A%20%20%20%20%20%20%20%20throw%20new%20Error(%22Controller%20can%20only%20be%20a%20member%20of%20one%20world%22)%3B%0A%20%20%20%20%20%20controller.m_next%20%3D%20this.m_controllerList%3B%0A%20%20%20%20%20%20controller.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(this.m_controllerList)%20this.m_controllerList.m_prev%20%3D%20controller%3B%0A%20%20%20%20%20%20this.m_controllerList%20%3D%20controller%3B%0A%20%20%20%20%20%20%2B%2Bthis.m_controllerCount%3B%0A%20%20%20%20%20%20controller.m_world%20%3D%20this%3B%0A%20%20%20%20%20%20return%20controller%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.DestroyController%20%3D%20function%20(controller)%20%7B%0A%20%20%20%20%20%20controller.Clear()%3B%0A%20%20%20%20%20%20if%20(controller.m_next)%20controller.m_next.m_prev%20%3D%20controller.m_prev%3B%0A%20%20%20%20%20%20if%20(controller.m_prev)%20controller.m_prev.m_next%20%3D%20controller.m_next%3B%0A%20%20%20%20%20%20if%20(controller%20%3D%3D%20this.m_controllerList)%0A%20%20%20%20%20%20%20%20this.m_controllerList%20%3D%20controller.m_next%3B%0A%20%20%20%20%20%20--this.m_controllerCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetWarmStarting%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20b2World.m_warmStarting%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetContinuousPhysics%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20b2World.m_continuousPhysics%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetBodyCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetJointCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_jointCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetContactCount%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_contactCount%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SetGravity%20%3D%20function%20(gravity)%20%7B%0A%20%20%20%20%20%20this.m_gravity%20%3D%20gravity%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetGravity%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_gravity%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetGroundBody%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_groundBody%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.Step%20%3D%20function%20(%0A%20%20%20%20%20%20dt%2C%0A%20%20%20%20%20%20velocityIterations%2C%0A%20%20%20%20%20%20positionIterations%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(dt%20%3D%3D%3D%20undefined)%20dt%20%3D%200%3B%0A%20%20%20%20%20%20if%20(velocityIterations%20%3D%3D%3D%20undefined)%20velocityIterations%20%3D%200%3B%0A%20%20%20%20%20%20if%20(positionIterations%20%3D%3D%3D%20undefined)%20positionIterations%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_flags%20%26%20b2World.e_newFixture)%20%7B%0A%20%20%20%20%20%20%20%20this.m_contactManager.FindNewContacts()%3B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2World.e_newFixture%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2World.e_locked%3B%0A%20%20%20%20%20%20var%20step%20%3D%20b2World.s_timestep2%3B%0A%20%20%20%20%20%20step.dt%20%3D%20dt%3B%0A%20%20%20%20%20%20step.velocityIterations%20%3D%20velocityIterations%3B%0A%20%20%20%20%20%20step.positionIterations%20%3D%20positionIterations%3B%0A%20%20%20%20%20%20if%20(dt%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20step.inv_dt%20%3D%201.0%20%2F%20dt%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20step.inv_dt%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20step.dtRatio%20%3D%20this.m_inv_dt0%20*%20dt%3B%0A%20%20%20%20%20%20step.warmStarting%20%3D%20b2World.m_warmStarting%3B%0A%20%20%20%20%20%20this.m_contactManager.Collide()%3B%0A%20%20%20%20%20%20if%20(step.dt%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.Solve(step)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(b2World.m_continuousPhysics%20%26%26%20step.dt%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.SolveTOI(step)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(step.dt%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_inv_dt0%20%3D%20step.inv_dt%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2World.e_locked%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.ClearForces%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20for%20(var%20body%20%3D%20this.m_bodyList%3B%20body%3B%20body%20%3D%20body.m_next)%20%7B%0A%20%20%20%20%20%20%20%20body.m_force.SetZero()%3B%0A%20%20%20%20%20%20%20%20body.m_torque%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.DrawDebugData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20if%20(this.m_debugDraw%20%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_debugDraw.m_sprite.graphics.clear()%3B%0A%20%20%20%20%20%20var%20flags%20%3D%20this.m_debugDraw.GetFlags()%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20b%3B%0A%20%20%20%20%20%20var%20f%3B%0A%20%20%20%20%20%20var%20s%3B%0A%20%20%20%20%20%20var%20j%3B%0A%20%20%20%20%20%20var%20bp%3B%0A%20%20%20%20%20%20var%20invQ%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20x1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20x2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20xf%3B%0A%20%20%20%20%20%20var%20b1%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20var%20b2%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20var%20vs%20%3D%20%5Bnew%20b2Vec2()%2C%20new%20b2Vec2()%2C%20new%20b2Vec2()%2C%20new%20b2Vec2()%5D%3B%0A%20%20%20%20%20%20var%20color%20%3D%20new%20b2Color(0%2C%200%2C%200)%3B%0A%20%20%20%20%20%20if%20(flags%20%26%20b2DebugDraw.e_shapeBit)%20%7B%0A%20%20%20%20%20%20%20%20for%20(b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20xf%20%3D%20b.m_xf%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(f%20%3D%20b.GetFixtureList()%3B%20f%3B%20f%20%3D%20f.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20s%20%3D%20f.GetShape()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(b.IsActive()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20color.Set(0.5%2C%200.5%2C%200.3)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.DrawShape(s%2C%20xf%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20color.Set(0.5%2C%200.9%2C%200.5)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.DrawShape(s%2C%20xf%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_kinematicBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20color.Set(0.5%2C%200.5%2C%200.9)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.DrawShape(s%2C%20xf%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20if%20(b.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20color.Set(0.6%2C%200.6%2C%200.6)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.DrawShape(s%2C%20xf%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20color.Set(0.9%2C%200.7%2C%200.7)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.DrawShape(s%2C%20xf%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(flags%20%26%20b2DebugDraw.e_jointBit)%20%7B%0A%20%20%20%20%20%20%20%20for%20(j%20%3D%20this.m_jointList%3B%20j%3B%20j%20%3D%20j.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.DrawJoint(j)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(flags%20%26%20b2DebugDraw.e_controllerBit)%20%7B%0A%20%20%20%20%20%20%20%20for%20(var%20c%20%3D%20this.m_controllerList%3B%20c%3B%20c%20%3D%20c.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20c.Draw(this.m_debugDraw)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(flags%20%26%20b2DebugDraw.e_pairBit)%20%7B%0A%20%20%20%20%20%20%20%20color.Set(0.3%2C%200.9%2C%200.9)%3B%0A%20%20%20%20%20%20%20%20for%20(%0A%20%20%20%20%20%20%20%20%20%20var%20contact%20%3D%20this.m_contactManager.m_contactList%3B%0A%20%20%20%20%20%20%20%20%20%20contact%3B%0A%20%20%20%20%20%20%20%20%20%20contact%20%3D%20contact.GetNext()%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20fixtureA%20%3D%20contact.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20fixtureB%20%3D%20contact.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20cA%20%3D%20fixtureA.GetAABB().GetCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20cB%20%3D%20fixtureB.GetAABB().GetCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(cA%2C%20cB%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(flags%20%26%20b2DebugDraw.e_aabbBit)%20%7B%0A%20%20%20%20%20%20%20%20bp%20%3D%20this.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20%20%20vs%20%3D%20%5Bnew%20b2Vec2()%2C%20new%20b2Vec2()%2C%20new%20b2Vec2()%2C%20new%20b2Vec2()%5D%3B%0A%20%20%20%20%20%20%20%20for%20(b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.GetNext())%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.IsActive()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20for%20(f%20%3D%20b.GetFixtureList()%3B%20f%3B%20f%20%3D%20f.GetNext())%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20aabb%20%3D%20bp.GetFatAABB(f.m_proxy)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vs%5B0%5D.Set(aabb.lowerBound.x%2C%20aabb.lowerBound.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vs%5B1%5D.Set(aabb.upperBound.x%2C%20aabb.lowerBound.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vs%5B2%5D.Set(aabb.upperBound.x%2C%20aabb.upperBound.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vs%5B3%5D.Set(aabb.lowerBound.x%2C%20aabb.upperBound.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawPolygon(vs%2C%204%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(flags%20%26%20b2DebugDraw.e_centerOfMassBit)%20%7B%0A%20%20%20%20%20%20%20%20for%20(b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20xf%20%3D%20b2World.s_xf%3B%0A%20%20%20%20%20%20%20%20%20%20xf.R%20%3D%20b.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20xf.position%20%3D%20b.GetWorldCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawTransform(xf)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.QueryAABB%20%3D%20function%20(callback%2C%20aabb)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20var%20broadPhase%20%3D%20__this.m_contactManager.m_broadPhase%3B%0A%0A%20%20%20%20%20%20function%20WorldQueryWrapper(proxy)%20%7B%0A%20%20%20%20%20%20%20%20return%20callback(broadPhase.GetUserData(proxy))%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20broadPhase.Query(WorldQueryWrapper%2C%20aabb)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.QueryShape%20%3D%20function%20(callback%2C%20shape%2C%20transform)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20if%20(transform%20%3D%3D%3D%20undefined)%20transform%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(transform%20%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20transform%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20%20%20transform.SetIdentity()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20broadPhase%20%3D%20__this.m_contactManager.m_broadPhase%3B%0A%0A%20%20%20%20%20%20function%20WorldQueryWrapper(proxy)%20%7B%0A%20%20%20%20%20%20%20%20var%20fixture%20%3D%0A%20%20%20%20%20%20%20%20%20%20broadPhase.GetUserData(proxy)%20instanceof%20b2Fixture%0A%20%20%20%20%20%20%20%20%20%20%20%20%3F%20broadPhase.GetUserData(proxy)%0A%20%20%20%20%20%20%20%20%20%20%20%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20b2Shape.TestOverlap(%0A%20%20%20%20%20%20%20%20%20%20%20%20shape%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20transform%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20fixture.GetShape()%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20fixture.GetBody().GetTransform()%0A%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20return%20callback(fixture)%3B%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20aabb%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20shape.ComputeAABB(aabb%2C%20transform)%3B%0A%20%20%20%20%20%20broadPhase.Query(WorldQueryWrapper%2C%20aabb)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.QueryPoint%20%3D%20function%20(callback%2C%20p)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20var%20broadPhase%20%3D%20__this.m_contactManager.m_broadPhase%3B%0A%0A%20%20%20%20%20%20function%20WorldQueryWrapper(proxy)%20%7B%0A%20%20%20%20%20%20%20%20var%20fixture%20%3D%0A%20%20%20%20%20%20%20%20%20%20broadPhase.GetUserData(proxy)%20instanceof%20b2Fixture%0A%20%20%20%20%20%20%20%20%20%20%20%20%3F%20broadPhase.GetUserData(proxy)%0A%20%20%20%20%20%20%20%20%20%20%20%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20if%20(fixture.TestPoint(p))%20return%20callback(fixture)%3B%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20aabb%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20aabb.lowerBound.Set(%0A%20%20%20%20%20%20%20%20p.x%20-%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20p.y%20-%20b2Settings.b2_linearSlop%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20aabb.upperBound.Set(%0A%20%20%20%20%20%20%20%20p.x%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20p.y%20%2B%20b2Settings.b2_linearSlop%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20broadPhase.Query(WorldQueryWrapper%2C%20aabb)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.RayCast%20%3D%20function%20(callback%2C%20point1%2C%20point2)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20var%20broadPhase%20%3D%20__this.m_contactManager.m_broadPhase%3B%0A%20%20%20%20%20%20var%20output%20%3D%20new%20b2RayCastOutput()%3B%0A%0A%20%20%20%20%20%20function%20RayCastWrapper(input%2C%20proxy)%20%7B%0A%20%20%20%20%20%20%20%20var%20userData%20%3D%20broadPhase.GetUserData(proxy)%3B%0A%20%20%20%20%20%20%20%20var%20fixture%20%3D%20userData%20instanceof%20b2Fixture%20%3F%20userData%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20var%20hit%20%3D%20fixture.RayCast(output%2C%20input)%3B%0A%20%20%20%20%20%20%20%20if%20(hit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20fraction%20%3D%20output.fraction%3B%0A%20%20%20%20%20%20%20%20%20%20var%20point%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20%20%20%20%20(1.0%20-%20fraction)%20*%20point1.x%20%2B%20fraction%20*%20point2.x%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(1.0%20-%20fraction)%20*%20point1.y%20%2B%20fraction%20*%20point2.y%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20return%20callback(fixture%2C%20point%2C%20output.normal%2C%20fraction)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20return%20input.maxFraction%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20input%20%3D%20new%20b2RayCastInput(point1%2C%20point2)%3B%0A%20%20%20%20%20%20broadPhase.RayCast(RayCastWrapper%2C%20input)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.RayCastOne%20%3D%20function%20(point1%2C%20point2)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20var%20result%3B%0A%0A%20%20%20%20%20%20function%20RayCastOneWrapper(fixture%2C%20point%2C%20normal%2C%20fraction)%20%7B%0A%20%20%20%20%20%20%20%20if%20(fraction%20%3D%3D%3D%20undefined)%20fraction%20%3D%200%3B%0A%20%20%20%20%20%20%20%20result%20%3D%20fixture%3B%0A%20%20%20%20%20%20%20%20return%20fraction%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20__this.RayCast(RayCastOneWrapper%2C%20point1%2C%20point2)%3B%0A%20%20%20%20%20%20return%20result%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.RayCastAll%20%3D%20function%20(point1%2C%20point2)%20%7B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20var%20result%20%3D%20new%20Vector()%3B%0A%0A%20%20%20%20%20%20function%20RayCastAllWrapper(fixture%2C%20point%2C%20normal%2C%20fraction)%20%7B%0A%20%20%20%20%20%20%20%20if%20(fraction%20%3D%3D%3D%20undefined)%20fraction%20%3D%200%3B%0A%20%20%20%20%20%20%20%20result%5Bresult.length%5D%20%3D%20fixture%3B%0A%20%20%20%20%20%20%20%20return%201%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20__this.RayCast(RayCastAllWrapper%2C%20point1%2C%20point2)%3B%0A%20%20%20%20%20%20return%20result%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetBodyList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetJointList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_jointList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.GetContactList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_contactList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.IsLocked%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2World.e_locked)%20%3E%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.Solve%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20b%3B%0A%20%20%20%20%20%20for%20(%0A%20%20%20%20%20%20%20%20var%20controller%20%3D%20this.m_controllerList%3B%0A%20%20%20%20%20%20%20%20controller%3B%0A%20%20%20%20%20%20%20%20controller%20%3D%20controller.m_next%0A%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20controller.Step(step)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20island%20%3D%20this.m_island%3B%0A%20%20%20%20%20%20island.Initialize(%0A%20%20%20%20%20%20%20%20this.m_bodyCount%2C%0A%20%20%20%20%20%20%20%20this.m_contactCount%2C%0A%20%20%20%20%20%20%20%20this.m_jointCount%2C%0A%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20this.m_contactManager.m_contactListener%2C%0A%20%20%20%20%20%20%20%20this.m_contactSolver%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20for%20(b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20b.m_flags%20%26%3D%20~b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(var%20c%20%3D%20this.m_contactList%3B%20c%3B%20c%20%3D%20c.m_next)%20%7B%0A%20%20%20%20%20%20%20%20c.m_flags%20%26%3D%20~b2Contact.e_islandFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(var%20j%20%3D%20this.m_jointList%3B%20j%3B%20j%20%3D%20j.m_next)%20%7B%0A%20%20%20%20%20%20%20%20j.m_islandFlag%20%3D%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20stackSize%20%3D%20parseInt(this.m_bodyCount)%3B%0A%20%20%20%20%20%20var%20stack%20%3D%20this.s_stack%3B%0A%20%20%20%20%20%20for%20(var%20seed%20%3D%20this.m_bodyList%3B%20seed%3B%20seed%20%3D%20seed.m_next)%20%7B%0A%20%20%20%20%20%20%20%20if%20(seed.m_flags%20%26%20b2Body.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(seed.IsAwake()%20%3D%3D%20false%20%7C%7C%20seed.IsActive()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(seed.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20island.Clear()%3B%0A%20%20%20%20%20%20%20%20var%20stackCount%20%3D%200%3B%0A%20%20%20%20%20%20%20%20stack%5BstackCount%2B%2B%5D%20%3D%20seed%3B%0A%20%20%20%20%20%20%20%20seed.m_flags%20%7C%3D%20b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20while%20(stackCount%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b%20%3D%20stack%5B--stackCount%5D%3B%0A%20%20%20%20%20%20%20%20%20%20island.AddBody(b)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20var%20other%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(var%20ce%20%3D%20b.m_contactList%3B%20ce%3B%20ce%20%3D%20ce.next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(ce.contact.m_flags%20%26%20b2Contact.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ce.contact.IsSensor()%20%3D%3D%20true%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ce.contact.IsEnabled()%20%3D%3D%20false%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ce.contact.IsTouching()%20%3D%3D%20false%0A%20%20%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20island.AddContact(ce.contact)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ce.contact.m_flags%20%7C%3D%20b2Contact.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20other%20%3D%20ce.other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.m_flags%20%26%20b2Body.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20stack%5BstackCount%2B%2B%5D%20%3D%20other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20other.m_flags%20%7C%3D%20b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20for%20(var%20jn%20%3D%20b.m_jointList%3B%20jn%3B%20jn%20%3D%20jn.next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(jn.joint.m_islandFlag%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20other%20%3D%20jn.other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.IsActive()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20island.AddJoint(jn.joint)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20jn.joint.m_islandFlag%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.m_flags%20%26%20b2Body.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20stack%5BstackCount%2B%2B%5D%20%3D%20other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20other.m_flags%20%7C%3D%20b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20island.Solve(step%2C%20this.m_gravity%2C%20this.m_allowSleep)%3B%0A%20%20%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20island.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b%20%3D%20island.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.m_flags%20%26%3D%20~b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20stack.length%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20if%20(!stack%5Bi%5D)%20break%3B%0A%20%20%20%20%20%20%20%20stack%5Bi%5D%20%3D%20null%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20if%20(b.IsAwake()%20%3D%3D%20false%20%7C%7C%20b.IsActive()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(b.GetType()%20%3D%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20b.SynchronizeFixtures()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_contactManager.FindNewContacts()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.SolveTOI%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20b%3B%0A%20%20%20%20%20%20var%20fA%3B%0A%20%20%20%20%20%20var%20fB%3B%0A%20%20%20%20%20%20var%20bA%3B%0A%20%20%20%20%20%20var%20bB%3B%0A%20%20%20%20%20%20var%20cEdge%3B%0A%20%20%20%20%20%20var%20j%3B%0A%20%20%20%20%20%20var%20island%20%3D%20this.m_island%3B%0A%20%20%20%20%20%20island.Initialize(%0A%20%20%20%20%20%20%20%20this.m_bodyCount%2C%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxTOIContactsPerIsland%2C%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxTOIJointsPerIsland%2C%0A%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20this.m_contactManager.m_contactListener%2C%0A%20%20%20%20%20%20%20%20this.m_contactSolver%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20queue%20%3D%20b2World.s_queue%3B%0A%20%20%20%20%20%20for%20(b%20%3D%20this.m_bodyList%3B%20b%3B%20b%20%3D%20b.m_next)%20%7B%0A%20%20%20%20%20%20%20%20b.m_flags%20%26%3D%20~b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20b.m_sweep.t0%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20c%3B%0A%20%20%20%20%20%20for%20(c%20%3D%20this.m_contactList%3B%20c%3B%20c%20%3D%20c.m_next)%20%7B%0A%20%20%20%20%20%20%20%20c.m_flags%20%26%3D%20~(b2Contact.e_toiFlag%20%7C%20b2Contact.e_islandFlag)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(j%20%3D%20this.m_jointList%3B%20j%3B%20j%20%3D%20j.m_next)%20%7B%0A%20%20%20%20%20%20%20%20j.m_islandFlag%20%3D%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(%3B%3B)%20%7B%0A%20%20%20%20%20%20%20%20var%20minContact%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20var%20minTOI%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20for%20(c%20%3D%20this.m_contactList%3B%20c%3B%20c%20%3D%20c.m_next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20c.IsSensor()%20%3D%3D%20true%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20c.IsEnabled()%20%3D%3D%20false%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20c.IsContinuous()%20%3D%3D%20false%0A%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20var%20toi%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(c.m_flags%20%26%20b2Contact.e_toiFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20toi%20%3D%20c.m_toi%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20fA%20%3D%20c.m_fixtureA%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20fB%20%3D%20c.m_fixtureB%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bA%20%3D%20fA.m_body%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bB%20%3D%20fB.m_body%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(bA.GetType()%20!%3D%20b2Body.b2_dynamicBody%20%7C%7C%20bA.IsAwake()%20%3D%3D%20false)%20%26%26%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(bB.GetType()%20!%3D%20b2Body.b2_dynamicBody%20%7C%7C%20bB.IsAwake()%20%3D%3D%20false)%0A%20%20%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20t0%20%3D%20bA.m_sweep.t0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(bA.m_sweep.t0%20%3C%20bB.m_sweep.t0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20t0%20%3D%20bB.m_sweep.t0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20bA.m_sweep.Advance(t0)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20if%20(bB.m_sweep.t0%20%3C%20bA.m_sweep.t0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20t0%20%3D%20bA.m_sweep.t0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20bB.m_sweep.Advance(t0)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20toi%20%3D%20c.ComputeTOI(bA.m_sweep%2C%20bB.m_sweep)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2Assert(0.0%20%3C%3D%20toi%20%26%26%20toi%20%3C%3D%201.0)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(toi%20%3E%200.0%20%26%26%20toi%20%3C%201.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20toi%20%3D%20(1.0%20-%20toi)%20*%20t0%20%2B%20toi%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(toi%20%3E%201)%20toi%20%3D%201%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20c.m_toi%20%3D%20toi%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20c.m_flags%20%7C%3D%20b2Contact.e_toiFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(Number.MIN_VALUE%20%3C%20toi%20%26%26%20toi%20%3C%20minTOI)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20minContact%20%3D%20c%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20minTOI%20%3D%20toi%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(minContact%20%3D%3D%20null%20%7C%7C%201.0%20-%20100.0%20*%20Number.MIN_VALUE%20%3C%20minTOI)%20%7B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20fA%20%3D%20minContact.m_fixtureA%3B%0A%20%20%20%20%20%20%20%20fB%20%3D%20minContact.m_fixtureB%3B%0A%20%20%20%20%20%20%20%20bA%20%3D%20fA.m_body%3B%0A%20%20%20%20%20%20%20%20bB%20%3D%20fB.m_body%3B%0A%20%20%20%20%20%20%20%20b2World.s_backupA.Set(bA.m_sweep)%3B%0A%20%20%20%20%20%20%20%20b2World.s_backupB.Set(bB.m_sweep)%3B%0A%20%20%20%20%20%20%20%20bA.Advance(minTOI)%3B%0A%20%20%20%20%20%20%20%20bB.Advance(minTOI)%3B%0A%20%20%20%20%20%20%20%20minContact.Update(this.m_contactManager.m_contactListener)%3B%0A%20%20%20%20%20%20%20%20minContact.m_flags%20%26%3D%20~b2Contact.e_toiFlag%3B%0A%20%20%20%20%20%20%20%20if%20(minContact.IsSensor()%20%3D%3D%20true%20%7C%7C%20minContact.IsEnabled()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bA.m_sweep.Set(b2World.s_backupA)%3B%0A%20%20%20%20%20%20%20%20%20%20bB.m_sweep.Set(b2World.s_backupB)%3B%0A%20%20%20%20%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(minContact.IsTouching()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20seed%20%3D%20bA%3B%0A%20%20%20%20%20%20%20%20if%20(seed.GetType()%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20seed%20%3D%20bB%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20island.Clear()%3B%0A%20%20%20%20%20%20%20%20var%20queueStart%20%3D%200%3B%0A%20%20%20%20%20%20%20%20var%20queueSize%20%3D%200%3B%0A%20%20%20%20%20%20%20%20queue%5BqueueStart%20%2B%20queueSize%2B%2B%5D%20%3D%20seed%3B%0A%20%20%20%20%20%20%20%20seed.m_flags%20%7C%3D%20b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20while%20(queueSize%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b%20%3D%20queue%5BqueueStart%2B%2B%5D%3B%0A%20%20%20%20%20%20%20%20%20%20--queueSize%3B%0A%20%20%20%20%20%20%20%20%20%20island.AddBody(b)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20b.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(b.GetType()%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20for%20(cEdge%20%3D%20b.m_contactList%3B%20cEdge%3B%20cEdge%20%3D%20cEdge.next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(island.m_contactCount%20%3D%3D%20island.m_contactCapacity)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(cEdge.contact.m_flags%20%26%20b2Contact.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cEdge.contact.IsSensor()%20%3D%3D%20true%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cEdge.contact.IsEnabled()%20%3D%3D%20false%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cEdge.contact.IsTouching()%20%3D%3D%20false%0A%20%20%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20island.AddContact(cEdge.contact)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20cEdge.contact.m_flags%20%7C%3D%20b2Contact.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20other%20%3D%20cEdge.other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.m_flags%20%26%20b2Body.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.GetType()%20!%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20other.Advance(minTOI)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20other.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20queue%5BqueueStart%20%2B%20queueSize%5D%20%3D%20other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2B%2BqueueSize%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20other.m_flags%20%7C%3D%20b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20for%20(var%20jEdge%20%3D%20b.m_jointList%3B%20jEdge%3B%20jEdge%20%3D%20jEdge.next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(island.m_jointCount%20%3D%3D%20island.m_jointCapacity)%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(jEdge.joint.m_islandFlag%20%3D%3D%20true)%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20other%20%3D%20jEdge.other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.IsActive()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20island.AddJoint(jEdge.joint)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20jEdge.joint.m_islandFlag%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.m_flags%20%26%20b2Body.e_islandFlag)%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(other.GetType()%20!%3D%20b2Body.b2_staticBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20other.Advance(minTOI)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20other.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20queue%5BqueueStart%20%2B%20queueSize%5D%20%3D%20other%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2B%2BqueueSize%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20other.m_flags%20%7C%3D%20b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20subStep%20%3D%20b2World.s_timestep%3B%0A%20%20%20%20%20%20%20%20subStep.warmStarting%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20subStep.dt%20%3D%20(1.0%20-%20minTOI)%20*%20step.dt%3B%0A%20%20%20%20%20%20%20%20subStep.inv_dt%20%3D%201.0%20%2F%20subStep.dt%3B%0A%20%20%20%20%20%20%20%20subStep.dtRatio%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20subStep.velocityIterations%20%3D%20step.velocityIterations%3B%0A%20%20%20%20%20%20%20%20subStep.positionIterations%20%3D%20step.positionIterations%3B%0A%20%20%20%20%20%20%20%20island.SolveTOI(subStep)%3B%0A%20%20%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20island.m_bodyCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20b%20%3D%20island.m_bodies%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20b.m_flags%20%26%3D%20~b2Body.e_islandFlag%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(b.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20if%20(b.GetType()%20!%3D%20b2Body.b2_dynamicBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20b.SynchronizeFixtures()%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(cEdge%20%3D%20b.m_contactList%3B%20cEdge%3B%20cEdge%20%3D%20cEdge.next)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20cEdge.contact.m_flags%20%26%3D%20~b2Contact.e_toiFlag%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20island.m_contactCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20c%20%3D%20island.m_contacts%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20c.m_flags%20%26%3D%20~(b2Contact.e_toiFlag%20%7C%20b2Contact.e_islandFlag)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20island.m_jointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20j%20%3D%20island.m_joints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20j.m_islandFlag%20%3D%20false%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.m_contactManager.FindNewContacts()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.DrawJoint%20%3D%20function%20(joint)%20%7B%0A%20%20%20%20%20%20var%20b1%20%3D%20joint.GetBodyA()%3B%0A%20%20%20%20%20%20var%20b2%20%3D%20joint.GetBodyB()%3B%0A%20%20%20%20%20%20var%20xf1%20%3D%20b1.m_xf%3B%0A%20%20%20%20%20%20var%20xf2%20%3D%20b2.m_xf%3B%0A%20%20%20%20%20%20var%20x1%20%3D%20xf1.position%3B%0A%20%20%20%20%20%20var%20x2%20%3D%20xf2.position%3B%0A%20%20%20%20%20%20var%20p1%20%3D%20joint.GetAnchorA()%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20joint.GetAnchorB()%3B%0A%20%20%20%20%20%20var%20color%20%3D%20b2World.s_jointColor%3B%0A%20%20%20%20%20%20switch%20(joint.m_type)%20%7B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_distanceJoint%3A%0A%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(p1%2C%20p2%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_pulleyJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pulley%20%3D%20joint%20instanceof%20b2PulleyJoint%20%3F%20joint%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20s1%20%3D%20pulley.GetGroundAnchorA()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20s2%20%3D%20pulley.GetGroundAnchorB()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(s1%2C%20p1%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(s2%2C%20p2%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(s1%2C%20s2%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_mouseJoint%3A%0A%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(p1%2C%20p2%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20if%20(b1%20!%3D%20this.m_groundBody)%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(x1%2C%20p1%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(p1%2C%20p2%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(b2%20!%3D%20this.m_groundBody)%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(x2%2C%20p2%2C%20color)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2World.prototype.DrawShape%20%3D%20function%20(shape%2C%20xf%2C%20color)%20%7B%0A%20%20%20%20%20%20switch%20(shape.m_type)%20%7B%0A%20%20%20%20%20%20%20%20case%20b2Shape.e_circleShape%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20circle%20%3D%20shape%20instanceof%20b2CircleShape%20%3F%20shape%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20center%20%3D%20b2Math.MulX(xf%2C%20circle.m_p)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20radius%20%3D%20circle.m_radius%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20axis%20%3D%20xf.R.col1%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSolidCircle(center%2C%20radius%2C%20axis%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Shape.e_polygonShape%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20poly%20%3D%20shape%20instanceof%20b2PolygonShape%20%3F%20shape%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20vertexCount%20%3D%20parseInt(poly.GetVertexCount())%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20localVertices%20%3D%20poly.GetVertices()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20vertices%20%3D%20new%20Vector(vertexCount)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20vertexCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vertices%5Bi%5D%20%3D%20b2Math.MulX(xf%2C%20localVertices%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSolidPolygon(vertices%2C%20vertexCount%2C%20color)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Shape.e_edgeShape%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20edge%20%3D%20shape%20instanceof%20b2EdgeShape%20%3F%20shape%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_debugDraw.DrawSegment(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20b2Math.MulX(xf%2C%20edge.GetVertex1())%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20b2Math.MulX(xf%2C%20edge.GetVertex2())%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_timestep2%20%3D%20new%20b2TimeStep()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_xf%20%3D%20new%20b2Transform()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_backupA%20%3D%20new%20b2Sweep()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_backupB%20%3D%20new%20b2Sweep()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_timestep%20%3D%20new%20b2TimeStep()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_queue%20%3D%20new%20Vector()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.s_jointColor%20%3D%20new%20b2Color(0.5%2C%200.8%2C%200.8)%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.e_newFixture%20%3D%200x0001%3B%0A%20%20%20%20%20%20Box2D.Dynamics.b2World.e_locked%20%3D%200x0002%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2CircleShape%20%3D%20Box2D.Collision.Shapes.b2CircleShape%2C%0A%20%20%20%20%20%20b2EdgeChainDef%20%3D%20Box2D.Collision.Shapes.b2EdgeChainDef%2C%0A%20%20%20%20%20%20b2EdgeShape%20%3D%20Box2D.Collision.Shapes.b2EdgeShape%2C%0A%20%20%20%20%20%20b2MassData%20%3D%20Box2D.Collision.Shapes.b2MassData%2C%0A%20%20%20%20%20%20b2PolygonShape%20%3D%20Box2D.Collision.Shapes.b2PolygonShape%2C%0A%20%20%20%20%20%20b2Shape%20%3D%20Box2D.Collision.Shapes.b2Shape%2C%0A%20%20%20%20%20%20b2CircleContact%20%3D%20Box2D.Dynamics.Contacts.b2CircleContact%2C%0A%20%20%20%20%20%20b2Contact%20%3D%20Box2D.Dynamics.Contacts.b2Contact%2C%0A%20%20%20%20%20%20b2ContactConstraint%20%3D%20Box2D.Dynamics.Contacts.b2ContactConstraint%2C%0A%20%20%20%20%20%20b2ContactConstraintPoint%20%3D%20Box2D.Dynamics.Contacts.b2ContactConstraintPoint%2C%0A%20%20%20%20%20%20b2ContactEdge%20%3D%20Box2D.Dynamics.Contacts.b2ContactEdge%2C%0A%20%20%20%20%20%20b2ContactFactory%20%3D%20Box2D.Dynamics.Contacts.b2ContactFactory%2C%0A%20%20%20%20%20%20b2ContactRegister%20%3D%20Box2D.Dynamics.Contacts.b2ContactRegister%2C%0A%20%20%20%20%20%20b2ContactResult%20%3D%20Box2D.Dynamics.Contacts.b2ContactResult%2C%0A%20%20%20%20%20%20b2ContactSolver%20%3D%20Box2D.Dynamics.Contacts.b2ContactSolver%2C%0A%20%20%20%20%20%20b2EdgeAndCircleContact%20%3D%20Box2D.Dynamics.Contacts.b2EdgeAndCircleContact%2C%0A%20%20%20%20%20%20b2NullContact%20%3D%20Box2D.Dynamics.Contacts.b2NullContact%2C%0A%20%20%20%20%20%20b2PolyAndCircleContact%20%3D%20Box2D.Dynamics.Contacts.b2PolyAndCircleContact%2C%0A%20%20%20%20%20%20b2PolyAndEdgeContact%20%3D%20Box2D.Dynamics.Contacts.b2PolyAndEdgeContact%2C%0A%20%20%20%20%20%20b2PolygonContact%20%3D%20Box2D.Dynamics.Contacts.b2PolygonContact%2C%0A%20%20%20%20%20%20b2PositionSolverManifold%20%3D%20Box2D.Dynamics.Contacts.b2PositionSolverManifold%2C%0A%20%20%20%20%20%20b2Body%20%3D%20Box2D.Dynamics.b2Body%2C%0A%20%20%20%20%20%20b2BodyDef%20%3D%20Box2D.Dynamics.b2BodyDef%2C%0A%20%20%20%20%20%20b2ContactFilter%20%3D%20Box2D.Dynamics.b2ContactFilter%2C%0A%20%20%20%20%20%20b2ContactImpulse%20%3D%20Box2D.Dynamics.b2ContactImpulse%2C%0A%20%20%20%20%20%20b2ContactListener%20%3D%20Box2D.Dynamics.b2ContactListener%2C%0A%20%20%20%20%20%20b2ContactManager%20%3D%20Box2D.Dynamics.b2ContactManager%2C%0A%20%20%20%20%20%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%2C%0A%20%20%20%20%20%20b2DestructionListener%20%3D%20Box2D.Dynamics.b2DestructionListener%2C%0A%20%20%20%20%20%20b2FilterData%20%3D%20Box2D.Dynamics.b2FilterData%2C%0A%20%20%20%20%20%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%2C%0A%20%20%20%20%20%20b2FixtureDef%20%3D%20Box2D.Dynamics.b2FixtureDef%2C%0A%20%20%20%20%20%20b2Island%20%3D%20Box2D.Dynamics.b2Island%2C%0A%20%20%20%20%20%20b2TimeStep%20%3D%20Box2D.Dynamics.b2TimeStep%2C%0A%20%20%20%20%20%20b2World%20%3D%20Box2D.Dynamics.b2World%2C%0A%20%20%20%20%20%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%2C%0A%20%20%20%20%20%20b2AABB%20%3D%20Box2D.Collision.b2AABB%2C%0A%20%20%20%20%20%20b2Bound%20%3D%20Box2D.Collision.b2Bound%2C%0A%20%20%20%20%20%20b2BoundValues%20%3D%20Box2D.Collision.b2BoundValues%2C%0A%20%20%20%20%20%20b2Collision%20%3D%20Box2D.Collision.b2Collision%2C%0A%20%20%20%20%20%20b2ContactID%20%3D%20Box2D.Collision.b2ContactID%2C%0A%20%20%20%20%20%20b2ContactPoint%20%3D%20Box2D.Collision.b2ContactPoint%2C%0A%20%20%20%20%20%20b2Distance%20%3D%20Box2D.Collision.b2Distance%2C%0A%20%20%20%20%20%20b2DistanceInput%20%3D%20Box2D.Collision.b2DistanceInput%2C%0A%20%20%20%20%20%20b2DistanceOutput%20%3D%20Box2D.Collision.b2DistanceOutput%2C%0A%20%20%20%20%20%20b2DistanceProxy%20%3D%20Box2D.Collision.b2DistanceProxy%2C%0A%20%20%20%20%20%20b2DynamicTree%20%3D%20Box2D.Collision.b2DynamicTree%2C%0A%20%20%20%20%20%20b2DynamicTreeBroadPhase%20%3D%20Box2D.Collision.b2DynamicTreeBroadPhase%2C%0A%20%20%20%20%20%20b2DynamicTreeNode%20%3D%20Box2D.Collision.b2DynamicTreeNode%2C%0A%20%20%20%20%20%20b2DynamicTreePair%20%3D%20Box2D.Collision.b2DynamicTreePair%2C%0A%20%20%20%20%20%20b2Manifold%20%3D%20Box2D.Collision.b2Manifold%2C%0A%20%20%20%20%20%20b2ManifoldPoint%20%3D%20Box2D.Collision.b2ManifoldPoint%2C%0A%20%20%20%20%20%20b2Point%20%3D%20Box2D.Collision.b2Point%2C%0A%20%20%20%20%20%20b2RayCastInput%20%3D%20Box2D.Collision.b2RayCastInput%2C%0A%20%20%20%20%20%20b2RayCastOutput%20%3D%20Box2D.Collision.b2RayCastOutput%2C%0A%20%20%20%20%20%20b2Segment%20%3D%20Box2D.Collision.b2Segment%2C%0A%20%20%20%20%20%20b2SeparationFunction%20%3D%20Box2D.Collision.b2SeparationFunction%2C%0A%20%20%20%20%20%20b2Simplex%20%3D%20Box2D.Collision.b2Simplex%2C%0A%20%20%20%20%20%20b2SimplexCache%20%3D%20Box2D.Collision.b2SimplexCache%2C%0A%20%20%20%20%20%20b2SimplexVertex%20%3D%20Box2D.Collision.b2SimplexVertex%2C%0A%20%20%20%20%20%20b2TimeOfImpact%20%3D%20Box2D.Collision.b2TimeOfImpact%2C%0A%20%20%20%20%20%20b2TOIInput%20%3D%20Box2D.Collision.b2TOIInput%2C%0A%20%20%20%20%20%20b2WorldManifold%20%3D%20Box2D.Collision.b2WorldManifold%2C%0A%20%20%20%20%20%20ClipVertex%20%3D%20Box2D.Collision.ClipVertex%2C%0A%20%20%20%20%20%20Features%20%3D%20Box2D.Collision.Features%2C%0A%20%20%20%20%20%20IBroadPhase%20%3D%20Box2D.Collision.IBroadPhase%3B%0A%0A%20%20%20%20Box2D.inherit(b2CircleContact%2C%20Box2D.Dynamics.Contacts.b2Contact)%3B%0A%20%20%20%20b2CircleContact.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.prototype%3B%0A%20%20%20%20b2CircleContact.b2CircleContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleContact.Create%20%3D%20function%20(allocator)%20%7B%0A%20%20%20%20%20%20return%20new%20b2CircleContact()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleContact.Destroy%20%3D%20function%20(contact%2C%20allocator)%20%7B%7D%3B%0A%20%20%20%20b2CircleContact.prototype.Reset%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20this.__super.Reset.call(this%2C%20fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2CircleContact.prototype.Evaluate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_fixtureB.GetBody()%3B%0A%20%20%20%20%20%20b2Collision.CollideCircles(%0A%20%20%20%20%20%20%20%20this.m_manifold%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureA.GetShape()%20instanceof%20b2CircleShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureA.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bA.m_xf%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureB.GetShape()%20instanceof%20b2CircleShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureB.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bB.m_xf%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.b2Contact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_nodeA%20%3D%20new%20b2ContactEdge()%3B%0A%20%20%20%20%20%20this.m_nodeB%20%3D%20new%20b2ContactEdge()%3B%0A%20%20%20%20%20%20this.m_manifold%20%3D%20new%20b2Manifold()%3B%0A%20%20%20%20%20%20this.m_oldManifold%20%3D%20new%20b2Manifold()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.GetManifold%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_manifold%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.GetWorldManifold%20%3D%20function%20(worldManifold)%20%7B%0A%20%20%20%20%20%20var%20bodyA%20%3D%20this.m_fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20this.m_fixtureB.GetBody()%3B%0A%20%20%20%20%20%20var%20shapeA%20%3D%20this.m_fixtureA.GetShape()%3B%0A%20%20%20%20%20%20var%20shapeB%20%3D%20this.m_fixtureB.GetShape()%3B%0A%20%20%20%20%20%20worldManifold.Initialize(%0A%20%20%20%20%20%20%20%20this.m_manifold%2C%0A%20%20%20%20%20%20%20%20bodyA.GetTransform()%2C%0A%20%20%20%20%20%20%20%20shapeA.m_radius%2C%0A%20%20%20%20%20%20%20%20bodyB.GetTransform()%2C%0A%20%20%20%20%20%20%20%20shapeB.m_radius%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.IsTouching%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20(this.m_flags%20%26%20b2Contact.e_touchingFlag)%20%3D%3D%20b2Contact.e_touchingFlag%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.IsContinuous%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20(this.m_flags%20%26%20b2Contact.e_continuousFlag)%20%3D%3D%20b2Contact.e_continuousFlag%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.SetSensor%20%3D%20function%20(sensor)%20%7B%0A%20%20%20%20%20%20if%20(sensor)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_sensorFlag%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Contact.e_sensorFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.IsSensor%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2Contact.e_sensorFlag)%20%3D%3D%20b2Contact.e_sensorFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.SetEnabled%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20if%20(flag)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_enabledFlag%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Contact.e_enabledFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.IsEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(this.m_flags%20%26%20b2Contact.e_enabledFlag)%20%3D%3D%20b2Contact.e_enabledFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.GetNext%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_next%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.GetFixtureA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_fixtureA%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.GetFixtureB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_fixtureB%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.FlagForFiltering%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_filterFlag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.b2Contact%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Contact.prototype.Reset%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20if%20(fixtureA%20%3D%3D%3D%20undefined)%20fixtureA%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(fixtureB%20%3D%3D%3D%20undefined)%20fixtureB%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_flags%20%3D%20b2Contact.e_enabledFlag%3B%0A%20%20%20%20%20%20if%20(!fixtureA%20%7C%7C%20!fixtureB)%20%7B%0A%20%20%20%20%20%20%20%20this.m_fixtureA%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20this.m_fixtureB%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(fixtureA.IsSensor()%20%7C%7C%20fixtureB.IsSensor())%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_sensorFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20bodyA%20%3D%20fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20fixtureB.GetBody()%3B%0A%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20bodyA.GetType()%20!%3D%20b2Body.b2_dynamicBody%20%7C%7C%0A%20%20%20%20%20%20%20%20bodyA.IsBullet()%20%7C%7C%0A%20%20%20%20%20%20%20%20bodyB.GetType()%20!%3D%20b2Body.b2_dynamicBody%20%7C%7C%0A%20%20%20%20%20%20%20%20bodyB.IsBullet()%0A%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_continuousFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_fixtureA%20%3D%20fixtureA%3B%0A%20%20%20%20%20%20this.m_fixtureB%20%3D%20fixtureB%3B%0A%20%20%20%20%20%20this.m_manifold.m_pointCount%20%3D%200%3B%0A%20%20%20%20%20%20this.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeA.contact%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeA.prev%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeA.next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeA.other%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeB.contact%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeB.prev%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeB.next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_nodeB.other%20%3D%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.Update%20%3D%20function%20(listener)%20%7B%0A%20%20%20%20%20%20var%20tManifold%20%3D%20this.m_oldManifold%3B%0A%20%20%20%20%20%20this.m_oldManifold%20%3D%20this.m_manifold%3B%0A%20%20%20%20%20%20this.m_manifold%20%3D%20tManifold%3B%0A%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_enabledFlag%3B%0A%20%20%20%20%20%20var%20touching%20%3D%20false%3B%0A%20%20%20%20%20%20var%20wasTouching%20%3D%0A%20%20%20%20%20%20%20%20(this.m_flags%20%26%20b2Contact.e_touchingFlag)%20%3D%3D%20b2Contact.e_touchingFlag%3B%0A%20%20%20%20%20%20var%20bodyA%20%3D%20this.m_fixtureA.m_body%3B%0A%20%20%20%20%20%20var%20bodyB%20%3D%20this.m_fixtureB.m_body%3B%0A%20%20%20%20%20%20var%20aabbOverlap%20%3D%20this.m_fixtureA.m_aabb.TestOverlap(%0A%20%20%20%20%20%20%20%20this.m_fixtureB.m_aabb%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20if%20(this.m_flags%20%26%20b2Contact.e_sensorFlag)%20%7B%0A%20%20%20%20%20%20%20%20if%20(aabbOverlap)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20shapeA%20%3D%20this.m_fixtureA.GetShape()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20shapeB%20%3D%20this.m_fixtureB.GetShape()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20xfA%20%3D%20bodyA.GetTransform()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20xfB%20%3D%20bodyB.GetTransform()%3B%0A%20%20%20%20%20%20%20%20%20%20touching%20%3D%20b2Shape.TestOverlap(shapeA%2C%20xfA%2C%20shapeB%2C%20xfB)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.m_manifold.m_pointCount%20%3D%200%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20bodyA.GetType()%20!%3D%20b2Body.b2_dynamicBody%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20bodyA.IsBullet()%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20bodyB.GetType()%20!%3D%20b2Body.b2_dynamicBody%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20bodyB.IsBullet()%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_continuousFlag%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Contact.e_continuousFlag%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(aabbOverlap)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.Evaluate()%3B%0A%20%20%20%20%20%20%20%20%20%20touching%20%3D%20this.m_manifold.m_pointCount%20%3E%200%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_manifold.m_pointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20mp2%20%3D%20this.m_manifold.m_points%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20mp2.m_normalImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20mp2.m_tangentImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20id2%20%3D%20mp2.m_id%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20(var%20j%20%3D%200%3B%20j%20%3C%20this.m_oldManifold.m_pointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20mp1%20%3D%20this.m_oldManifold.m_points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20(mp1.m_id.key%20%3D%3D%20id2.key)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mp2.m_normalImpulse%20%3D%20mp1.m_normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20mp2.m_tangentImpulse%20%3D%20mp1.m_tangentImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_manifold.m_pointCount%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(touching%20!%3D%20wasTouching)%20%7B%0A%20%20%20%20%20%20%20%20%20%20bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%20%20bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(touching)%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%7C%3D%20b2Contact.e_touchingFlag%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_flags%20%26%3D%20~b2Contact.e_touchingFlag%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(wasTouching%20%3D%3D%20false%20%26%26%20touching%20%3D%3D%20true)%20%7B%0A%20%20%20%20%20%20%20%20listener.BeginContact(this)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(wasTouching%20%3D%3D%20true%20%26%26%20touching%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20listener.EndContact(this)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20((this.m_flags%20%26%20b2Contact.e_sensorFlag)%20%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20listener.PreSolve(this%2C%20this.m_oldManifold)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Contact.prototype.Evaluate%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Contact.prototype.ComputeTOI%20%3D%20function%20(sweepA%2C%20sweepB)%20%7B%0A%20%20%20%20%20%20b2Contact.s_input.proxyA.Set(this.m_fixtureA.GetShape())%3B%0A%20%20%20%20%20%20b2Contact.s_input.proxyB.Set(this.m_fixtureB.GetShape())%3B%0A%20%20%20%20%20%20b2Contact.s_input.sweepA%20%3D%20sweepA%3B%0A%20%20%20%20%20%20b2Contact.s_input.sweepB%20%3D%20sweepB%3B%0A%20%20%20%20%20%20b2Contact.s_input.tolerance%20%3D%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%20%20return%20b2TimeOfImpact.TimeOfImpact(b2Contact.s_input)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag%20%3D%200x0001%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag%20%3D%200x0002%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_islandFlag%20%3D%200x0004%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_toiFlag%20%3D%200x0008%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag%20%3D%200x0010%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag%20%3D%200x0020%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.e_filterFlag%20%3D%200x0040%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.s_input%20%3D%20new%20b2TOIInput()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2ContactConstraint.b2ContactConstraint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.localPlaneNormal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localPoint%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.normalMass%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.K%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactConstraint.prototype.b2ContactConstraint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.points%20%3D%20new%20Vector(b2Settings.b2_maxManifoldPoints)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.points%5Bi%5D%20%3D%20new%20b2ContactConstraintPoint()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactConstraintPoint.b2ContactConstraintPoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.localPoint%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.rA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.rB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactEdge.b2ContactEdge%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactFactory.b2ContactFactory%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactFactory.prototype.b2ContactFactory%20%3D%20function%20(allocator)%20%7B%0A%20%20%20%20%20%20this.m_allocator%20%3D%20allocator%3B%0A%20%20%20%20%20%20this.InitializeRegisters()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactFactory.prototype.AddType%20%3D%20function%20(%0A%20%20%20%20%20%20createFcn%2C%0A%20%20%20%20%20%20destroyFcn%2C%0A%20%20%20%20%20%20type1%2C%0A%20%20%20%20%20%20type2%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(type1%20%3D%3D%3D%20undefined)%20type1%20%3D%200%3B%0A%20%20%20%20%20%20if%20(type2%20%3D%3D%3D%20undefined)%20type2%20%3D%200%3B%0A%20%20%20%20%20%20this.m_registers%5Btype1%5D%5Btype2%5D.createFcn%20%3D%20createFcn%3B%0A%20%20%20%20%20%20this.m_registers%5Btype1%5D%5Btype2%5D.destroyFcn%20%3D%20destroyFcn%3B%0A%20%20%20%20%20%20this.m_registers%5Btype1%5D%5Btype2%5D.primary%20%3D%20true%3B%0A%20%20%20%20%20%20if%20(type1%20!%3D%20type2)%20%7B%0A%20%20%20%20%20%20%20%20this.m_registers%5Btype2%5D%5Btype1%5D.createFcn%20%3D%20createFcn%3B%0A%20%20%20%20%20%20%20%20this.m_registers%5Btype2%5D%5Btype1%5D.destroyFcn%20%3D%20destroyFcn%3B%0A%20%20%20%20%20%20%20%20this.m_registers%5Btype2%5D%5Btype1%5D.primary%20%3D%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactFactory.prototype.InitializeRegisters%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_registers%20%3D%20new%20Vector(b2Shape.e_shapeTypeCount)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Shape.e_shapeTypeCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.m_registers%5Bi%5D%20%3D%20new%20Vector(b2Shape.e_shapeTypeCount)%3B%0A%20%20%20%20%20%20%20%20for%20(var%20j%20%3D%200%3B%20j%20%3C%20b2Shape.e_shapeTypeCount%3B%20j%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_registers%5Bi%5D%5Bj%5D%20%3D%20new%20b2ContactRegister()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.AddType(%0A%20%20%20%20%20%20%20%20b2CircleContact.Create%2C%0A%20%20%20%20%20%20%20%20b2CircleContact.Destroy%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_circleShape%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_circleShape%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.AddType(%0A%20%20%20%20%20%20%20%20b2PolyAndCircleContact.Create%2C%0A%20%20%20%20%20%20%20%20b2PolyAndCircleContact.Destroy%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_polygonShape%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_circleShape%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.AddType(%0A%20%20%20%20%20%20%20%20b2PolygonContact.Create%2C%0A%20%20%20%20%20%20%20%20b2PolygonContact.Destroy%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_polygonShape%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_polygonShape%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.AddType(%0A%20%20%20%20%20%20%20%20b2EdgeAndCircleContact.Create%2C%0A%20%20%20%20%20%20%20%20b2EdgeAndCircleContact.Destroy%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_edgeShape%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_circleShape%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.AddType(%0A%20%20%20%20%20%20%20%20b2PolyAndEdgeContact.Create%2C%0A%20%20%20%20%20%20%20%20b2PolyAndEdgeContact.Destroy%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_polygonShape%2C%0A%20%20%20%20%20%20%20%20b2Shape.e_edgeShape%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactFactory.prototype.Create%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20var%20type1%20%3D%20parseInt(fixtureA.GetType())%3B%0A%20%20%20%20%20%20var%20type2%20%3D%20parseInt(fixtureB.GetType())%3B%0A%20%20%20%20%20%20var%20reg%20%3D%20this.m_registers%5Btype1%5D%5Btype2%5D%3B%0A%20%20%20%20%20%20var%20c%3B%0A%20%20%20%20%20%20if%20(reg.pool)%20%7B%0A%20%20%20%20%20%20%20%20c%20%3D%20reg.pool%3B%0A%20%20%20%20%20%20%20%20reg.pool%20%3D%20c.m_next%3B%0A%20%20%20%20%20%20%20%20reg.poolCount--%3B%0A%20%20%20%20%20%20%20%20c.Reset(fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20createFcn%20%3D%20reg.createFcn%3B%0A%20%20%20%20%20%20if%20(createFcn%20!%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20if%20(reg.primary)%20%7B%0A%20%20%20%20%20%20%20%20%20%20c%20%3D%20createFcn(this.m_allocator)%3B%0A%20%20%20%20%20%20%20%20%20%20c.Reset(fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20c%20%3D%20createFcn(this.m_allocator)%3B%0A%20%20%20%20%20%20%20%20%20%20c.Reset(fixtureB%2C%20fixtureA)%3B%0A%20%20%20%20%20%20%20%20%20%20return%20c%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactFactory.prototype.Destroy%20%3D%20function%20(contact)%20%7B%0A%20%20%20%20%20%20if%20(contact.m_manifold.m_pointCount%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20contact.m_fixtureA.m_body.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20contact.m_fixtureB.m_body.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20type1%20%3D%20parseInt(contact.m_fixtureA.GetType())%3B%0A%20%20%20%20%20%20var%20type2%20%3D%20parseInt(contact.m_fixtureB.GetType())%3B%0A%20%20%20%20%20%20var%20reg%20%3D%20this.m_registers%5Btype1%5D%5Btype2%5D%3B%0A%20%20%20%20%20%20if%20(true)%20%7B%0A%20%20%20%20%20%20%20%20reg.poolCount%2B%2B%3B%0A%20%20%20%20%20%20%20%20contact.m_next%20%3D%20reg.pool%3B%0A%20%20%20%20%20%20%20%20reg.pool%20%3D%20contact%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20destroyFcn%20%3D%20reg.destroyFcn%3B%0A%20%20%20%20%20%20destroyFcn(contact%2C%20this.m_allocator)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactRegister.b2ContactRegister%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactResult.b2ContactResult%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.position%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.id%20%3D%20new%20b2ContactID()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactSolver.b2ContactSolver%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_step%20%3D%20new%20b2TimeStep()%3B%0A%20%20%20%20%20%20this.m_constraints%20%3D%20new%20Vector()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactSolver.prototype.b2ContactSolver%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2ContactSolver.prototype.Initialize%20%3D%20function%20(%0A%20%20%20%20%20%20step%2C%0A%20%20%20%20%20%20contacts%2C%0A%20%20%20%20%20%20contactCount%2C%0A%20%20%20%20%20%20allocator%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(contactCount%20%3D%3D%3D%20undefined)%20contactCount%20%3D%200%3B%0A%20%20%20%20%20%20var%20contact%3B%0A%20%20%20%20%20%20this.m_step.Set(step)%3B%0A%20%20%20%20%20%20this.m_allocator%20%3D%20allocator%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20this.m_constraintCount%20%3D%20contactCount%3B%0A%20%20%20%20%20%20while%20(this.m_constraints.length%20%3C%20this.m_constraintCount)%20%7B%0A%20%20%20%20%20%20%20%20this.m_constraints%5Bthis.m_constraints.length%5D%20%3D%20new%20b2ContactConstraint()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20contactCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20contact%20%3D%20contacts%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20fixtureA%20%3D%20contact.m_fixtureA%3B%0A%20%20%20%20%20%20%20%20var%20fixtureB%20%3D%20contact.m_fixtureB%3B%0A%20%20%20%20%20%20%20%20var%20shapeA%20%3D%20fixtureA.m_shape%3B%0A%20%20%20%20%20%20%20%20var%20shapeB%20%3D%20fixtureB.m_shape%3B%0A%20%20%20%20%20%20%20%20var%20radiusA%20%3D%20shapeA.m_radius%3B%0A%20%20%20%20%20%20%20%20var%20radiusB%20%3D%20shapeB.m_radius%3B%0A%20%20%20%20%20%20%20%20var%20bodyA%20%3D%20fixtureA.m_body%3B%0A%20%20%20%20%20%20%20%20var%20bodyB%20%3D%20fixtureB.m_body%3B%0A%20%20%20%20%20%20%20%20var%20manifold%20%3D%20contact.GetManifold()%3B%0A%20%20%20%20%20%20%20%20var%20friction%20%3D%20b2Settings.b2MixFriction(%0A%20%20%20%20%20%20%20%20%20%20fixtureA.GetFriction()%2C%0A%20%20%20%20%20%20%20%20%20%20fixtureB.GetFriction()%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20restitution%20%3D%20b2Settings.b2MixRestitution(%0A%20%20%20%20%20%20%20%20%20%20fixtureA.GetRestitution()%2C%0A%20%20%20%20%20%20%20%20%20%20fixtureB.GetRestitution()%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20vAX%20%3D%20bodyA.m_linearVelocity.x%3B%0A%20%20%20%20%20%20%20%20var%20vAY%20%3D%20bodyA.m_linearVelocity.y%3B%0A%20%20%20%20%20%20%20%20var%20vBX%20%3D%20bodyB.m_linearVelocity.x%3B%0A%20%20%20%20%20%20%20%20var%20vBY%20%3D%20bodyB.m_linearVelocity.y%3B%0A%20%20%20%20%20%20%20%20var%20wA%20%3D%20bodyA.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20var%20wB%20%3D%20bodyB.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20b2Settings.b2Assert(manifold.m_pointCount%20%3E%200)%3B%0A%20%20%20%20%20%20%20%20b2ContactSolver.s_worldManifold.Initialize(%0A%20%20%20%20%20%20%20%20%20%20manifold%2C%0A%20%20%20%20%20%20%20%20%20%20bodyA.m_xf%2C%0A%20%20%20%20%20%20%20%20%20%20radiusA%2C%0A%20%20%20%20%20%20%20%20%20%20bodyB.m_xf%2C%0A%20%20%20%20%20%20%20%20%20%20radiusB%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20normalX%20%3D%20b2ContactSolver.s_worldManifold.m_normal.x%3B%0A%20%20%20%20%20%20%20%20var%20normalY%20%3D%20b2ContactSolver.s_worldManifold.m_normal.y%3B%0A%20%20%20%20%20%20%20%20var%20cc%20%3D%20this.m_constraints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20cc.bodyA%20%3D%20bodyA%3B%0A%20%20%20%20%20%20%20%20cc.bodyB%20%3D%20bodyB%3B%0A%20%20%20%20%20%20%20%20cc.manifold%20%3D%20manifold%3B%0A%20%20%20%20%20%20%20%20cc.normal.x%20%3D%20normalX%3B%0A%20%20%20%20%20%20%20%20cc.normal.y%20%3D%20normalY%3B%0A%20%20%20%20%20%20%20%20cc.pointCount%20%3D%20manifold.m_pointCount%3B%0A%20%20%20%20%20%20%20%20cc.friction%20%3D%20friction%3B%0A%20%20%20%20%20%20%20%20cc.restitution%20%3D%20restitution%3B%0A%20%20%20%20%20%20%20%20cc.localPlaneNormal.x%20%3D%20manifold.m_localPlaneNormal.x%3B%0A%20%20%20%20%20%20%20%20cc.localPlaneNormal.y%20%3D%20manifold.m_localPlaneNormal.y%3B%0A%20%20%20%20%20%20%20%20cc.localPoint.x%20%3D%20manifold.m_localPoint.x%3B%0A%20%20%20%20%20%20%20%20cc.localPoint.y%20%3D%20manifold.m_localPoint.y%3B%0A%20%20%20%20%20%20%20%20cc.radius%20%3D%20radiusA%20%2B%20radiusB%3B%0A%20%20%20%20%20%20%20%20cc.type%20%3D%20manifold.m_type%3B%0A%20%20%20%20%20%20%20%20for%20(var%20k%20%3D%200%3B%20k%20%3C%20cc.pointCount%3B%20%2B%2Bk)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20cp%20%3D%20manifold.m_points%5Bk%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20ccp%20%3D%20cc.points%5Bk%5D%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.normalImpulse%20%3D%20cp.m_normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.tangentImpulse%20%3D%20cp.m_tangentImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.localPoint.SetV(cp.m_localPoint)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rAX%20%3D%20(ccp.rA.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20b2ContactSolver.s_worldManifold.m_points%5Bk%5D.x%20-%20bodyA.m_sweep.c.x)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rAY%20%3D%20(ccp.rA.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20b2ContactSolver.s_worldManifold.m_points%5Bk%5D.y%20-%20bodyA.m_sweep.c.y)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rBX%20%3D%20(ccp.rB.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20b2ContactSolver.s_worldManifold.m_points%5Bk%5D.x%20-%20bodyB.m_sweep.c.x)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rBY%20%3D%20(ccp.rB.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20b2ContactSolver.s_worldManifold.m_points%5Bk%5D.y%20-%20bodyB.m_sweep.c.y)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rnA%20%3D%20rAX%20*%20normalY%20-%20rAY%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rnB%20%3D%20rBX%20*%20normalY%20-%20rBY%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20rnA%20*%3D%20rnA%3B%0A%20%20%20%20%20%20%20%20%20%20rnB%20*%3D%20rnB%3B%0A%20%20%20%20%20%20%20%20%20%20var%20kNormal%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_invMass%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_invMass%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_invI%20*%20rnA%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_invI%20*%20rnB%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.normalMass%20%3D%201.0%20%2F%20kNormal%3B%0A%20%20%20%20%20%20%20%20%20%20var%20kEqualized%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_mass%20*%20bodyA.m_invMass%20%2B%20bodyB.m_mass%20*%20bodyB.m_invMass%3B%0A%20%20%20%20%20%20%20%20%20%20kEqualized%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_mass%20*%20bodyA.m_invI%20*%20rnA%20%2B%20bodyB.m_mass%20*%20bodyB.m_invI%20*%20rnB%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.equalizedMass%20%3D%201.0%20%2F%20kEqualized%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tangentX%20%3D%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tangentY%20%3D%20-normalX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rtA%20%3D%20rAX%20*%20tangentY%20-%20rAY%20*%20tangentX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rtB%20%3D%20rBX%20*%20tangentY%20-%20rBY%20*%20tangentX%3B%0A%20%20%20%20%20%20%20%20%20%20rtA%20*%3D%20rtA%3B%0A%20%20%20%20%20%20%20%20%20%20rtB%20*%3D%20rtB%3B%0A%20%20%20%20%20%20%20%20%20%20var%20kTangent%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_invMass%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_invMass%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_invI%20*%20rtA%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_invI%20*%20rtB%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.tangentMass%20%3D%201.0%20%2F%20kTangent%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.velocityBias%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tX%20%3D%20vBX%20%2B%20-wB%20*%20rBY%20-%20vAX%20-%20-wA%20*%20rAY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20tY%20%3D%20vBY%20%2B%20wB%20*%20rBX%20-%20vAY%20-%20wA%20*%20rAX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20vRel%20%3D%20cc.normal.x%20*%20tX%20%2B%20cc.normal.y%20*%20tY%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(vRel%20%3C%20-b2Settings.b2_velocityThreshold)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20ccp.velocityBias%20%2B%3D%20-cc.restitution%20*%20vRel%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(cc.pointCount%20%3D%3D%202)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20ccp1%20%3D%20cc.points%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20ccp2%20%3D%20cc.points%5B1%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20invMassA%20%3D%20bodyA.m_invMass%3B%0A%20%20%20%20%20%20%20%20%20%20var%20invIA%20%3D%20bodyA.m_invI%3B%0A%20%20%20%20%20%20%20%20%20%20var%20invMassB%20%3D%20bodyB.m_invMass%3B%0A%20%20%20%20%20%20%20%20%20%20var%20invIB%20%3D%20bodyB.m_invI%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rn1A%20%3D%20ccp1.rA.x%20*%20normalY%20-%20ccp1.rA.y%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rn1B%20%3D%20ccp1.rB.x%20*%20normalY%20-%20ccp1.rB.y%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rn2A%20%3D%20ccp2.rA.x%20*%20normalY%20-%20ccp2.rA.y%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rn2B%20%3D%20ccp2.rB.x%20*%20normalY%20-%20ccp2.rB.y%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k11%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20invMassA%20%2B%20invMassB%20%2B%20invIA%20*%20rn1A%20*%20rn1A%20%2B%20invIB%20*%20rn1B%20*%20rn1B%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k22%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20invMassA%20%2B%20invMassB%20%2B%20invIA%20*%20rn2A%20*%20rn2A%20%2B%20invIB%20*%20rn2B%20*%20rn2B%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k12%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20invMassA%20%2B%20invMassB%20%2B%20invIA%20*%20rn1A%20*%20rn2A%20%2B%20invIB%20*%20rn1B%20*%20rn2B%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k_maxConditionNumber%20%3D%20100.0%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(k11%20*%20k11%20%3C%20k_maxConditionNumber%20*%20(k11%20*%20k22%20-%20k12%20*%20k12))%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20cc.K.col1.Set(k11%2C%20k12)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20cc.K.col2.Set(k12%2C%20k22)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20cc.K.GetInverse(cc.normalMass)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20cc.pointCount%20%3D%201%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactSolver.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20tVec2%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_constraintCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20this.m_constraints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20bodyA%20%3D%20c.bodyA%3B%0A%20%20%20%20%20%20%20%20var%20bodyB%20%3D%20c.bodyB%3B%0A%20%20%20%20%20%20%20%20var%20invMassA%20%3D%20bodyA.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invIA%20%3D%20bodyA.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20invMassB%20%3D%20bodyB.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invIB%20%3D%20bodyB.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20normalX%20%3D%20c.normal.x%3B%0A%20%20%20%20%20%20%20%20var%20normalY%20%3D%20c.normal.y%3B%0A%20%20%20%20%20%20%20%20var%20tangentX%20%3D%20normalY%3B%0A%20%20%20%20%20%20%20%20var%20tangentY%20%3D%20-normalX%3B%0A%20%20%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20%20%20var%20j%20%3D%200%3B%0A%20%20%20%20%20%20%20%20var%20tCount%20%3D%200%3B%0A%20%20%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20%20%20tCount%20%3D%20c.pointCount%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20tCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20ccp%20%3D%20c.points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ccp.normalImpulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ccp.tangentImpulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20PX%20%3D%20ccp.normalImpulse%20*%20normalX%20%2B%20ccp.tangentImpulse%20*%20tangentX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20PY%20%3D%20ccp.normalImpulse%20*%20normalY%20%2B%20ccp.tangentImpulse%20*%20tangentY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_angularVelocity%20-%3D%20invIA%20*%20(ccp.rA.x%20*%20PY%20-%20ccp.rA.y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_linearVelocity.x%20-%3D%20invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyA.m_linearVelocity.y%20-%3D%20invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_angularVelocity%20%2B%3D%20invIB%20*%20(ccp.rB.x%20*%20PY%20-%20ccp.rB.y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_linearVelocity.x%20%2B%3D%20invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20bodyB.m_linearVelocity.y%20%2B%3D%20invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20tCount%20%3D%20c.pointCount%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20tCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20ccp2%20%3D%20c.points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ccp2.normalImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20ccp2.tangentImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactSolver.prototype.SolveVelocityConstraints%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20j%20%3D%200%3B%0A%20%20%20%20%20%20var%20ccp%3B%0A%20%20%20%20%20%20var%20rAX%20%3D%200%3B%0A%20%20%20%20%20%20var%20rAY%20%3D%200%3B%0A%20%20%20%20%20%20var%20rBX%20%3D%200%3B%0A%20%20%20%20%20%20var%20rBY%20%3D%200%3B%0A%20%20%20%20%20%20var%20dvX%20%3D%200%3B%0A%20%20%20%20%20%20var%20dvY%20%3D%200%3B%0A%20%20%20%20%20%20var%20vn%20%3D%200%3B%0A%20%20%20%20%20%20var%20vt%20%3D%200%3B%0A%20%20%20%20%20%20var%20lambda%20%3D%200%3B%0A%20%20%20%20%20%20var%20maxFriction%20%3D%200%3B%0A%20%20%20%20%20%20var%20newImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20PX%20%3D%200%3B%0A%20%20%20%20%20%20var%20PY%20%3D%200%3B%0A%20%20%20%20%20%20var%20dX%20%3D%200%3B%0A%20%20%20%20%20%20var%20dY%20%3D%200%3B%0A%20%20%20%20%20%20var%20P1X%20%3D%200%3B%0A%20%20%20%20%20%20var%20P1Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20P2X%20%3D%200%3B%0A%20%20%20%20%20%20var%20P2Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_constraintCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20this.m_constraints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20bodyA%20%3D%20c.bodyA%3B%0A%20%20%20%20%20%20%20%20var%20bodyB%20%3D%20c.bodyB%3B%0A%20%20%20%20%20%20%20%20var%20wA%20%3D%20bodyA.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20var%20wB%20%3D%20bodyB.m_angularVelocity%3B%0A%20%20%20%20%20%20%20%20var%20vA%20%3D%20bodyA.m_linearVelocity%3B%0A%20%20%20%20%20%20%20%20var%20vB%20%3D%20bodyB.m_linearVelocity%3B%0A%20%20%20%20%20%20%20%20var%20invMassA%20%3D%20bodyA.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invIA%20%3D%20bodyA.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20invMassB%20%3D%20bodyB.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invIB%20%3D%20bodyB.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20normalX%20%3D%20c.normal.x%3B%0A%20%20%20%20%20%20%20%20var%20normalY%20%3D%20c.normal.y%3B%0A%20%20%20%20%20%20%20%20var%20tangentX%20%3D%20normalY%3B%0A%20%20%20%20%20%20%20%20var%20tangentY%20%3D%20-normalX%3B%0A%20%20%20%20%20%20%20%20var%20friction%20%3D%20c.friction%3B%0A%20%20%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20%20%20for%20(j%20%3D%200%3B%20j%20%3C%20c.pointCount%3B%20j%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20ccp%20%3D%20c.points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20dvX%20%3D%20vB.x%20-%20wB%20*%20ccp.rB.y%20-%20vA.x%20%2B%20wA%20*%20ccp.rA.y%3B%0A%20%20%20%20%20%20%20%20%20%20dvY%20%3D%20vB.y%20%2B%20wB%20*%20ccp.rB.x%20-%20vA.y%20-%20wA%20*%20ccp.rA.x%3B%0A%20%20%20%20%20%20%20%20%20%20vt%20%3D%20dvX%20*%20tangentX%20%2B%20dvY%20*%20tangentY%3B%0A%20%20%20%20%20%20%20%20%20%20lambda%20%3D%20ccp.tangentMass%20*%20-vt%3B%0A%20%20%20%20%20%20%20%20%20%20maxFriction%20%3D%20friction%20*%20ccp.normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20newImpulse%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20ccp.tangentImpulse%20%2B%20lambda%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-maxFriction%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20maxFriction%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20lambda%20%3D%20newImpulse%20-%20ccp.tangentImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20PX%20%3D%20lambda%20*%20tangentX%3B%0A%20%20%20%20%20%20%20%20%20%20PY%20%3D%20lambda%20*%20tangentY%3B%0A%20%20%20%20%20%20%20%20%20%20vA.x%20-%3D%20invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20vA.y%20-%3D%20invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20wA%20-%3D%20invIA%20*%20(ccp.rA.x%20*%20PY%20-%20ccp.rA.y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20wB%20%2B%3D%20invIB%20*%20(ccp.rB.x%20*%20PY%20-%20ccp.rB.y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.tangentImpulse%20%3D%20newImpulse%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20tCount%20%3D%20parseInt(c.pointCount)%3B%0A%20%20%20%20%20%20%20%20if%20(c.pointCount%20%3D%3D%201)%20%7B%0A%20%20%20%20%20%20%20%20%20%20ccp%20%3D%20c.points%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20dvX%20%3D%20vB.x%20%2B%20-wB%20*%20ccp.rB.y%20-%20vA.x%20-%20-wA%20*%20ccp.rA.y%3B%0A%20%20%20%20%20%20%20%20%20%20dvY%20%3D%20vB.y%20%2B%20wB%20*%20ccp.rB.x%20-%20vA.y%20-%20wA%20*%20ccp.rA.x%3B%0A%20%20%20%20%20%20%20%20%20%20vn%20%3D%20dvX%20*%20normalX%20%2B%20dvY%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20lambda%20%3D%20-ccp.normalMass%20*%20(vn%20-%20ccp.velocityBias)%3B%0A%20%20%20%20%20%20%20%20%20%20newImpulse%20%3D%20ccp.normalImpulse%20%2B%20lambda%3B%0A%20%20%20%20%20%20%20%20%20%20newImpulse%20%3D%20newImpulse%20%3E%200%20%3F%20newImpulse%20%3A%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20lambda%20%3D%20newImpulse%20-%20ccp.normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20PX%20%3D%20lambda%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20PY%20%3D%20lambda%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20vA.x%20-%3D%20invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20vA.y%20-%3D%20invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20wA%20-%3D%20invIA%20*%20(ccp.rA.x%20*%20PY%20-%20ccp.rA.y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20wB%20%2B%3D%20invIB%20*%20(ccp.rB.x%20*%20PY%20-%20ccp.rB.y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20ccp.normalImpulse%20%3D%20newImpulse%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20cp1%20%3D%20c.points%5B0%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20cp2%20%3D%20c.points%5B1%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20aX%20%3D%20cp1.normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20var%20aY%20%3D%20cp2.normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20var%20dv1X%20%3D%20vB.x%20-%20wB%20*%20cp1.rB.y%20-%20vA.x%20%2B%20wA%20*%20cp1.rA.y%3B%0A%20%20%20%20%20%20%20%20%20%20var%20dv1Y%20%3D%20vB.y%20%2B%20wB%20*%20cp1.rB.x%20-%20vA.y%20-%20wA%20*%20cp1.rA.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20dv2X%20%3D%20vB.x%20-%20wB%20*%20cp2.rB.y%20-%20vA.x%20%2B%20wA%20*%20cp2.rA.y%3B%0A%20%20%20%20%20%20%20%20%20%20var%20dv2Y%20%3D%20vB.y%20%2B%20wB%20*%20cp2.rB.x%20-%20vA.y%20-%20wA%20*%20cp2.rA.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20vn1%20%3D%20dv1X%20*%20normalX%20%2B%20dv1Y%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20vn2%20%3D%20dv2X%20*%20normalX%20%2B%20dv2Y%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20bX%20%3D%20vn1%20-%20cp1.velocityBias%3B%0A%20%20%20%20%20%20%20%20%20%20var%20bY%20%3D%20vn2%20-%20cp2.velocityBias%3B%0A%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20c.K%3B%0A%20%20%20%20%20%20%20%20%20%20bX%20-%3D%20tMat.col1.x%20*%20aX%20%2B%20tMat.col2.x%20*%20aY%3B%0A%20%20%20%20%20%20%20%20%20%20bY%20-%3D%20tMat.col1.y%20*%20aX%20%2B%20tMat.col2.y%20*%20aY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k_errorTol%20%3D%200.001%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(%3B%3B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20c.normalMass%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20xX%20%3D%20-(tMat.col1.x%20*%20bX%20%2B%20tMat.col2.x%20*%20bY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20xY%20%3D%20-(tMat.col1.y%20*%20bX%20%2B%20tMat.col2.y%20*%20bY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(xX%20%3E%3D%200.0%20%26%26%20xY%20%3E%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dX%20%3D%20xX%20-%20aX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dY%20%3D%20xY%20-%20aY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1X%20%3D%20dX%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1Y%20%3D%20dX%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2X%20%3D%20dY%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2Y%20%3D%20dY%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.x%20-%3D%20invMassA%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.y%20-%3D%20invMassA%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wA%20-%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIA%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rA.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rA.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20invMassB%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20invMassB%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wB%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIB%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rB.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rB.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.normalImpulse%20%3D%20xX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.normalImpulse%20%3D%20xY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20xX%20%3D%20-cp1.normalMass%20*%20bX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20xY%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vn1%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vn2%20%3D%20c.K.col1.y%20*%20xX%20%2B%20bY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(xX%20%3E%3D%200.0%20%26%26%20vn2%20%3E%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dX%20%3D%20xX%20-%20aX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dY%20%3D%20xY%20-%20aY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1X%20%3D%20dX%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1Y%20%3D%20dX%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2X%20%3D%20dY%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2Y%20%3D%20dY%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.x%20-%3D%20invMassA%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.y%20-%3D%20invMassA%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wA%20-%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIA%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rA.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rA.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20invMassB%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20invMassB%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wB%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIB%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rB.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rB.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.normalImpulse%20%3D%20xX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.normalImpulse%20%3D%20xY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20xX%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20xY%20%3D%20-cp2.normalMass%20*%20bY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vn1%20%3D%20c.K.col2.x%20*%20xY%20%2B%20bX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vn2%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(xY%20%3E%3D%200.0%20%26%26%20vn1%20%3E%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dX%20%3D%20xX%20-%20aX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dY%20%3D%20xY%20-%20aY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1X%20%3D%20dX%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1Y%20%3D%20dX%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2X%20%3D%20dY%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2Y%20%3D%20dY%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.x%20-%3D%20invMassA%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.y%20-%3D%20invMassA%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wA%20-%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIA%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rA.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rA.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20invMassB%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20invMassB%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wB%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIB%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rB.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rB.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.normalImpulse%20%3D%20xX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.normalImpulse%20%3D%20xY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20xX%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20xY%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vn1%20%3D%20bX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20vn2%20%3D%20bY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(vn1%20%3E%3D%200.0%20%26%26%20vn2%20%3E%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dX%20%3D%20xX%20-%20aX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dY%20%3D%20xY%20-%20aY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1X%20%3D%20dX%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P1Y%20%3D%20dX%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2X%20%3D%20dY%20*%20normalX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20P2Y%20%3D%20dY%20*%20normalY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.x%20-%3D%20invMassA%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vA.y%20-%3D%20invMassA%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wA%20-%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIA%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rA.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rA.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rA.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20invMassB%20*%20(P1X%20%2B%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20invMassB%20*%20(P1Y%20%2B%20P2Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20wB%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20invIB%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(cp1.rB.x%20*%20P1Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.rB.y%20*%20P1X%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.x%20*%20P2Y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.rB.y%20*%20P2X)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp1.normalImpulse%20%3D%20xX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cp2.normalImpulse%20%3D%20xY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20bodyA.m_angularVelocity%20%3D%20wA%3B%0A%20%20%20%20%20%20%20%20bodyB.m_angularVelocity%20%3D%20wB%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactSolver.prototype.FinalizeVelocityConstraints%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_constraintCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20this.m_constraints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20m%20%3D%20c.manifold%3B%0A%20%20%20%20%20%20%20%20for%20(var%20j%20%3D%200%3B%20j%20%3C%20c.pointCount%3B%20%2B%2Bj)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20point1%20%3D%20m.m_points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20point2%20%3D%20c.points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20point1.m_normalImpulse%20%3D%20point2.normalImpulse%3B%0A%20%20%20%20%20%20%20%20%20%20point1.m_tangentImpulse%20%3D%20point2.tangentImpulse%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ContactSolver.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20minSeparation%20%3D%200.0%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20this.m_constraintCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20var%20c%20%3D%20this.m_constraints%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20var%20bodyA%20%3D%20c.bodyA%3B%0A%20%20%20%20%20%20%20%20var%20bodyB%20%3D%20c.bodyB%3B%0A%20%20%20%20%20%20%20%20var%20invMassA%20%3D%20bodyA.m_mass%20*%20bodyA.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invIA%20%3D%20bodyA.m_mass%20*%20bodyA.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20invMassB%20%3D%20bodyB.m_mass%20*%20bodyB.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invIB%20%3D%20bodyB.m_mass%20*%20bodyB.m_invI%3B%0A%20%20%20%20%20%20%20%20b2ContactSolver.s_psm.Initialize(c)%3B%0A%20%20%20%20%20%20%20%20var%20normal%20%3D%20b2ContactSolver.s_psm.m_normal%3B%0A%20%20%20%20%20%20%20%20for%20(var%20j%20%3D%200%3B%20j%20%3C%20c.pointCount%3B%20j%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20ccp%20%3D%20c.points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20point%20%3D%20b2ContactSolver.s_psm.m_points%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20separation%20%3D%20b2ContactSolver.s_psm.m_separations%5Bj%5D%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rAX%20%3D%20point.x%20-%20bodyA.m_sweep.c.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rAY%20%3D%20point.y%20-%20bodyA.m_sweep.c.y%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rBX%20%3D%20point.x%20-%20bodyB.m_sweep.c.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20rBY%20%3D%20point.y%20-%20bodyB.m_sweep.c.y%3B%0A%20%20%20%20%20%20%20%20%20%20minSeparation%20%3D%20minSeparation%20%3C%20separation%20%3F%20minSeparation%20%3A%20separation%3B%0A%20%20%20%20%20%20%20%20%20%20var%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20baumgarte%20*%20(separation%20%2B%20b2Settings.b2_linearSlop)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20var%20impulse%20%3D%20-ccp.equalizedMass%20*%20C%3B%0A%20%20%20%20%20%20%20%20%20%20var%20PX%20%3D%20impulse%20*%20normal.x%3B%0A%20%20%20%20%20%20%20%20%20%20var%20PY%20%3D%20impulse%20*%20normal.y%3B%0A%20%20%20%20%20%20%20%20%20%20bodyA.m_sweep.c.x%20-%3D%20invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20bodyA.m_sweep.c.y%20-%3D%20invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20bodyA.m_sweep.a%20-%3D%20invIA%20*%20(rAX%20*%20PY%20-%20rAY%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20bodyA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20%20%20bodyB.m_sweep.c.x%20%2B%3D%20invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20%20%20bodyB.m_sweep.c.y%20%2B%3D%20invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20%20%20bodyB.m_sweep.a%20%2B%3D%20invIB%20*%20(rBX%20*%20PY%20-%20rBY%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20%20%20bodyB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20minSeparation%20%3E%20-1.5%20*%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold%20%3D%0A%20%20%20%20%20%20%20%20new%20b2WorldManifold()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2ContactSolver.s_psm%20%3D%0A%20%20%20%20%20%20%20%20new%20b2PositionSolverManifold()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Box2D.inherit(b2EdgeAndCircleContact%2C%20Box2D.Dynamics.Contacts.b2Contact)%3B%0A%20%20%20%20b2EdgeAndCircleContact.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.prototype%3B%0A%20%20%20%20b2EdgeAndCircleContact.b2EdgeAndCircleContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeAndCircleContact.Create%20%3D%20function%20(allocator)%20%7B%0A%20%20%20%20%20%20return%20new%20b2EdgeAndCircleContact()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeAndCircleContact.Destroy%20%3D%20function%20(contact%2C%20allocator)%20%7B%7D%3B%0A%20%20%20%20b2EdgeAndCircleContact.prototype.Reset%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20this.__super.Reset.call(this%2C%20fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeAndCircleContact.prototype.Evaluate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_fixtureB.GetBody()%3B%0A%20%20%20%20%20%20this.b2CollideEdgeAndCircle(%0A%20%20%20%20%20%20%20%20this.m_manifold%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureA.GetShape()%20instanceof%20b2EdgeShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureA.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bA.m_xf%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureB.GetShape()%20instanceof%20b2CircleShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureB.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bB.m_xf%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2EdgeAndCircleContact.prototype.b2CollideEdgeAndCircle%20%3D%20function%20(%0A%20%20%20%20%20%20manifold%2C%0A%20%20%20%20%20%20edge%2C%0A%20%20%20%20%20%20xf1%2C%0A%20%20%20%20%20%20circle%2C%0A%20%20%20%20%20%20xf2%0A%20%20%20%20)%20%7B%7D%3B%0A%20%20%20%20Box2D.inherit(b2NullContact%2C%20Box2D.Dynamics.Contacts.b2Contact)%3B%0A%20%20%20%20b2NullContact.prototype.__super%20%3D%20Box2D.Dynamics.Contacts.b2Contact.prototype%3B%0A%20%20%20%20b2NullContact.b2NullContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2NullContact.prototype.b2NullContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2Contact.call(this)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2NullContact.prototype.Evaluate%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20Box2D.inherit(b2PolyAndCircleContact%2C%20Box2D.Dynamics.Contacts.b2Contact)%3B%0A%20%20%20%20b2PolyAndCircleContact.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.prototype%3B%0A%20%20%20%20b2PolyAndCircleContact.b2PolyAndCircleContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndCircleContact.Create%20%3D%20function%20(allocator)%20%7B%0A%20%20%20%20%20%20return%20new%20b2PolyAndCircleContact()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndCircleContact.Destroy%20%3D%20function%20(contact%2C%20allocator)%20%7B%7D%3B%0A%20%20%20%20b2PolyAndCircleContact.prototype.Reset%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20this.__super.Reset.call(this%2C%20fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(fixtureA.GetType()%20%3D%3D%20b2Shape.e_polygonShape)%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(fixtureB.GetType()%20%3D%3D%20b2Shape.e_circleShape)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndCircleContact.prototype.Evaluate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_fixtureA.m_body%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_fixtureB.m_body%3B%0A%20%20%20%20%20%20b2Collision.CollidePolygonAndCircle(%0A%20%20%20%20%20%20%20%20this.m_manifold%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureA.GetShape()%20instanceof%20b2PolygonShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureA.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bA.m_xf%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureB.GetShape()%20instanceof%20b2CircleShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureB.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bB.m_xf%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2PolyAndEdgeContact%2C%20Box2D.Dynamics.Contacts.b2Contact)%3B%0A%20%20%20%20b2PolyAndEdgeContact.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.prototype%3B%0A%20%20%20%20b2PolyAndEdgeContact.b2PolyAndEdgeContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndEdgeContact.Create%20%3D%20function%20(allocator)%20%7B%0A%20%20%20%20%20%20return%20new%20b2PolyAndEdgeContact()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndEdgeContact.Destroy%20%3D%20function%20(contact%2C%20allocator)%20%7B%7D%3B%0A%20%20%20%20b2PolyAndEdgeContact.prototype.Reset%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20this.__super.Reset.call(this%2C%20fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(fixtureA.GetType()%20%3D%3D%20b2Shape.e_polygonShape)%3B%0A%20%20%20%20%20%20b2Settings.b2Assert(fixtureB.GetType()%20%3D%3D%20b2Shape.e_edgeShape)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndEdgeContact.prototype.Evaluate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_fixtureB.GetBody()%3B%0A%20%20%20%20%20%20this.b2CollidePolyAndEdge(%0A%20%20%20%20%20%20%20%20this.m_manifold%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureA.GetShape()%20instanceof%20b2PolygonShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureA.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bA.m_xf%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureB.GetShape()%20instanceof%20b2EdgeShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureB.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bB.m_xf%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolyAndEdgeContact.prototype.b2CollidePolyAndEdge%20%3D%20function%20(%0A%20%20%20%20%20%20manifold%2C%0A%20%20%20%20%20%20polygon%2C%0A%20%20%20%20%20%20xf1%2C%0A%20%20%20%20%20%20edge%2C%0A%20%20%20%20%20%20xf2%0A%20%20%20%20)%20%7B%7D%3B%0A%20%20%20%20Box2D.inherit(b2PolygonContact%2C%20Box2D.Dynamics.Contacts.b2Contact)%3B%0A%20%20%20%20b2PolygonContact.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.prototype%3B%0A%20%20%20%20b2PolygonContact.b2PolygonContact%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonContact.Create%20%3D%20function%20(allocator)%20%7B%0A%20%20%20%20%20%20return%20new%20b2PolygonContact()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonContact.Destroy%20%3D%20function%20(contact%2C%20allocator)%20%7B%7D%3B%0A%20%20%20%20b2PolygonContact.prototype.Reset%20%3D%20function%20(fixtureA%2C%20fixtureB)%20%7B%0A%20%20%20%20%20%20this.__super.Reset.call(this%2C%20fixtureA%2C%20fixtureB)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PolygonContact.prototype.Evaluate%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_fixtureA.GetBody()%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_fixtureB.GetBody()%3B%0A%20%20%20%20%20%20b2Collision.CollidePolygons(%0A%20%20%20%20%20%20%20%20this.m_manifold%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureA.GetShape()%20instanceof%20b2PolygonShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureA.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bA.m_xf%2C%0A%20%20%20%20%20%20%20%20this.m_fixtureB.GetShape()%20instanceof%20b2PolygonShape%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.m_fixtureB.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%3A%20null%2C%0A%20%20%20%20%20%20%20%20bB.m_xf%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PositionSolverManifold.b2PositionSolverManifold%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2PositionSolverManifold.prototype.b2PositionSolverManifold%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_normal%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_separations%20%3D%20new%20Vector_a2j_Number(b2Settings.b2_maxManifoldPoints)%3B%0A%20%20%20%20%20%20this.m_points%20%3D%20new%20Vector(b2Settings.b2_maxManifoldPoints)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20b2Settings.b2_maxManifoldPoints%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20this.m_points%5Bi%5D%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PositionSolverManifold.prototype.Initialize%20%3D%20function%20(cc)%20%7B%0A%20%20%20%20%20%20b2Settings.b2Assert(cc.pointCount%20%3E%200)%3B%0A%20%20%20%20%20%20var%20i%20%3D%200%3B%0A%20%20%20%20%20%20var%20clipPointX%20%3D%200%3B%0A%20%20%20%20%20%20var%20clipPointY%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20planePointX%20%3D%200%3B%0A%20%20%20%20%20%20var%20planePointY%20%3D%200%3B%0A%20%20%20%20%20%20switch%20(cc.type)%20%7B%0A%20%20%20%20%20%20%20%20case%20b2Manifold.e_circles%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointAX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyA.m_xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointAY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyA.m_xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.points%5B0%5D.localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointBX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyB.m_xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20pointBY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyB.m_xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20dX%20%3D%20pointBX%20-%20pointAX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20dY%20%3D%20pointBY%20-%20pointAY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20var%20d2%20%3D%20dX%20*%20dX%20%2B%20dY%20*%20dY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(d2%20%3E%20Number.MIN_VALUE%20*%20Number.MIN_VALUE)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20var%20d%20%3D%20Math.sqrt(d2)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%20dX%20%2F%20d%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%20dY%20%2F%20d%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%201.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5B0%5D.x%20%3D%200.5%20*%20(pointAX%20%2B%20pointBX)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5B0%5D.y%20%3D%200.5%20*%20(pointAY%20%2B%20pointBY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_separations%5B0%5D%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dX%20*%20this.m_normal.x%20%2B%20dY%20*%20this.m_normal.y%20-%20cc.radius%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Manifold.e_faceA%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.localPlaneNormal%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyA.m_xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyA.m_xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20cc.pointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.points%5Bi%5D.localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyB.m_xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyB.m_xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_separations%5Bi%5D%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointX%20-%20planePointX)%20*%20this.m_normal.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointY%20-%20planePointY)%20*%20this.m_normal.y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.radius%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.x%20%3D%20clipPointX%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.y%20%3D%20clipPointY%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Manifold.e_faceB%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.localPlaneNormal%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyB.m_xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20planePointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyB.m_xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20tMat%20%3D%20cc.bodyA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20(i%20%3D%200%3B%20i%20%3C%20cc.pointCount%3B%20%2B%2Bi)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20tVec%20%3D%20cc.points%5Bi%5D.localPoint%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointX%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyA.m_xf.position.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20clipPointY%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.bodyA.m_xf.position.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_separations%5Bi%5D%20%3D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointX%20-%20planePointX)%20*%20this.m_normal.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(clipPointY%20-%20planePointY)%20*%20this.m_normal.y%20-%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20cc.radius%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.m_points%5Bi%5D.Set(clipPointX%2C%20clipPointY)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.x%20*%3D%20-1%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_normal.y%20*%3D%20-1%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA%20%3D%0A%20%20%20%20%20%20%20%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB%20%3D%0A%20%20%20%20%20%20%20%20new%20b2Vec2()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2Body%20%3D%20Box2D.Dynamics.b2Body%2C%0A%20%20%20%20%20%20b2BodyDef%20%3D%20Box2D.Dynamics.b2BodyDef%2C%0A%20%20%20%20%20%20b2ContactFilter%20%3D%20Box2D.Dynamics.b2ContactFilter%2C%0A%20%20%20%20%20%20b2ContactImpulse%20%3D%20Box2D.Dynamics.b2ContactImpulse%2C%0A%20%20%20%20%20%20b2ContactListener%20%3D%20Box2D.Dynamics.b2ContactListener%2C%0A%20%20%20%20%20%20b2ContactManager%20%3D%20Box2D.Dynamics.b2ContactManager%2C%0A%20%20%20%20%20%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%2C%0A%20%20%20%20%20%20b2DestructionListener%20%3D%20Box2D.Dynamics.b2DestructionListener%2C%0A%20%20%20%20%20%20b2FilterData%20%3D%20Box2D.Dynamics.b2FilterData%2C%0A%20%20%20%20%20%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%2C%0A%20%20%20%20%20%20b2FixtureDef%20%3D%20Box2D.Dynamics.b2FixtureDef%2C%0A%20%20%20%20%20%20b2Island%20%3D%20Box2D.Dynamics.b2Island%2C%0A%20%20%20%20%20%20b2TimeStep%20%3D%20Box2D.Dynamics.b2TimeStep%2C%0A%20%20%20%20%20%20b2World%20%3D%20Box2D.Dynamics.b2World%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%2C%0A%20%20%20%20%20%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2CircleShape%20%3D%20Box2D.Collision.Shapes.b2CircleShape%2C%0A%20%20%20%20%20%20b2EdgeChainDef%20%3D%20Box2D.Collision.Shapes.b2EdgeChainDef%2C%0A%20%20%20%20%20%20b2EdgeShape%20%3D%20Box2D.Collision.Shapes.b2EdgeShape%2C%0A%20%20%20%20%20%20b2MassData%20%3D%20Box2D.Collision.Shapes.b2MassData%2C%0A%20%20%20%20%20%20b2PolygonShape%20%3D%20Box2D.Collision.Shapes.b2PolygonShape%2C%0A%20%20%20%20%20%20b2Shape%20%3D%20Box2D.Collision.Shapes.b2Shape%2C%0A%20%20%20%20%20%20b2BuoyancyController%20%3D%20Box2D.Dynamics.Controllers.b2BuoyancyController%2C%0A%20%20%20%20%20%20b2ConstantAccelController%20%3D%0A%20%20%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2ConstantAccelController%2C%0A%20%20%20%20%20%20b2ConstantForceController%20%3D%0A%20%20%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2ConstantForceController%2C%0A%20%20%20%20%20%20b2Controller%20%3D%20Box2D.Dynamics.Controllers.b2Controller%2C%0A%20%20%20%20%20%20b2ControllerEdge%20%3D%20Box2D.Dynamics.Controllers.b2ControllerEdge%2C%0A%20%20%20%20%20%20b2GravityController%20%3D%20Box2D.Dynamics.Controllers.b2GravityController%2C%0A%20%20%20%20%20%20b2TensorDampingController%20%3D%0A%20%20%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2TensorDampingController%3B%0A%0A%20%20%20%20Box2D.inherit(b2BuoyancyController%2C%20Box2D.Dynamics.Controllers.b2Controller)%3B%0A%20%20%20%20b2BuoyancyController.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.prototype%3B%0A%20%20%20%20b2BuoyancyController.b2BuoyancyController%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.normal%20%3D%20new%20b2Vec2(0%2C%20-1)%3B%0A%20%20%20%20%20%20this.offset%20%3D%200%3B%0A%20%20%20%20%20%20this.density%20%3D%200%3B%0A%20%20%20%20%20%20this.velocity%20%3D%20new%20b2Vec2(0%2C%200)%3B%0A%20%20%20%20%20%20this.linearDrag%20%3D%202%3B%0A%20%20%20%20%20%20this.angularDrag%20%3D%201%3B%0A%20%20%20%20%20%20this.useDensity%20%3D%20false%3B%0A%20%20%20%20%20%20this.useWorldGravity%20%3D%20true%3B%0A%20%20%20%20%20%20this.gravity%20%3D%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2BuoyancyController.prototype.Step%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20if%20(!this.m_bodyList)%20return%3B%0A%20%20%20%20%20%20if%20(this.useWorldGravity)%20%7B%0A%20%20%20%20%20%20%20%20this.gravity%20%3D%20this.GetWorld().GetGravity().Copy()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20for%20(var%20i%20%3D%20this.m_bodyList%3B%20i%3B%20i%20%3D%20i.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20var%20body%20%3D%20i.body%3B%0A%20%20%20%20%20%20%20%20if%20(body.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20areac%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20var%20massc%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20var%20area%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20var%20mass%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20for%20(%0A%20%20%20%20%20%20%20%20%20%20var%20fixture%20%3D%20body.GetFixtureList()%3B%0A%20%20%20%20%20%20%20%20%20%20fixture%3B%0A%20%20%20%20%20%20%20%20%20%20fixture%20%3D%20fixture.GetNext()%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20sc%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20%20%20%20%20var%20sarea%20%3D%20fixture%0A%20%20%20%20%20%20%20%20%20%20%20%20.GetShape()%0A%20%20%20%20%20%20%20%20%20%20%20%20.ComputeSubmergedArea(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.normal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20this.offset%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20body.GetTransform()%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20sc%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20area%20%2B%3D%20sarea%3B%0A%20%20%20%20%20%20%20%20%20%20areac.x%20%2B%3D%20sarea%20*%20sc.x%3B%0A%20%20%20%20%20%20%20%20%20%20areac.y%20%2B%3D%20sarea%20*%20sc.y%3B%0A%20%20%20%20%20%20%20%20%20%20var%20shapeDensity%20%3D%200%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.useDensity)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20shapeDensity%20%3D%201%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20shapeDensity%20%3D%201%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20mass%20%2B%3D%20sarea%20*%20shapeDensity%3B%0A%20%20%20%20%20%20%20%20%20%20massc.x%20%2B%3D%20sarea%20*%20sc.x%20*%20shapeDensity%3B%0A%20%20%20%20%20%20%20%20%20%20massc.y%20%2B%3D%20sarea%20*%20sc.y%20*%20shapeDensity%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20areac.x%20%2F%3D%20area%3B%0A%20%20%20%20%20%20%20%20areac.y%20%2F%3D%20area%3B%0A%20%20%20%20%20%20%20%20massc.x%20%2F%3D%20mass%3B%0A%20%20%20%20%20%20%20%20massc.y%20%2F%3D%20mass%3B%0A%20%20%20%20%20%20%20%20if%20(area%20%3C%20Number.MIN_VALUE)%20continue%3B%0A%20%20%20%20%20%20%20%20var%20buoyancyForce%20%3D%20this.gravity.GetNegative()%3B%0A%20%20%20%20%20%20%20%20buoyancyForce.Multiply(this.density%20*%20area)%3B%0A%20%20%20%20%20%20%20%20body.ApplyForce(buoyancyForce%2C%20massc)%3B%0A%20%20%20%20%20%20%20%20var%20dragForce%20%3D%20body.GetLinearVelocityFromWorldPoint(areac)%3B%0A%20%20%20%20%20%20%20%20dragForce.Subtract(this.velocity)%3B%0A%20%20%20%20%20%20%20%20dragForce.Multiply(-this.linearDrag%20*%20area)%3B%0A%20%20%20%20%20%20%20%20body.ApplyForce(dragForce%2C%20areac)%3B%0A%20%20%20%20%20%20%20%20body.ApplyTorque(%0A%20%20%20%20%20%20%20%20%20%20(-body.GetInertia()%20%2F%20body.GetMass())%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20area%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20body.GetAngularVelocity()%20*%0A%20%20%20%20%20%20%20%20%20%20%20%20this.angularDrag%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2BuoyancyController.prototype.Draw%20%3D%20function%20(debugDraw)%20%7B%0A%20%20%20%20%20%20var%20r%20%3D%201000%3B%0A%20%20%20%20%20%20var%20p1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20p1.x%20%3D%20this.normal.x%20*%20this.offset%20%2B%20this.normal.y%20*%20r%3B%0A%20%20%20%20%20%20p1.y%20%3D%20this.normal.y%20*%20this.offset%20-%20this.normal.x%20*%20r%3B%0A%20%20%20%20%20%20p2.x%20%3D%20this.normal.x%20*%20this.offset%20-%20this.normal.y%20*%20r%3B%0A%20%20%20%20%20%20p2.y%20%3D%20this.normal.y%20*%20this.offset%20%2B%20this.normal.x%20*%20r%3B%0A%20%20%20%20%20%20var%20color%20%3D%20new%20b2Color(0%2C%200%2C%201)%3B%0A%20%20%20%20%20%20debugDraw.DrawSegment(p1%2C%20p2%2C%20color)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(%0A%20%20%20%20%20%20b2ConstantAccelController%2C%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller%0A%20%20%20%20)%3B%0A%20%20%20%20b2ConstantAccelController.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.prototype%3B%0A%20%20%20%20b2ConstantAccelController.b2ConstantAccelController%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.A%20%3D%20new%20b2Vec2(0%2C%200)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ConstantAccelController.prototype.Step%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20smallA%20%3D%20new%20b2Vec2(this.A.x%20*%20step.dt%2C%20this.A.y%20*%20step.dt)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%20this.m_bodyList%3B%20i%3B%20i%20%3D%20i.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20var%20body%20%3D%20i.body%3B%0A%20%20%20%20%20%20%20%20if%20(!body.IsAwake())%20continue%3B%0A%20%20%20%20%20%20%20%20body.SetLinearVelocity(%0A%20%20%20%20%20%20%20%20%20%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20%20%20%20%20body.GetLinearVelocity().x%20%2B%20smallA.x%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20body.GetLinearVelocity().y%20%2B%20smallA.y%0A%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(%0A%20%20%20%20%20%20b2ConstantForceController%2C%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller%0A%20%20%20%20)%3B%0A%20%20%20%20b2ConstantForceController.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.prototype%3B%0A%20%20%20%20b2ConstantForceController.b2ConstantForceController%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.F%20%3D%20new%20b2Vec2(0%2C%200)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ConstantForceController.prototype.Step%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%20this.m_bodyList%3B%20i%3B%20i%20%3D%20i.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20var%20body%20%3D%20i.body%3B%0A%20%20%20%20%20%20%20%20if%20(!body.IsAwake())%20continue%3B%0A%20%20%20%20%20%20%20%20body.ApplyForce(this.F%2C%20body.GetWorldCenter())%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Controller.b2Controller%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Controller.prototype.Step%20%3D%20function%20(step)%20%7B%7D%3B%0A%20%20%20%20b2Controller.prototype.Draw%20%3D%20function%20(debugDraw)%20%7B%7D%3B%0A%20%20%20%20b2Controller.prototype.AddBody%20%3D%20function%20(body)%20%7B%0A%20%20%20%20%20%20var%20edge%20%3D%20new%20b2ControllerEdge()%3B%0A%20%20%20%20%20%20edge.controller%20%3D%20this%3B%0A%20%20%20%20%20%20edge.body%20%3D%20body%3B%0A%20%20%20%20%20%20edge.nextBody%20%3D%20this.m_bodyList%3B%0A%20%20%20%20%20%20edge.prevBody%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_bodyList%20%3D%20edge%3B%0A%20%20%20%20%20%20if%20(edge.nextBody)%20edge.nextBody.prevBody%20%3D%20edge%3B%0A%20%20%20%20%20%20this.m_bodyCount%2B%2B%3B%0A%20%20%20%20%20%20edge.nextController%20%3D%20body.m_controllerList%3B%0A%20%20%20%20%20%20edge.prevController%20%3D%20null%3B%0A%20%20%20%20%20%20body.m_controllerList%20%3D%20edge%3B%0A%20%20%20%20%20%20if%20(edge.nextController)%20edge.nextController.prevController%20%3D%20edge%3B%0A%20%20%20%20%20%20body.m_controllerCount%2B%2B%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Controller.prototype.RemoveBody%20%3D%20function%20(body)%20%7B%0A%20%20%20%20%20%20var%20edge%20%3D%20body.m_controllerList%3B%0A%20%20%20%20%20%20while%20(edge%20%26%26%20edge.controller%20!%3D%20this)%20edge%20%3D%20edge.nextController%3B%0A%20%20%20%20%20%20if%20(edge.prevBody)%20edge.prevBody.nextBody%20%3D%20edge.nextBody%3B%0A%20%20%20%20%20%20if%20(edge.nextBody)%20edge.nextBody.prevBody%20%3D%20edge.prevBody%3B%0A%20%20%20%20%20%20if%20(edge.nextController)%0A%20%20%20%20%20%20%20%20edge.nextController.prevController%20%3D%20edge.prevController%3B%0A%20%20%20%20%20%20if%20(edge.prevController)%0A%20%20%20%20%20%20%20%20edge.prevController.nextController%20%3D%20edge.nextController%3B%0A%20%20%20%20%20%20if%20(this.m_bodyList%20%3D%3D%20edge)%20this.m_bodyList%20%3D%20edge.nextBody%3B%0A%20%20%20%20%20%20if%20(body.m_controllerList%20%3D%3D%20edge)%0A%20%20%20%20%20%20%20%20body.m_controllerList%20%3D%20edge.nextController%3B%0A%20%20%20%20%20%20body.m_controllerCount--%3B%0A%20%20%20%20%20%20this.m_bodyCount--%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Controller.prototype.Clear%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20while%20(this.m_bodyList)%20this.RemoveBody(this.m_bodyList.body)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Controller.prototype.GetNext%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_next%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Controller.prototype.GetWorld%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_world%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Controller.prototype.GetBodyList%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyList%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2ControllerEdge.b2ControllerEdge%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20Box2D.inherit(b2GravityController%2C%20Box2D.Dynamics.Controllers.b2Controller)%3B%0A%20%20%20%20b2GravityController.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.prototype%3B%0A%20%20%20%20b2GravityController.b2GravityController%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.G%20%3D%201%3B%0A%20%20%20%20%20%20this.invSqr%20%3D%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GravityController.prototype.Step%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20i%20%3D%20null%3B%0A%20%20%20%20%20%20var%20body1%20%3D%20null%3B%0A%20%20%20%20%20%20var%20p1%20%3D%20null%3B%0A%20%20%20%20%20%20var%20mass1%20%3D%200%3B%0A%20%20%20%20%20%20var%20j%20%3D%20null%3B%0A%20%20%20%20%20%20var%20body2%20%3D%20null%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20null%3B%0A%20%20%20%20%20%20var%20dx%20%3D%200%3B%0A%20%20%20%20%20%20var%20dy%20%3D%200%3B%0A%20%20%20%20%20%20var%20r2%20%3D%200%3B%0A%20%20%20%20%20%20var%20f%20%3D%20null%3B%0A%20%20%20%20%20%20if%20(this.invSqr)%20%7B%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%20this.m_bodyList%3B%20i%3B%20i%20%3D%20i.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20body1%20%3D%20i.body%3B%0A%20%20%20%20%20%20%20%20%20%20p1%20%3D%20body1.GetWorldCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20mass1%20%3D%20body1.GetMass()%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(j%20%3D%20this.m_bodyList%3B%20j%20!%3D%20i%3B%20j%20%3D%20j.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20body2%20%3D%20j.body%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2%20%3D%20body2.GetWorldCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20dx%20%3D%20p2.x%20-%20p1.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20dy%20%3D%20p2.y%20-%20p1.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20r2%20%3D%20dx%20*%20dx%20%2B%20dy%20*%20dy%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(r2%20%3C%20Number.MIN_VALUE)%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20f%20%3D%20new%20b2Vec2(dx%2C%20dy)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20f.Multiply((this.G%20%2F%20r2%20%2F%20Math.sqrt(r2))%20*%20mass1%20*%20body2.GetMass())%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(body1.IsAwake())%20body1.ApplyForce(f%2C%20p1)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20f.Multiply(-1)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(body2.IsAwake())%20body2.ApplyForce(f%2C%20p2)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20for%20(i%20%3D%20this.m_bodyList%3B%20i%3B%20i%20%3D%20i.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20body1%20%3D%20i.body%3B%0A%20%20%20%20%20%20%20%20%20%20p1%20%3D%20body1.GetWorldCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20mass1%20%3D%20body1.GetMass()%3B%0A%20%20%20%20%20%20%20%20%20%20for%20(j%20%3D%20this.m_bodyList%3B%20j%20!%3D%20i%3B%20j%20%3D%20j.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20body2%20%3D%20j.body%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20p2%20%3D%20body2.GetWorldCenter()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20dx%20%3D%20p2.x%20-%20p1.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20dy%20%3D%20p2.y%20-%20p1.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20r2%20%3D%20dx%20*%20dx%20%2B%20dy%20*%20dy%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(r2%20%3C%20Number.MIN_VALUE)%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20f%20%3D%20new%20b2Vec2(dx%2C%20dy)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20f.Multiply((this.G%20%2F%20r2)%20*%20mass1%20*%20body2.GetMass())%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(body1.IsAwake())%20body1.ApplyForce(f%2C%20p1)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20f.Multiply(-1)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(body2.IsAwake())%20body2.ApplyForce(f%2C%20p2)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(%0A%20%20%20%20%20%20b2TensorDampingController%2C%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller%0A%20%20%20%20)%3B%0A%20%20%20%20b2TensorDampingController.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.prototype%3B%0A%20%20%20%20b2TensorDampingController.b2TensorDampingController%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.T%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.maxTimestep%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2TensorDampingController.prototype.SetAxisAligned%20%3D%20function%20(%0A%20%20%20%20%20%20xDamping%2C%0A%20%20%20%20%20%20yDamping%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(xDamping%20%3D%3D%3D%20undefined)%20xDamping%20%3D%200%3B%0A%20%20%20%20%20%20if%20(yDamping%20%3D%3D%3D%20undefined)%20yDamping%20%3D%200%3B%0A%20%20%20%20%20%20this.T.col1.x%20%3D%20-xDamping%3B%0A%20%20%20%20%20%20this.T.col1.y%20%3D%200%3B%0A%20%20%20%20%20%20this.T.col2.x%20%3D%200%3B%0A%20%20%20%20%20%20this.T.col2.y%20%3D%20-yDamping%3B%0A%20%20%20%20%20%20if%20(xDamping%20%3E%200%20%7C%7C%20yDamping%20%3E%200)%20%7B%0A%20%20%20%20%20%20%20%20this.maxTimestep%20%3D%201%20%2F%20Math.max(xDamping%2C%20yDamping)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.maxTimestep%20%3D%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2TensorDampingController.prototype.Step%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20timestep%20%3D%20step.dt%3B%0A%20%20%20%20%20%20if%20(timestep%20%3C%3D%20Number.MIN_VALUE)%20return%3B%0A%20%20%20%20%20%20if%20(timestep%20%3E%20this.maxTimestep%20%26%26%20this.maxTimestep%20%3E%200)%0A%20%20%20%20%20%20%20%20timestep%20%3D%20this.maxTimestep%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%20this.m_bodyList%3B%20i%3B%20i%20%3D%20i.nextBody)%20%7B%0A%20%20%20%20%20%20%20%20var%20body%20%3D%20i.body%3B%0A%20%20%20%20%20%20%20%20if%20(!body.IsAwake())%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20damping%20%3D%20body.GetWorldVector(%0A%20%20%20%20%20%20%20%20%20%20b2Math.MulMV(this.T%2C%20body.GetLocalVector(body.GetLinearVelocity()))%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20body.SetLinearVelocity(%0A%20%20%20%20%20%20%20%20%20%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20%20%20%20%20body.GetLinearVelocity().x%20%2B%20damping.x%20*%20timestep%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20body.GetLinearVelocity().y%20%2B%20damping.y%20*%20timestep%0A%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2Color%20%3D%20Box2D.Common.b2Color%2C%0A%20%20%20%20%20%20b2internal%20%3D%20Box2D.Common.b2internal%2C%0A%20%20%20%20%20%20b2Settings%20%3D%20Box2D.Common.b2Settings%2C%0A%20%20%20%20%20%20b2Mat22%20%3D%20Box2D.Common.Math.b2Mat22%2C%0A%20%20%20%20%20%20b2Mat33%20%3D%20Box2D.Common.Math.b2Mat33%2C%0A%20%20%20%20%20%20b2Math%20%3D%20Box2D.Common.Math.b2Math%2C%0A%20%20%20%20%20%20b2Sweep%20%3D%20Box2D.Common.Math.b2Sweep%2C%0A%20%20%20%20%20%20b2Transform%20%3D%20Box2D.Common.Math.b2Transform%2C%0A%20%20%20%20%20%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%2C%0A%20%20%20%20%20%20b2Vec3%20%3D%20Box2D.Common.Math.b2Vec3%2C%0A%20%20%20%20%20%20b2DistanceJoint%20%3D%20Box2D.Dynamics.Joints.b2DistanceJoint%2C%0A%20%20%20%20%20%20b2DistanceJointDef%20%3D%20Box2D.Dynamics.Joints.b2DistanceJointDef%2C%0A%20%20%20%20%20%20b2FrictionJoint%20%3D%20Box2D.Dynamics.Joints.b2FrictionJoint%2C%0A%20%20%20%20%20%20b2FrictionJointDef%20%3D%20Box2D.Dynamics.Joints.b2FrictionJointDef%2C%0A%20%20%20%20%20%20b2GearJoint%20%3D%20Box2D.Dynamics.Joints.b2GearJoint%2C%0A%20%20%20%20%20%20b2GearJointDef%20%3D%20Box2D.Dynamics.Joints.b2GearJointDef%2C%0A%20%20%20%20%20%20b2Jacobian%20%3D%20Box2D.Dynamics.Joints.b2Jacobian%2C%0A%20%20%20%20%20%20b2Joint%20%3D%20Box2D.Dynamics.Joints.b2Joint%2C%0A%20%20%20%20%20%20b2JointDef%20%3D%20Box2D.Dynamics.Joints.b2JointDef%2C%0A%20%20%20%20%20%20b2JointEdge%20%3D%20Box2D.Dynamics.Joints.b2JointEdge%2C%0A%20%20%20%20%20%20b2LineJoint%20%3D%20Box2D.Dynamics.Joints.b2LineJoint%2C%0A%20%20%20%20%20%20b2LineJointDef%20%3D%20Box2D.Dynamics.Joints.b2LineJointDef%2C%0A%20%20%20%20%20%20b2MouseJoint%20%3D%20Box2D.Dynamics.Joints.b2MouseJoint%2C%0A%20%20%20%20%20%20b2MouseJointDef%20%3D%20Box2D.Dynamics.Joints.b2MouseJointDef%2C%0A%20%20%20%20%20%20b2PrismaticJoint%20%3D%20Box2D.Dynamics.Joints.b2PrismaticJoint%2C%0A%20%20%20%20%20%20b2PrismaticJointDef%20%3D%20Box2D.Dynamics.Joints.b2PrismaticJointDef%2C%0A%20%20%20%20%20%20b2PulleyJoint%20%3D%20Box2D.Dynamics.Joints.b2PulleyJoint%2C%0A%20%20%20%20%20%20b2PulleyJointDef%20%3D%20Box2D.Dynamics.Joints.b2PulleyJointDef%2C%0A%20%20%20%20%20%20b2RevoluteJoint%20%3D%20Box2D.Dynamics.Joints.b2RevoluteJoint%2C%0A%20%20%20%20%20%20b2RevoluteJointDef%20%3D%20Box2D.Dynamics.Joints.b2RevoluteJointDef%2C%0A%20%20%20%20%20%20b2WeldJoint%20%3D%20Box2D.Dynamics.Joints.b2WeldJoint%2C%0A%20%20%20%20%20%20b2WeldJointDef%20%3D%20Box2D.Dynamics.Joints.b2WeldJointDef%2C%0A%20%20%20%20%20%20b2Body%20%3D%20Box2D.Dynamics.b2Body%2C%0A%20%20%20%20%20%20b2BodyDef%20%3D%20Box2D.Dynamics.b2BodyDef%2C%0A%20%20%20%20%20%20b2ContactFilter%20%3D%20Box2D.Dynamics.b2ContactFilter%2C%0A%20%20%20%20%20%20b2ContactImpulse%20%3D%20Box2D.Dynamics.b2ContactImpulse%2C%0A%20%20%20%20%20%20b2ContactListener%20%3D%20Box2D.Dynamics.b2ContactListener%2C%0A%20%20%20%20%20%20b2ContactManager%20%3D%20Box2D.Dynamics.b2ContactManager%2C%0A%20%20%20%20%20%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%2C%0A%20%20%20%20%20%20b2DestructionListener%20%3D%20Box2D.Dynamics.b2DestructionListener%2C%0A%20%20%20%20%20%20b2FilterData%20%3D%20Box2D.Dynamics.b2FilterData%2C%0A%20%20%20%20%20%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%2C%0A%20%20%20%20%20%20b2FixtureDef%20%3D%20Box2D.Dynamics.b2FixtureDef%2C%0A%20%20%20%20%20%20b2Island%20%3D%20Box2D.Dynamics.b2Island%2C%0A%20%20%20%20%20%20b2TimeStep%20%3D%20Box2D.Dynamics.b2TimeStep%2C%0A%20%20%20%20%20%20b2World%20%3D%20Box2D.Dynamics.b2World%3B%0A%0A%20%20%20%20Box2D.inherit(b2DistanceJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2DistanceJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2DistanceJoint.b2DistanceJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_localAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_u%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_impulse%20*%20this.m_u.x%2C%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_impulse%20*%20this.m_u.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetLength%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_length%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.SetLength%20%3D%20function%20(length)%20%7B%0A%20%20%20%20%20%20if%20(length%20%3D%3D%3D%20undefined)%20length%20%3D%200%3B%0A%20%20%20%20%20%20this.m_length%20%3D%20length%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetFrequency%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_frequencyHz%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.SetFrequency%20%3D%20function%20(hz)%20%7B%0A%20%20%20%20%20%20if%20(hz%20%3D%3D%3D%20undefined)%20hz%20%3D%200%3B%0A%20%20%20%20%20%20this.m_frequencyHz%20%3D%20hz%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.GetDampingRatio%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_dampingRatio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.SetDampingRatio%20%3D%20function%20(ratio)%20%7B%0A%20%20%20%20%20%20if%20(ratio%20%3D%3D%3D%20undefined)%20ratio%20%3D%200%3B%0A%20%20%20%20%20%20this.m_dampingRatio%20%3D%20ratio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.b2DistanceJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20this.m_localAnchor1.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchor2.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_length%20%3D%20def.length%3B%0A%20%20%20%20%20%20this.m_frequencyHz%20%3D%20def.frequencyHz%3B%0A%20%20%20%20%20%20this.m_dampingRatio%20%3D%20def.dampingRatio%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_gamma%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_bias%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20this.m_u.x%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%20-%20bA.m_sweep.c.x%20-%20r1X%3B%0A%20%20%20%20%20%20this.m_u.y%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%20-%20bA.m_sweep.c.y%20-%20r1Y%3B%0A%20%20%20%20%20%20var%20length%20%3D%20Math.sqrt(this.m_u.x%20*%20this.m_u.x%20%2B%20this.m_u.y%20*%20this.m_u.y)%3B%0A%20%20%20%20%20%20if%20(length%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20this.m_u.Multiply(1.0%20%2F%20length)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_u.SetZero()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20cr1u%20%3D%20r1X%20*%20this.m_u.y%20-%20r1Y%20*%20this.m_u.x%3B%0A%20%20%20%20%20%20var%20cr2u%20%3D%20r2X%20*%20this.m_u.y%20-%20r2Y%20*%20this.m_u.x%3B%0A%20%20%20%20%20%20var%20invMass%20%3D%0A%20%20%20%20%20%20%20%20bA.m_invMass%20%2B%0A%20%20%20%20%20%20%20%20bA.m_invI%20*%20cr1u%20*%20cr1u%20%2B%0A%20%20%20%20%20%20%20%20bB.m_invMass%20%2B%0A%20%20%20%20%20%20%20%20bB.m_invI%20*%20cr2u%20*%20cr2u%3B%0A%20%20%20%20%20%20this.m_mass%20%3D%20invMass%20!%3D%200.0%20%3F%201.0%20%2F%20invMass%20%3A%200.0%3B%0A%20%20%20%20%20%20if%20(this.m_frequencyHz%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20var%20C%20%3D%20length%20-%20this.m_length%3B%0A%20%20%20%20%20%20%20%20var%20omega%20%3D%202.0%20*%20Math.PI%20*%20this.m_frequencyHz%3B%0A%20%20%20%20%20%20%20%20var%20d%20%3D%202.0%20*%20this.m_mass%20*%20this.m_dampingRatio%20*%20omega%3B%0A%20%20%20%20%20%20%20%20var%20k%20%3D%20this.m_mass%20*%20omega%20*%20omega%3B%0A%20%20%20%20%20%20%20%20this.m_gamma%20%3D%20step.dt%20*%20(d%20%2B%20step.dt%20*%20k)%3B%0A%20%20%20%20%20%20%20%20this.m_gamma%20%3D%20this.m_gamma%20!%3D%200.0%20%3F%201%20%2F%20this.m_gamma%20%3A%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_bias%20%3D%20C%20*%20step.dt%20*%20k%20*%20this.m_gamma%3B%0A%20%20%20%20%20%20%20%20this.m_mass%20%3D%20invMass%20%2B%20this.m_gamma%3B%0A%20%20%20%20%20%20%20%20this.m_mass%20%3D%20this.m_mass%20!%3D%200.0%20%3F%201.0%20%2F%20this.m_mass%20%3A%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20var%20PX%20%3D%20this.m_impulse%20*%20this.m_u.x%3B%0A%20%20%20%20%20%20%20%20var%20PY%20%3D%20this.m_impulse%20*%20this.m_u.y%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20bA.m_invMass%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20bA.m_invMass%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%20bA.m_invI%20*%20(r1X%20*%20PY%20-%20r1Y%20*%20PX)%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20bB.m_invMass%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20bB.m_invMass%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20PY%20-%20r2Y%20*%20PX)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20v1X%20%3D%20bA.m_linearVelocity.x%20%2B%20-bA.m_angularVelocity%20*%20r1Y%3B%0A%20%20%20%20%20%20var%20v1Y%20%3D%20bA.m_linearVelocity.y%20%2B%20bA.m_angularVelocity%20*%20r1X%3B%0A%20%20%20%20%20%20var%20v2X%20%3D%20bB.m_linearVelocity.x%20%2B%20-bB.m_angularVelocity%20*%20r2Y%3B%0A%20%20%20%20%20%20var%20v2Y%20%3D%20bB.m_linearVelocity.y%20%2B%20bB.m_angularVelocity%20*%20r2X%3B%0A%20%20%20%20%20%20var%20Cdot%20%3D%20this.m_u.x%20*%20(v2X%20-%20v1X)%20%2B%20this.m_u.y%20*%20(v2Y%20-%20v1Y)%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%0A%20%20%20%20%20%20%20%20-this.m_mass%20*%20(Cdot%20%2B%20this.m_bias%20%2B%20this.m_gamma%20*%20this.m_impulse)%3B%0A%20%20%20%20%20%20this.m_impulse%20%2B%3D%20impulse%3B%0A%20%20%20%20%20%20var%20PX%20%3D%20impulse%20*%20this.m_u.x%3B%0A%20%20%20%20%20%20var%20PY%20%3D%20impulse%20*%20this.m_u.y%3B%0A%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20bA.m_invMass%20*%20PX%3B%0A%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20bA.m_invMass%20*%20PY%3B%0A%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%20bA.m_invI%20*%20(r1X%20*%20PY%20-%20r1Y%20*%20PX)%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20bB.m_invMass%20*%20PX%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20bB.m_invMass%20*%20PY%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20PY%20-%20r2Y%20*%20PX)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20if%20(this.m_frequencyHz%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%20-%20bA.m_sweep.c.x%20-%20r1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%20-%20bA.m_sweep.c.y%20-%20r1Y%3B%0A%20%20%20%20%20%20var%20length%20%3D%20Math.sqrt(dX%20*%20dX%20%2B%20dY%20*%20dY)%3B%0A%20%20%20%20%20%20dX%20%2F%3D%20length%3B%0A%20%20%20%20%20%20dY%20%2F%3D%20length%3B%0A%20%20%20%20%20%20var%20C%20%3D%20length%20-%20this.m_length%3B%0A%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20C%2C%0A%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20b2Settings.b2_maxLinearCorrection%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20-this.m_mass%20*%20C%3B%0A%20%20%20%20%20%20this.m_u.Set(dX%2C%20dY)%3B%0A%20%20%20%20%20%20var%20PX%20%3D%20impulse%20*%20this.m_u.x%3B%0A%20%20%20%20%20%20var%20PY%20%3D%20impulse%20*%20this.m_u.y%3B%0A%20%20%20%20%20%20bA.m_sweep.c.x%20-%3D%20bA.m_invMass%20*%20PX%3B%0A%20%20%20%20%20%20bA.m_sweep.c.y%20-%3D%20bA.m_invMass%20*%20PY%3B%0A%20%20%20%20%20%20bA.m_sweep.a%20-%3D%20bA.m_invI%20*%20(r1X%20*%20PY%20-%20r1Y%20*%20PX)%3B%0A%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20bB.m_invMass%20*%20PX%3B%0A%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20bB.m_invMass%20*%20PY%3B%0A%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20PY%20-%20r2Y%20*%20PX)%3B%0A%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20return%20b2Math.Abs(C)%20%3C%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2DistanceJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2DistanceJointDef.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2DistanceJointDef.b2DistanceJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJointDef.prototype.b2DistanceJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_distanceJoint%3B%0A%20%20%20%20%20%20this.length%20%3D%201.0%3B%0A%20%20%20%20%20%20this.frequencyHz%20%3D%200.0%3B%0A%20%20%20%20%20%20this.dampingRatio%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DistanceJointDef.prototype.Initialize%20%3D%20function%20(%0A%20%20%20%20%20%20bA%2C%0A%20%20%20%20%20%20bB%2C%0A%20%20%20%20%20%20anchorA%2C%0A%20%20%20%20%20%20anchorB%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchorA))%3B%0A%20%20%20%20%20%20this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchorB))%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20anchorB.x%20-%20anchorA.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20anchorB.y%20-%20anchorA.y%3B%0A%20%20%20%20%20%20this.length%20%3D%20Math.sqrt(dX%20*%20dX%20%2B%20dY%20*%20dY)%3B%0A%20%20%20%20%20%20this.frequencyHz%20%3D%200.0%3B%0A%20%20%20%20%20%20this.dampingRatio%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2FrictionJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2FrictionJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2FrictionJoint.b2FrictionJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_linearMass%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.m_linearImpulse%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchorA)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchorB)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_linearImpulse.x%2C%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_linearImpulse.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20inv_dt%20*%20this.m_angularImpulse%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.SetMaxForce%20%3D%20function%20(force)%20%7B%0A%20%20%20%20%20%20if%20(force%20%3D%3D%3D%20undefined)%20force%20%3D%200%3B%0A%20%20%20%20%20%20this.m_maxForce%20%3D%20force%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.GetMaxForce%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_maxForce%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.SetMaxTorque%20%3D%20function%20(torque)%20%7B%0A%20%20%20%20%20%20if%20(torque%20%3D%3D%3D%20undefined)%20torque%20%3D%200%3B%0A%20%20%20%20%20%20this.m_maxTorque%20%3D%20torque%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.GetMaxTorque%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_maxTorque%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.b2FrictionJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20this.m_localAnchorA.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchorB.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_linearMass.SetZero()%3B%0A%20%20%20%20%20%20this.m_angularMass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_linearImpulse.SetZero()%3B%0A%20%20%20%20%20%20this.m_angularImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_maxForce%20%3D%20def.maxForce%3B%0A%20%20%20%20%20%20this.m_maxTorque%20%3D%20def.maxTorque%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20rAX%20%3D%20this.m_localAnchorA.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rAY%20%3D%20this.m_localAnchorA.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rAX%20%2B%20tMat.col2.x%20*%20rAY%3B%0A%20%20%20%20%20%20rAY%20%3D%20tMat.col1.y%20*%20rAX%20%2B%20tMat.col2.y%20*%20rAY%3B%0A%20%20%20%20%20%20rAX%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20rBX%20%3D%20this.m_localAnchorB.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rBY%20%3D%20this.m_localAnchorB.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rBX%20%2B%20tMat.col2.x%20*%20rBY%3B%0A%20%20%20%20%20%20rBY%20%3D%20tMat.col1.y%20*%20rBX%20%2B%20tMat.col2.y%20*%20rBY%3B%0A%20%20%20%20%20%20rBX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20mA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20mB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20iA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20iB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20var%20K%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20K.col1.x%20%3D%20mA%20%2B%20mB%3B%0A%20%20%20%20%20%20K.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20K.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20K.col2.y%20%3D%20mA%20%2B%20mB%3B%0A%20%20%20%20%20%20K.col1.x%20%2B%3D%20iA%20*%20rAY%20*%20rAY%3B%0A%20%20%20%20%20%20K.col2.x%20%2B%3D%20-iA%20*%20rAX%20*%20rAY%3B%0A%20%20%20%20%20%20K.col1.y%20%2B%3D%20-iA%20*%20rAX%20*%20rAY%3B%0A%20%20%20%20%20%20K.col2.y%20%2B%3D%20iA%20*%20rAX%20*%20rAX%3B%0A%20%20%20%20%20%20K.col1.x%20%2B%3D%20iB%20*%20rBY%20*%20rBY%3B%0A%20%20%20%20%20%20K.col2.x%20%2B%3D%20-iB%20*%20rBX%20*%20rBY%3B%0A%20%20%20%20%20%20K.col1.y%20%2B%3D%20-iB%20*%20rBX%20*%20rBY%3B%0A%20%20%20%20%20%20K.col2.y%20%2B%3D%20iB%20*%20rBX%20*%20rBX%3B%0A%20%20%20%20%20%20K.GetInverse(this.m_linearMass)%3B%0A%20%20%20%20%20%20this.m_angularMass%20%3D%20iA%20%2B%20iB%3B%0A%20%20%20%20%20%20if%20(this.m_angularMass%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_angularMass%20%3D%201.0%20%2F%20this.m_angularMass%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_linearImpulse.x%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_linearImpulse.y%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_angularImpulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20var%20P%20%3D%20this.m_linearImpulse%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20mA%20*%20P.x%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20mA%20*%20P.y%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%0A%20%20%20%20%20%20%20%20%20%20iA%20*%20(rAX%20*%20P.y%20-%20rAY%20*%20P.x%20%2B%20this.m_angularImpulse)%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20mB%20*%20P.x%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20mB%20*%20P.y%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20iB%20*%20(rBX%20*%20P.y%20-%20rBY%20*%20P.x%20%2B%20this.m_angularImpulse)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_linearImpulse.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_angularImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20vA%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20wA%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20vB%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20wB%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20mA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20mB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20iA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20iB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20rAX%20%3D%20this.m_localAnchorA.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rAY%20%3D%20this.m_localAnchorA.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rAX%20%2B%20tMat.col2.x%20*%20rAY%3B%0A%20%20%20%20%20%20rAY%20%3D%20tMat.col1.y%20*%20rAX%20%2B%20tMat.col2.y%20*%20rAY%3B%0A%20%20%20%20%20%20rAX%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20rBX%20%3D%20this.m_localAnchorB.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rBY%20%3D%20this.m_localAnchorB.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rBX%20%2B%20tMat.col2.x%20*%20rBY%3B%0A%20%20%20%20%20%20rBY%20%3D%20tMat.col1.y%20*%20rBX%20%2B%20tMat.col2.y%20*%20rBY%3B%0A%20%20%20%20%20%20rBX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20maxImpulse%20%3D%200%3B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20Cdot%20%3D%20wB%20-%20wA%3B%0A%20%20%20%20%20%20%20%20var%20impulse%20%3D%20-this.m_angularMass%20*%20Cdot%3B%0A%20%20%20%20%20%20%20%20var%20oldImpulse%20%3D%20this.m_angularImpulse%3B%0A%20%20%20%20%20%20%20%20maxImpulse%20%3D%20step.dt%20*%20this.m_maxTorque%3B%0A%20%20%20%20%20%20%20%20this.m_angularImpulse%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20this.m_angularImpulse%20%2B%20impulse%2C%0A%20%20%20%20%20%20%20%20%20%20-maxImpulse%2C%0A%20%20%20%20%20%20%20%20%20%20maxImpulse%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_angularImpulse%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20wA%20-%3D%20iA%20*%20impulse%3B%0A%20%20%20%20%20%20%20%20wB%20%2B%3D%20iB%20*%20impulse%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20var%20CdotX%20%3D%20vB.x%20-%20wB%20*%20rBY%20-%20vA.x%20%2B%20wA%20*%20rAY%3B%0A%20%20%20%20%20%20%20%20var%20CdotY%20%3D%20vB.y%20%2B%20wB%20*%20rBX%20-%20vA.y%20-%20wA%20*%20rAX%3B%0A%20%20%20%20%20%20%20%20var%20impulseV%20%3D%20b2Math.MulMV(%0A%20%20%20%20%20%20%20%20%20%20this.m_linearMass%2C%0A%20%20%20%20%20%20%20%20%20%20new%20b2Vec2(-CdotX%2C%20-CdotY)%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20var%20oldImpulseV%20%3D%20this.m_linearImpulse.Copy()%3B%0A%20%20%20%20%20%20%20%20this.m_linearImpulse.Add(impulseV)%3B%0A%20%20%20%20%20%20%20%20maxImpulse%20%3D%20step.dt%20*%20this.m_maxForce%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_linearImpulse.LengthSquared()%20%3E%20maxImpulse%20*%20maxImpulse)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_linearImpulse.Normalize()%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_linearImpulse.Multiply(maxImpulse)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20impulseV%20%3D%20b2Math.SubtractVV(this.m_linearImpulse%2C%20oldImpulseV)%3B%0A%20%20%20%20%20%20%20%20vA.x%20-%3D%20mA%20*%20impulseV.x%3B%0A%20%20%20%20%20%20%20%20vA.y%20-%3D%20mA%20*%20impulseV.y%3B%0A%20%20%20%20%20%20%20%20wA%20-%3D%20iA%20*%20(rAX%20*%20impulseV.y%20-%20rAY%20*%20impulseV.x)%3B%0A%20%20%20%20%20%20%20%20vB.x%20%2B%3D%20mB%20*%20impulseV.x%3B%0A%20%20%20%20%20%20%20%20vB.y%20%2B%3D%20mB%20*%20impulseV.y%3B%0A%20%20%20%20%20%20%20%20wB%20%2B%3D%20iB%20*%20(rBX%20*%20impulseV.y%20-%20rBY%20*%20impulseV.x)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20bA.m_angularVelocity%20%3D%20wA%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%3D%20wB%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2FrictionJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2FrictionJointDef.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2FrictionJointDef.b2FrictionJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJointDef.prototype.b2FrictionJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_frictionJoint%3B%0A%20%20%20%20%20%20this.maxForce%20%3D%200.0%3B%0A%20%20%20%20%20%20this.maxTorque%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2FrictionJointDef.prototype.Initialize%20%3D%20function%20(bA%2C%20bB%2C%20anchor)%20%7B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchor))%3B%0A%20%20%20%20%20%20this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchor))%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2GearJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2GearJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2GearJoint.b2GearJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_groundAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_groundAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_J%20%3D%20new%20b2Jacobian()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_impulse%20*%20this.m_J.linearB.x%2C%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_impulse%20*%20this.m_J.linearB.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20this.m_bodyB.m_xf.R%3B%0A%20%20%20%20%20%20var%20rX%20%3D%20this.m_localAnchor1.x%20-%20this.m_bodyB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rY%20%3D%20this.m_localAnchor1.y%20-%20this.m_bodyB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20rX%20%2B%20tMat.col2.x%20*%20rY%3B%0A%20%20%20%20%20%20rY%20%3D%20tMat.col1.y%20*%20rX%20%2B%20tMat.col2.y%20*%20rY%3B%0A%20%20%20%20%20%20rX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20PX%20%3D%20this.m_impulse%20*%20this.m_J.linearB.x%3B%0A%20%20%20%20%20%20var%20PY%20%3D%20this.m_impulse%20*%20this.m_J.linearB.y%3B%0A%20%20%20%20%20%20return%20inv_dt%20*%20(this.m_impulse%20*%20this.m_J.angularB%20-%20rX%20*%20PY%20%2B%20rY%20*%20PX)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.GetRatio%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_ratio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.SetRatio%20%3D%20function%20(ratio)%20%7B%0A%20%20%20%20%20%20if%20(ratio%20%3D%3D%3D%20undefined)%20ratio%20%3D%200%3B%0A%20%20%20%20%20%20this.m_ratio%20%3D%20ratio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.b2GearJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20var%20type1%20%3D%20parseInt(def.joint1.m_type)%3B%0A%20%20%20%20%20%20var%20type2%20%3D%20parseInt(def.joint2.m_type)%3B%0A%20%20%20%20%20%20this.m_revolute1%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_prismatic1%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_revolute2%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_prismatic2%20%3D%20null%3B%0A%20%20%20%20%20%20var%20coordinate1%20%3D%200%3B%0A%20%20%20%20%20%20var%20coordinate2%20%3D%200%3B%0A%20%20%20%20%20%20this.m_ground1%20%3D%20def.joint1.GetBodyA()%3B%0A%20%20%20%20%20%20this.m_bodyA%20%3D%20def.joint1.GetBodyB()%3B%0A%20%20%20%20%20%20if%20(type1%20%3D%3D%20b2Joint.e_revoluteJoint)%20%7B%0A%20%20%20%20%20%20%20%20this.m_revolute1%20%3D%0A%20%20%20%20%20%20%20%20%20%20def.joint1%20instanceof%20b2RevoluteJoint%20%3F%20def.joint1%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1)%3B%0A%20%20%20%20%20%20%20%20this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2)%3B%0A%20%20%20%20%20%20%20%20coordinate1%20%3D%20this.m_revolute1.GetJointAngle()%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_prismatic1%20%3D%0A%20%20%20%20%20%20%20%20%20%20def.joint1%20instanceof%20b2PrismaticJoint%20%3F%20def.joint1%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1)%3B%0A%20%20%20%20%20%20%20%20this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2)%3B%0A%20%20%20%20%20%20%20%20coordinate1%20%3D%20this.m_prismatic1.GetJointTranslation()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_ground2%20%3D%20def.joint2.GetBodyA()%3B%0A%20%20%20%20%20%20this.m_bodyB%20%3D%20def.joint2.GetBodyB()%3B%0A%20%20%20%20%20%20if%20(type2%20%3D%3D%20b2Joint.e_revoluteJoint)%20%7B%0A%20%20%20%20%20%20%20%20this.m_revolute2%20%3D%0A%20%20%20%20%20%20%20%20%20%20def.joint2%20instanceof%20b2RevoluteJoint%20%3F%20def.joint2%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1)%3B%0A%20%20%20%20%20%20%20%20this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2)%3B%0A%20%20%20%20%20%20%20%20coordinate2%20%3D%20this.m_revolute2.GetJointAngle()%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_prismatic2%20%3D%0A%20%20%20%20%20%20%20%20%20%20def.joint2%20instanceof%20b2PrismaticJoint%20%3F%20def.joint2%20%3A%20null%3B%0A%20%20%20%20%20%20%20%20this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1)%3B%0A%20%20%20%20%20%20%20%20this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2)%3B%0A%20%20%20%20%20%20%20%20coordinate2%20%3D%20this.m_prismatic2.GetJointTranslation()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_ratio%20%3D%20def.ratio%3B%0A%20%20%20%20%20%20this.m_constant%20%3D%20coordinate1%20%2B%20this.m_ratio%20*%20coordinate2%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20g1%20%3D%20this.m_ground1%3B%0A%20%20%20%20%20%20var%20g2%20%3D%20this.m_ground2%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20ugX%20%3D%200%3B%0A%20%20%20%20%20%20var%20ugY%20%3D%200%3B%0A%20%20%20%20%20%20var%20rX%20%3D%200%3B%0A%20%20%20%20%20%20var%20rY%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tVec%3B%0A%20%20%20%20%20%20var%20crug%20%3D%200%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20K%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_J.SetZero()%3B%0A%20%20%20%20%20%20if%20(this.m_revolute1)%20%7B%0A%20%20%20%20%20%20%20%20this.m_J.angularA%20%3D%20-1.0%3B%0A%20%20%20%20%20%20%20%20K%20%2B%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20g1.m_xf.R%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_prismatic1.m_localXAxis1%3B%0A%20%20%20%20%20%20%20%20ugX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20ugY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20rX%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20rY%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rX%20%2B%20tMat.col2.x%20*%20rY%3B%0A%20%20%20%20%20%20%20%20rY%20%3D%20tMat.col1.y%20*%20rX%20%2B%20tMat.col2.y%20*%20rY%3B%0A%20%20%20%20%20%20%20%20rX%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20crug%20%3D%20rX%20*%20ugY%20-%20rY%20*%20ugX%3B%0A%20%20%20%20%20%20%20%20this.m_J.linearA.Set(-ugX%2C%20-ugY)%3B%0A%20%20%20%20%20%20%20%20this.m_J.angularA%20%3D%20-crug%3B%0A%20%20%20%20%20%20%20%20K%20%2B%3D%20bA.m_invMass%20%2B%20bA.m_invI%20*%20crug%20*%20crug%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_revolute2)%20%7B%0A%20%20%20%20%20%20%20%20this.m_J.angularB%20%3D%20-this.m_ratio%3B%0A%20%20%20%20%20%20%20%20K%20%2B%3D%20this.m_ratio%20*%20this.m_ratio%20*%20bB.m_invI%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20g2.m_xf.R%3B%0A%20%20%20%20%20%20%20%20tVec%20%3D%20this.m_prismatic2.m_localXAxis1%3B%0A%20%20%20%20%20%20%20%20ugX%20%3D%20tMat.col1.x%20*%20tVec.x%20%2B%20tMat.col2.x%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20ugY%20%3D%20tMat.col1.y%20*%20tVec.x%20%2B%20tMat.col2.y%20*%20tVec.y%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20rX%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20rY%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rX%20%2B%20tMat.col2.x%20*%20rY%3B%0A%20%20%20%20%20%20%20%20rY%20%3D%20tMat.col1.y%20*%20rX%20%2B%20tMat.col2.y%20*%20rY%3B%0A%20%20%20%20%20%20%20%20rX%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20crug%20%3D%20rX%20*%20ugY%20-%20rY%20*%20ugX%3B%0A%20%20%20%20%20%20%20%20this.m_J.linearB.Set(-this.m_ratio%20*%20ugX%2C%20-this.m_ratio%20*%20ugY)%3B%0A%20%20%20%20%20%20%20%20this.m_J.angularB%20%3D%20-this.m_ratio%20*%20crug%3B%0A%20%20%20%20%20%20%20%20K%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_ratio%20*%20this.m_ratio%20*%20(bB.m_invMass%20%2B%20bB.m_invI%20*%20crug%20*%20crug)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_mass%20%3D%20K%20%3E%200.0%20%3F%201.0%20%2F%20K%20%3A%200.0%3B%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20bA.m_invMass%20*%20this.m_impulse%20*%20this.m_J.linearA.x%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20bA.m_invMass%20*%20this.m_impulse%20*%20this.m_J.linearA.y%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20%2B%3D%20bA.m_invI%20*%20this.m_impulse%20*%20this.m_J.angularA%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20bB.m_invMass%20*%20this.m_impulse%20*%20this.m_J.linearB.x%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20bB.m_invMass%20*%20this.m_impulse%20*%20this.m_J.linearB.y%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20this.m_impulse%20*%20this.m_J.angularB%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20Cdot%20%3D%20this.m_J.Compute(%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity%2C%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%2C%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity%2C%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20-this.m_mass%20*%20Cdot%3B%0A%20%20%20%20%20%20this.m_impulse%20%2B%3D%20impulse%3B%0A%20%20%20%20%20%20bA.m_linearVelocity.x%20%2B%3D%20bA.m_invMass%20*%20impulse%20*%20this.m_J.linearA.x%3B%0A%20%20%20%20%20%20bA.m_linearVelocity.y%20%2B%3D%20bA.m_invMass%20*%20impulse%20*%20this.m_J.linearA.y%3B%0A%20%20%20%20%20%20bA.m_angularVelocity%20%2B%3D%20bA.m_invI%20*%20impulse%20*%20this.m_J.angularA%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20bB.m_invMass%20*%20impulse%20*%20this.m_J.linearB.x%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20bB.m_invMass%20*%20impulse%20*%20this.m_J.linearB.y%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20impulse%20*%20this.m_J.angularB%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20linearError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20coordinate1%20%3D%200%3B%0A%20%20%20%20%20%20var%20coordinate2%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_revolute1)%20%7B%0A%20%20%20%20%20%20%20%20coordinate1%20%3D%20this.m_revolute1.GetJointAngle()%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20coordinate1%20%3D%20this.m_prismatic1.GetJointTranslation()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_revolute2)%20%7B%0A%20%20%20%20%20%20%20%20coordinate2%20%3D%20this.m_revolute2.GetJointAngle()%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20coordinate2%20%3D%20this.m_prismatic2.GetJointTranslation()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20C%20%3D%20this.m_constant%20-%20(coordinate1%20%2B%20this.m_ratio%20*%20coordinate2)%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20-this.m_mass%20*%20C%3B%0A%20%20%20%20%20%20bA.m_sweep.c.x%20%2B%3D%20bA.m_invMass%20*%20impulse%20*%20this.m_J.linearA.x%3B%0A%20%20%20%20%20%20bA.m_sweep.c.y%20%2B%3D%20bA.m_invMass%20*%20impulse%20*%20this.m_J.linearA.y%3B%0A%20%20%20%20%20%20bA.m_sweep.a%20%2B%3D%20bA.m_invI%20*%20impulse%20*%20this.m_J.angularA%3B%0A%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20bB.m_invMass%20*%20impulse%20*%20this.m_J.linearB.x%3B%0A%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20bB.m_invMass%20*%20impulse%20*%20this.m_J.linearB.y%3B%0A%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20bB.m_invI%20*%20impulse%20*%20this.m_J.angularB%3B%0A%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20return%20linearError%20%3C%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2GearJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2GearJointDef.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2GearJointDef.b2GearJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2GearJointDef.prototype.b2GearJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_gearJoint%3B%0A%20%20%20%20%20%20this.joint1%20%3D%20null%3B%0A%20%20%20%20%20%20this.joint2%20%3D%20null%3B%0A%20%20%20%20%20%20this.ratio%20%3D%201.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Jacobian.b2Jacobian%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.linearA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.linearB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Jacobian.prototype.SetZero%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.linearA.SetZero()%3B%0A%20%20%20%20%20%20this.angularA%20%3D%200.0%3B%0A%20%20%20%20%20%20this.linearB.SetZero()%3B%0A%20%20%20%20%20%20this.angularB%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Jacobian.prototype.Set%20%3D%20function%20(x1%2C%20a1%2C%20x2%2C%20a2)%20%7B%0A%20%20%20%20%20%20if%20(a1%20%3D%3D%3D%20undefined)%20a1%20%3D%200%3B%0A%20%20%20%20%20%20if%20(a2%20%3D%3D%3D%20undefined)%20a2%20%3D%200%3B%0A%20%20%20%20%20%20this.linearA.SetV(x1)%3B%0A%20%20%20%20%20%20this.angularA%20%3D%20a1%3B%0A%20%20%20%20%20%20this.linearB.SetV(x2)%3B%0A%20%20%20%20%20%20this.angularB%20%3D%20a2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Jacobian.prototype.Compute%20%3D%20function%20(x1%2C%20a1%2C%20x2%2C%20a2)%20%7B%0A%20%20%20%20%20%20if%20(a1%20%3D%3D%3D%20undefined)%20a1%20%3D%200%3B%0A%20%20%20%20%20%20if%20(a2%20%3D%3D%3D%20undefined)%20a2%20%3D%200%3B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20this.linearA.x%20*%20x1.x%20%2B%0A%20%20%20%20%20%20%20%20this.linearA.y%20*%20x1.y%20%2B%0A%20%20%20%20%20%20%20%20this.angularA%20*%20a1%20%2B%0A%20%20%20%20%20%20%20%20(this.linearB.x%20*%20x2.x%20%2B%20this.linearB.y%20*%20x2.y)%20%2B%0A%20%20%20%20%20%20%20%20this.angularB%20*%20a2%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.b2Joint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_edgeA%20%3D%20new%20b2JointEdge()%3B%0A%20%20%20%20%20%20this.m_edgeB%20%3D%20new%20b2JointEdge()%3B%0A%20%20%20%20%20%20this.m_localCenterA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localCenterB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetType%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_type%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetBodyA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetBodyB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetNext%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_next%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.GetUserData%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_userData%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.SetUserData%20%3D%20function%20(data)%20%7B%0A%20%20%20%20%20%20this.m_userData%20%3D%20data%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.IsActive%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.IsActive()%20%26%26%20this.m_bodyB.IsActive()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.Create%20%3D%20function%20(def%2C%20allocator)%20%7B%0A%20%20%20%20%20%20var%20joint%20%3D%20null%3B%0A%20%20%20%20%20%20switch%20(def.type)%20%7B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_distanceJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2DistanceJoint(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20def%20instanceof%20b2DistanceJointDef%20%3F%20def%20%3A%20null%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_mouseJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2MouseJoint(def%20instanceof%20b2MouseJointDef%20%3F%20def%20%3A%20null)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_prismaticJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2PrismaticJoint(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20def%20instanceof%20b2PrismaticJointDef%20%3F%20def%20%3A%20null%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_revoluteJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2RevoluteJoint(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20def%20instanceof%20b2RevoluteJointDef%20%3F%20def%20%3A%20null%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_pulleyJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2PulleyJoint(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20def%20instanceof%20b2PulleyJointDef%20%3F%20def%20%3A%20null%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_gearJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2GearJoint(def%20instanceof%20b2GearJointDef%20%3F%20def%20%3A%20null)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_lineJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2LineJoint(def%20instanceof%20b2LineJointDef%20%3F%20def%20%3A%20null)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_weldJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2WeldJoint(def%20instanceof%20b2WeldJointDef%20%3F%20def%20%3A%20null)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20b2Joint.e_frictionJoint%3A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20joint%20%3D%20new%20b2FrictionJoint(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20def%20instanceof%20b2FrictionJointDef%20%3F%20def%20%3A%20null%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20joint%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.Destroy%20%3D%20function%20(joint%2C%20allocator)%20%7B%7D%3B%0A%20%20%20%20b2Joint.prototype.b2Joint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20b2Settings.b2Assert(def.bodyA%20!%3D%20def.bodyB)%3B%0A%20%20%20%20%20%20this.m_type%20%3D%20def.type%3B%0A%20%20%20%20%20%20this.m_prev%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_next%20%3D%20null%3B%0A%20%20%20%20%20%20this.m_bodyA%20%3D%20def.bodyA%3B%0A%20%20%20%20%20%20this.m_bodyB%20%3D%20def.bodyB%3B%0A%20%20%20%20%20%20this.m_collideConnected%20%3D%20def.collideConnected%3B%0A%20%20%20%20%20%20this.m_islandFlag%20%3D%20false%3B%0A%20%20%20%20%20%20this.m_userData%20%3D%20def.userData%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2Joint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%7D%3B%0A%20%20%20%20b2Joint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%7D%3B%0A%20%20%20%20b2Joint.prototype.FinalizeVelocityConstraints%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2Joint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_unknownJoint%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint%20%3D%201%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint%20%3D%202%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_distanceJoint%20%3D%203%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint%20%3D%204%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_mouseJoint%20%3D%205%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_gearJoint%20%3D%206%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_lineJoint%20%3D%207%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_weldJoint%20%3D%208%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_frictionJoint%20%3D%209%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit%20%3D%200%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit%20%3D%201%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit%20%3D%202%3B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.e_equalLimits%20%3D%203%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20b2JointDef.b2JointDef%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20b2JointDef.prototype.b2JointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_unknownJoint%3B%0A%20%20%20%20%20%20this.userData%20%3D%20null%3B%0A%20%20%20%20%20%20this.bodyA%20%3D%20null%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20null%3B%0A%20%20%20%20%20%20this.collideConnected%20%3D%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2JointEdge.b2JointEdge%20%3D%20function%20()%20%7B%7D%3B%0A%20%20%20%20Box2D.inherit(b2LineJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2LineJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2LineJoint.b2LineJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_localAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localXAxis1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localYAxis1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_axis%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_perp%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_K%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20inv_dt%20*%0A%20%20%20%20%20%20%20%20%20%20(this.m_impulse.x%20*%20this.m_perp.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.y)%20*%20this.m_axis.x)%2C%0A%20%20%20%20%20%20%20%20inv_dt%20*%0A%20%20%20%20%20%20%20%20%20%20(this.m_impulse.x%20*%20this.m_perp.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.y)%20*%20this.m_axis.y)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20inv_dt%20*%20this.m_impulse.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetJointTranslation%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20p1%20%3D%20bA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20bB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p2.x%20-%20p1.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p2.y%20-%20p1.y%3B%0A%20%20%20%20%20%20var%20axis%20%3D%20bA.GetWorldVector(this.m_localXAxis1)%3B%0A%20%20%20%20%20%20var%20translation%20%3D%20axis.x%20*%20dX%20%2B%20axis.y%20*%20dY%3B%0A%20%20%20%20%20%20return%20translation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetJointSpeed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%20bA.m_sweep.c.x%20%2B%20r1X%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%20bA.m_sweep.c.y%20%2B%20r1Y%3B%0A%20%20%20%20%20%20var%20p2X%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%3B%0A%20%20%20%20%20%20var%20p2Y%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p2X%20-%20p1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p2Y%20-%20p1Y%3B%0A%20%20%20%20%20%20var%20axis%20%3D%20bA.GetWorldVector(this.m_localXAxis1)%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w1%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20speed%20%3D%0A%20%20%20%20%20%20%20%20dX%20*%20(-w1%20*%20axis.y)%20%2B%0A%20%20%20%20%20%20%20%20dY%20*%20(w1%20*%20axis.x)%20%2B%0A%20%20%20%20%20%20%20%20(axis.x%20*%20(v2.x%20%2B%20-w2%20*%20r2Y%20-%20v1.x%20-%20-w1%20*%20r1Y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20axis.y%20*%20(v2.y%20%2B%20w2%20*%20r2X%20-%20v1.y%20-%20w1%20*%20r1X))%3B%0A%20%20%20%20%20%20return%20speed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.IsLimitEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_enableLimit%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.EnableLimit%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_enableLimit%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetLowerLimit%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_lowerTranslation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetUpperLimit%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_upperTranslation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.SetLimits%20%3D%20function%20(lower%2C%20upper)%20%7B%0A%20%20%20%20%20%20if%20(lower%20%3D%3D%3D%20undefined)%20lower%20%3D%200%3B%0A%20%20%20%20%20%20if%20(upper%20%3D%3D%3D%20undefined)%20upper%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_lowerTranslation%20%3D%20lower%3B%0A%20%20%20%20%20%20this.m_upperTranslation%20%3D%20upper%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.IsMotorEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_enableMotor%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.EnableMotor%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_enableMotor%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.SetMotorSpeed%20%3D%20function%20(speed)%20%7B%0A%20%20%20%20%20%20if%20(speed%20%3D%3D%3D%20undefined)%20speed%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_motorSpeed%20%3D%20speed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetMotorSpeed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_motorSpeed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.SetMaxMotorForce%20%3D%20function%20(force)%20%7B%0A%20%20%20%20%20%20if%20(force%20%3D%3D%3D%20undefined)%20force%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_maxMotorForce%20%3D%20force%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetMaxMotorForce%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_maxMotorForce%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.GetMotorForce%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_motorImpulse%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.b2LineJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20this.m_localAnchor1.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchor2.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_localXAxis1.SetV(def.localAxisA)%3B%0A%20%20%20%20%20%20this.m_localYAxis1.x%20%3D%20-this.m_localXAxis1.y%3B%0A%20%20%20%20%20%20this.m_localYAxis1.y%20%3D%20this.m_localXAxis1.x%3B%0A%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20this.m_motorMass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_lowerTranslation%20%3D%20def.lowerTranslation%3B%0A%20%20%20%20%20%20this.m_upperTranslation%20%3D%20def.upperTranslation%3B%0A%20%20%20%20%20%20this.m_maxMotorForce%20%3D%20def.maxMotorForce%3B%0A%20%20%20%20%20%20this.m_motorSpeed%20%3D%20def.motorSpeed%3B%0A%20%20%20%20%20%20this.m_enableLimit%20%3D%20def.enableLimit%3B%0A%20%20%20%20%20%20this.m_enableMotor%20%3D%20def.enableMotor%3B%0A%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20this.m_axis.SetZero()%3B%0A%20%20%20%20%20%20this.m_perp.SetZero()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20this.m_localCenterA.SetV(bA.GetLocalCenter())%3B%0A%20%20%20%20%20%20this.m_localCenterB.SetV(bB.GetLocalCenter())%3B%0A%20%20%20%20%20%20var%20xf1%20%3D%20bA.GetTransform()%3B%0A%20%20%20%20%20%20var%20xf2%20%3D%20bB.GetTransform()%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20this.m_localCenterA.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20this.m_localCenterA.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20this.m_localCenterB.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20this.m_localCenterB.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%20-%20bA.m_sweep.c.x%20-%20r1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%20-%20bA.m_sweep.c.y%20-%20r1Y%3B%0A%20%20%20%20%20%20this.m_invMassA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20this.m_invMassB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20this.m_invIA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20this.m_invIB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this.m_axis.SetV(b2Math.MulMV(xf1.R%2C%20this.m_localXAxis1))%3B%0A%20%20%20%20%20%20%20%20this.m_a1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_axis.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20this.m_a2%20%3D%20r2X%20*%20this.m_axis.y%20-%20r2Y%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20this.m_motorMass%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_invMassA%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_invMassB%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_invIA%20*%20this.m_a1%20*%20this.m_a1%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_invIB%20*%20this.m_a2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_motorMass%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_motorMass%20%3E%20Number.MIN_VALUE%20%3F%201.0%20%2F%20this.m_motorMass%20%3A%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this.m_perp.SetV(b2Math.MulMV(xf1.R%2C%20this.m_localYAxis1))%3B%0A%20%20%20%20%20%20%20%20this.m_s1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_perp.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20%20%20this.m_s2%20%3D%20r2X%20*%20this.m_perp.y%20-%20r2Y%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20%20%20var%20m1%20%3D%20this.m_invMassA%3B%0A%20%20%20%20%20%20%20%20var%20m2%20%3D%20this.m_invMassB%3B%0A%20%20%20%20%20%20%20%20var%20i1%20%3D%20this.m_invIA%3B%0A%20%20%20%20%20%20%20%20var%20i2%20%3D%20this.m_invIB%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_s1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.y%20%3D%20i1%20*%20this.m_s1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.x%20%3D%20this.m_K.col1.y%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_a1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_a2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_enableLimit)%20%7B%0A%20%20%20%20%20%20%20%20var%20jointTransition%20%3D%20this.m_axis.x%20*%20dX%20%2B%20this.m_axis.y%20*%20dY%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20b2Math.Abs(this.m_upperTranslation%20-%20this.m_lowerTranslation)%20%3C%0A%20%20%20%20%20%20%20%20%20%202.0%20*%20b2Settings.b2_linearSlop%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_equalLimits%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(jointTransition%20%3C%3D%20this.m_lowerTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_limitState%20!%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_atLowerLimit%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(jointTransition%20%3E%3D%20this.m_upperTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_limitState%20!%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_atUpperLimit%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20var%20PX%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_perp.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.y)%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20var%20PY%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_perp.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.y)%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20var%20L1%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_s1%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.y)%20*%20this.m_a1%3B%0A%20%20%20%20%20%20%20%20var%20L2%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_s2%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.y)%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w1%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20PX%20%3D%200%3B%0A%20%20%20%20%20%20var%20PY%20%3D%200%3B%0A%20%20%20%20%20%20var%20L1%20%3D%200%3B%0A%20%20%20%20%20%20var%20L2%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_equalLimits)%20%7B%0A%20%20%20%20%20%20%20%20var%20Cdot%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.x%20*%20(v2.x%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.y%20*%20(v2.y%20-%20v1.y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_a2%20*%20w2%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_a1%20*%20w1%3B%0A%20%20%20%20%20%20%20%20var%20impulse%20%3D%20this.m_motorMass%20*%20(this.m_motorSpeed%20-%20Cdot)%3B%0A%20%20%20%20%20%20%20%20var%20oldImpulse%20%3D%20this.m_motorImpulse%3B%0A%20%20%20%20%20%20%20%20var%20maxImpulse%20%3D%20step.dt%20*%20this.m_maxMotorForce%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20this.m_motorImpulse%20%2B%20impulse%2C%0A%20%20%20%20%20%20%20%20%20%20-maxImpulse%2C%0A%20%20%20%20%20%20%20%20%20%20maxImpulse%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_motorImpulse%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20PX%20%3D%20impulse%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20PY%20%3D%20impulse%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20L1%20%3D%20impulse%20*%20this.m_a1%3B%0A%20%20%20%20%20%20%20%20L2%20%3D%20impulse%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20Cdot1%20%3D%0A%20%20%20%20%20%20%20%20this.m_perp.x%20*%20(v2.x%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20this.m_perp.y%20*%20(v2.y%20-%20v1.y)%20%2B%0A%20%20%20%20%20%20%20%20this.m_s2%20*%20w2%20-%0A%20%20%20%20%20%20%20%20this.m_s1%20*%20w1%3B%0A%20%20%20%20%20%20if%20(this.m_enableLimit%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_inactiveLimit)%20%7B%0A%20%20%20%20%20%20%20%20var%20Cdot2%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.x%20*%20(v2.x%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.y%20*%20(v2.y%20-%20v1.y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_a2%20*%20w2%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_a1%20*%20w1%3B%0A%20%20%20%20%20%20%20%20var%20f1%20%3D%20this.m_impulse.Copy()%3B%0A%20%20%20%20%20%20%20%20var%20df%20%3D%20this.m_K.Solve(new%20b2Vec2()%2C%20-Cdot1%2C%20-Cdot2)%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.Add(df)%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%3D%20b2Math.Max(this.m_impulse.y%2C%200.0)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%3D%20b2Math.Min(this.m_impulse.y%2C%200.0)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20b%20%3D%20-Cdot1%20-%20(this.m_impulse.y%20-%20f1.y)%20*%20this.m_K.col2.x%3B%0A%20%20%20%20%20%20%20%20var%20f2r%20%3D%200%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_K.col1.x%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20f2r%20%3D%20b%20%2F%20this.m_K.col1.x%20%2B%20f1.x%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20f2r%20%3D%20f1.x%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20%3D%20f2r%3B%0A%20%20%20%20%20%20%20%20df.x%20%3D%20this.m_impulse.x%20-%20f1.x%3B%0A%20%20%20%20%20%20%20%20df.y%20%3D%20this.m_impulse.y%20-%20f1.y%3B%0A%20%20%20%20%20%20%20%20PX%20%3D%20df.x%20*%20this.m_perp.x%20%2B%20df.y%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20PY%20%3D%20df.x%20*%20this.m_perp.y%20%2B%20df.y%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20L1%20%3D%20df.x%20*%20this.m_s1%20%2B%20df.y%20*%20this.m_a1%3B%0A%20%20%20%20%20%20%20%20L2%20%3D%20df.x%20*%20this.m_s2%20%2B%20df.y%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20var%20df2%20%3D%200%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_K.col1.x%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20df2%20%3D%20-Cdot1%20%2F%20this.m_K.col1.x%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20df2%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20%2B%3D%20df2%3B%0A%20%20%20%20%20%20%20%20PX%20%3D%20df2%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20%20%20PY%20%3D%20df2%20*%20this.m_perp.y%3B%0A%20%20%20%20%20%20%20%20L1%20%3D%20df2%20*%20this.m_s1%3B%0A%20%20%20%20%20%20%20%20L2%20%3D%20df2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20bA.m_linearVelocity.SetV(v1)%3B%0A%20%20%20%20%20%20bA.m_angularVelocity%20%3D%20w1%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.SetV(v2)%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%3D%20w2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20limitC%20%3D%200%3B%0A%20%20%20%20%20%20var%20oldLimitImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20c1%20%3D%20bA.m_sweep.c%3B%0A%20%20%20%20%20%20var%20a1%20%3D%20bA.m_sweep.a%3B%0A%20%20%20%20%20%20var%20c2%20%3D%20bB.m_sweep.c%3B%0A%20%20%20%20%20%20var%20a2%20%3D%20bB.m_sweep.a%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20m1%20%3D%200%3B%0A%20%20%20%20%20%20var%20m2%20%3D%200%3B%0A%20%20%20%20%20%20var%20i1%20%3D%200%3B%0A%20%20%20%20%20%20var%20i2%20%3D%200%3B%0A%20%20%20%20%20%20var%20linearError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20angularError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20active%20%3D%20false%3B%0A%20%20%20%20%20%20var%20C2%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20R1%20%3D%20b2Mat22.FromAngle(a1)%3B%0A%20%20%20%20%20%20var%20R2%20%3D%20b2Mat22.FromAngle(a2)%3B%0A%20%20%20%20%20%20tMat%20%3D%20R1%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20this.m_localCenterA.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20this.m_localCenterA.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20R2%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20this.m_localCenterB.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20this.m_localCenterB.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20c2.x%20%2B%20r2X%20-%20c1.x%20-%20r1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20c2.y%20%2B%20r2Y%20-%20c1.y%20-%20r1Y%3B%0A%20%20%20%20%20%20if%20(this.m_enableLimit)%20%7B%0A%20%20%20%20%20%20%20%20this.m_axis%20%3D%20b2Math.MulMV(R1%2C%20this.m_localXAxis1)%3B%0A%20%20%20%20%20%20%20%20this.m_a1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_axis.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20this.m_a2%20%3D%20r2X%20*%20this.m_axis.y%20-%20r2Y%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20var%20translation%20%3D%20this.m_axis.x%20*%20dX%20%2B%20this.m_axis.y%20*%20dY%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20b2Math.Abs(this.m_upperTranslation%20-%20this.m_lowerTranslation)%20%3C%0A%20%20%20%20%20%20%20%20%20%202.0%20*%20b2Settings.b2_linearSlop%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C2%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20translation%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxLinearCorrection%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20linearError%20%3D%20b2Math.Abs(translation)%3B%0A%20%20%20%20%20%20%20%20%20%20active%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(translation%20%3C%3D%20this.m_lowerTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C2%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20translation%20-%20this.m_lowerTranslation%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20linearError%20%3D%20this.m_lowerTranslation%20-%20translation%3B%0A%20%20%20%20%20%20%20%20%20%20active%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(translation%20%3E%3D%20this.m_upperTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C2%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20translation%20-%20this.m_upperTranslation%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxLinearCorrection%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20linearError%20%3D%20translation%20-%20this.m_upperTranslation%3B%0A%20%20%20%20%20%20%20%20%20%20active%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_perp%20%3D%20b2Math.MulMV(R1%2C%20this.m_localYAxis1)%3B%0A%20%20%20%20%20%20this.m_s1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_perp.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20this.m_s2%20%3D%20r2X%20*%20this.m_perp.y%20-%20r2Y%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20var%20C1%20%3D%20this.m_perp.x%20*%20dX%20%2B%20this.m_perp.y%20*%20dY%3B%0A%20%20%20%20%20%20linearError%20%3D%20b2Math.Max(linearError%2C%20b2Math.Abs(C1))%3B%0A%20%20%20%20%20%20angularError%20%3D%200.0%3B%0A%20%20%20%20%20%20if%20(active)%20%7B%0A%20%20%20%20%20%20%20%20m1%20%3D%20this.m_invMassA%3B%0A%20%20%20%20%20%20%20%20m2%20%3D%20this.m_invMassB%3B%0A%20%20%20%20%20%20%20%20i1%20%3D%20this.m_invIA%3B%0A%20%20%20%20%20%20%20%20i2%20%3D%20this.m_invIB%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_s1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.y%20%3D%20i1%20*%20this.m_s1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.x%20%3D%20this.m_K.col1.y%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.y%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_a1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_a2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.Solve(impulse%2C%20-C1%2C%20-C2)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20m1%20%3D%20this.m_invMassA%3B%0A%20%20%20%20%20%20%20%20m2%20%3D%20this.m_invMassB%3B%0A%20%20%20%20%20%20%20%20i1%20%3D%20this.m_invIA%3B%0A%20%20%20%20%20%20%20%20i2%20%3D%20this.m_invIB%3B%0A%20%20%20%20%20%20%20%20var%20k11%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_s1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20var%20impulse1%20%3D%200%3B%0A%20%20%20%20%20%20%20%20if%20(k11%20!%3D%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20impulse1%20%3D%20-C1%20%2F%20k11%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20impulse1%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20impulse.x%20%3D%20impulse1%3B%0A%20%20%20%20%20%20%20%20impulse.y%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20PX%20%3D%20impulse.x%20*%20this.m_perp.x%20%2B%20impulse.y%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20var%20PY%20%3D%20impulse.x%20*%20this.m_perp.y%20%2B%20impulse.y%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20var%20L1%20%3D%20impulse.x%20*%20this.m_s1%20%2B%20impulse.y%20*%20this.m_a1%3B%0A%20%20%20%20%20%20var%20L2%20%3D%20impulse.x%20*%20this.m_s2%20%2B%20impulse.y%20*%20this.m_a2%3B%0A%20%20%20%20%20%20c1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20c1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20a1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20c2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20c2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20a2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20bA.m_sweep.a%20%3D%20a1%3B%0A%20%20%20%20%20%20bB.m_sweep.a%20%3D%20a2%3B%0A%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20linearError%20%3C%3D%20b2Settings.b2_linearSlop%20%26%26%0A%20%20%20%20%20%20%20%20angularError%20%3C%3D%20b2Settings.b2_angularSlop%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2LineJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2LineJointDef.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2LineJointDef.b2LineJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAxisA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJointDef.prototype.b2LineJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_lineJoint%3B%0A%20%20%20%20%20%20this.localAxisA.Set(1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.enableLimit%20%3D%20false%3B%0A%20%20%20%20%20%20this.lowerTranslation%20%3D%200.0%3B%0A%20%20%20%20%20%20this.upperTranslation%20%3D%200.0%3B%0A%20%20%20%20%20%20this.enableMotor%20%3D%20false%3B%0A%20%20%20%20%20%20this.maxMotorForce%20%3D%200.0%3B%0A%20%20%20%20%20%20this.motorSpeed%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2LineJointDef.prototype.Initialize%20%3D%20function%20(bA%2C%20bB%2C%20anchor%2C%20axis)%20%7B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20this.bodyA.GetLocalPoint(anchor)%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20this.bodyB.GetLocalPoint(anchor)%3B%0A%20%20%20%20%20%20this.localAxisA%20%3D%20this.bodyA.GetLocalVector(axis)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2MouseJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2MouseJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2MouseJoint.b2MouseJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.K%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.K1%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.K2%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.m_localAnchor%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_target%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_mass%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.m_C%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_target%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(inv_dt%20*%20this.m_impulse.x%2C%20inv_dt%20*%20this.m_impulse.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetTarget%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_target%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.SetTarget%20%3D%20function%20(target)%20%7B%0A%20%20%20%20%20%20if%20(this.m_bodyB.IsAwake()%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_target%20%3D%20target%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetMaxForce%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_maxForce%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.SetMaxForce%20%3D%20function%20(maxForce)%20%7B%0A%20%20%20%20%20%20if%20(maxForce%20%3D%3D%3D%20undefined)%20maxForce%20%3D%200%3B%0A%20%20%20%20%20%20this.m_maxForce%20%3D%20maxForce%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetFrequency%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_frequencyHz%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.SetFrequency%20%3D%20function%20(hz)%20%7B%0A%20%20%20%20%20%20if%20(hz%20%3D%3D%3D%20undefined)%20hz%20%3D%200%3B%0A%20%20%20%20%20%20this.m_frequencyHz%20%3D%20hz%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.GetDampingRatio%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_dampingRatio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.SetDampingRatio%20%3D%20function%20(ratio)%20%7B%0A%20%20%20%20%20%20if%20(ratio%20%3D%3D%3D%20undefined)%20ratio%20%3D%200%3B%0A%20%20%20%20%20%20this.m_dampingRatio%20%3D%20ratio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.b2MouseJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20this.m_target.SetV(def.target)%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20this.m_target.x%20-%20this.m_bodyB.m_xf.position.x%3B%0A%20%20%20%20%20%20var%20tY%20%3D%20this.m_target.y%20-%20this.m_bodyB.m_xf.position.y%3B%0A%20%20%20%20%20%20var%20tMat%20%3D%20this.m_bodyB.m_xf.R%3B%0A%20%20%20%20%20%20this.m_localAnchor.x%20%3D%20tX%20*%20tMat.col1.x%20%2B%20tY%20*%20tMat.col1.y%3B%0A%20%20%20%20%20%20this.m_localAnchor.y%20%3D%20tX%20*%20tMat.col2.x%20%2B%20tY%20*%20tMat.col2.y%3B%0A%20%20%20%20%20%20this.m_maxForce%20%3D%20def.maxForce%3B%0A%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20this.m_frequencyHz%20%3D%20def.frequencyHz%3B%0A%20%20%20%20%20%20this.m_dampingRatio%20%3D%20def.dampingRatio%3B%0A%20%20%20%20%20%20this.m_beta%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_gamma%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20b%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20mass%20%3D%20b.GetMass()%3B%0A%20%20%20%20%20%20var%20omega%20%3D%202.0%20*%20Math.PI%20*%20this.m_frequencyHz%3B%0A%20%20%20%20%20%20var%20d%20%3D%202.0%20*%20mass%20*%20this.m_dampingRatio%20*%20omega%3B%0A%20%20%20%20%20%20var%20k%20%3D%20mass%20*%20omega%20*%20omega%3B%0A%20%20%20%20%20%20this.m_gamma%20%3D%20step.dt%20*%20(d%20%2B%20step.dt%20*%20k)%3B%0A%20%20%20%20%20%20this.m_gamma%20%3D%20this.m_gamma%20!%3D%200%20%3F%201%20%2F%20this.m_gamma%20%3A%200.0%3B%0A%20%20%20%20%20%20this.m_beta%20%3D%20step.dt%20*%20k%20*%20this.m_gamma%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20b.m_xf.R%3B%0A%20%20%20%20%20%20var%20rX%20%3D%20this.m_localAnchor.x%20-%20b.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rY%20%3D%20this.m_localAnchor.y%20-%20b.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20rX%20%2B%20tMat.col2.x%20*%20rY%3B%0A%20%20%20%20%20%20rY%20%3D%20tMat.col1.y%20*%20rX%20%2B%20tMat.col2.y%20*%20rY%3B%0A%20%20%20%20%20%20rX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20invMass%20%3D%20b.m_invMass%3B%0A%20%20%20%20%20%20var%20invI%20%3D%20b.m_invI%3B%0A%20%20%20%20%20%20this.K1.col1.x%20%3D%20invMass%3B%0A%20%20%20%20%20%20this.K1.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20this.K1.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20this.K1.col2.y%20%3D%20invMass%3B%0A%20%20%20%20%20%20this.K2.col1.x%20%3D%20invI%20*%20rY%20*%20rY%3B%0A%20%20%20%20%20%20this.K2.col2.x%20%3D%20-invI%20*%20rX%20*%20rY%3B%0A%20%20%20%20%20%20this.K2.col1.y%20%3D%20-invI%20*%20rX%20*%20rY%3B%0A%20%20%20%20%20%20this.K2.col2.y%20%3D%20invI%20*%20rX%20*%20rX%3B%0A%20%20%20%20%20%20this.K.SetM(this.K1)%3B%0A%20%20%20%20%20%20this.K.AddM(this.K2)%3B%0A%20%20%20%20%20%20this.K.col1.x%20%2B%3D%20this.m_gamma%3B%0A%20%20%20%20%20%20this.K.col2.y%20%2B%3D%20this.m_gamma%3B%0A%20%20%20%20%20%20this.K.GetInverse(this.m_mass)%3B%0A%20%20%20%20%20%20this.m_C.x%20%3D%20b.m_sweep.c.x%20%2B%20rX%20-%20this.m_target.x%3B%0A%20%20%20%20%20%20this.m_C.y%20%3D%20b.m_sweep.c.y%20%2B%20rY%20-%20this.m_target.y%3B%0A%20%20%20%20%20%20b.m_angularVelocity%20*%3D%200.98%3B%0A%20%20%20%20%20%20this.m_impulse.x%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20this.m_impulse.y%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20b.m_linearVelocity.x%20%2B%3D%20invMass%20*%20this.m_impulse.x%3B%0A%20%20%20%20%20%20b.m_linearVelocity.y%20%2B%3D%20invMass%20*%20this.m_impulse.y%3B%0A%20%20%20%20%20%20b.m_angularVelocity%20%2B%3D%0A%20%20%20%20%20%20%20%20invI%20*%20(rX%20*%20this.m_impulse.y%20-%20rY%20*%20this.m_impulse.x)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20b%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20tMat%20%3D%20b.m_xf.R%3B%0A%20%20%20%20%20%20var%20rX%20%3D%20this.m_localAnchor.x%20-%20b.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rY%20%3D%20this.m_localAnchor.y%20-%20b.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rX%20%2B%20tMat.col2.x%20*%20rY%3B%0A%20%20%20%20%20%20rY%20%3D%20tMat.col1.y%20*%20rX%20%2B%20tMat.col2.y%20*%20rY%3B%0A%20%20%20%20%20%20rX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20CdotX%20%3D%20b.m_linearVelocity.x%20%2B%20-b.m_angularVelocity%20*%20rY%3B%0A%20%20%20%20%20%20var%20CdotY%20%3D%20b.m_linearVelocity.y%20%2B%20b.m_angularVelocity%20*%20rX%3B%0A%20%20%20%20%20%20tMat%20%3D%20this.m_mass%3B%0A%20%20%20%20%20%20tX%20%3D%20CdotX%20%2B%20this.m_beta%20*%20this.m_C.x%20%2B%20this.m_gamma%20*%20this.m_impulse.x%3B%0A%20%20%20%20%20%20tY%20%3D%20CdotY%20%2B%20this.m_beta%20*%20this.m_C.y%20%2B%20this.m_gamma%20*%20this.m_impulse.y%3B%0A%20%20%20%20%20%20var%20impulseX%20%3D%20-(tMat.col1.x%20*%20tX%20%2B%20tMat.col2.x%20*%20tY)%3B%0A%20%20%20%20%20%20var%20impulseY%20%3D%20-(tMat.col1.y%20*%20tX%20%2B%20tMat.col2.y%20*%20tY)%3B%0A%20%20%20%20%20%20var%20oldImpulseX%20%3D%20this.m_impulse.x%3B%0A%20%20%20%20%20%20var%20oldImpulseY%20%3D%20this.m_impulse.y%3B%0A%20%20%20%20%20%20this.m_impulse.x%20%2B%3D%20impulseX%3B%0A%20%20%20%20%20%20this.m_impulse.y%20%2B%3D%20impulseY%3B%0A%20%20%20%20%20%20var%20maxImpulse%20%3D%20step.dt%20*%20this.m_maxForce%3B%0A%20%20%20%20%20%20if%20(this.m_impulse.LengthSquared()%20%3E%20maxImpulse%20*%20maxImpulse)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.Multiply(maxImpulse%20%2F%20this.m_impulse.Length())%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20impulseX%20%3D%20this.m_impulse.x%20-%20oldImpulseX%3B%0A%20%20%20%20%20%20impulseY%20%3D%20this.m_impulse.y%20-%20oldImpulseY%3B%0A%20%20%20%20%20%20b.m_linearVelocity.x%20%2B%3D%20b.m_invMass%20*%20impulseX%3B%0A%20%20%20%20%20%20b.m_linearVelocity.y%20%2B%3D%20b.m_invMass%20*%20impulseY%3B%0A%20%20%20%20%20%20b.m_angularVelocity%20%2B%3D%20b.m_invI%20*%20(rX%20*%20impulseY%20-%20rY%20*%20impulseX)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2MouseJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2MouseJointDef.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2MouseJointDef.b2MouseJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.target%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2MouseJointDef.prototype.b2MouseJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_mouseJoint%3B%0A%20%20%20%20%20%20this.maxForce%20%3D%200.0%3B%0A%20%20%20%20%20%20this.frequencyHz%20%3D%205.0%3B%0A%20%20%20%20%20%20this.dampingRatio%20%3D%200.7%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2PrismaticJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2PrismaticJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2PrismaticJoint.b2PrismaticJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_localAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localXAxis1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localYAxis1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_axis%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_perp%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_K%20%3D%20new%20b2Mat33()%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20inv_dt%20*%0A%20%20%20%20%20%20%20%20%20%20(this.m_impulse.x%20*%20this.m_perp.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.z)%20*%20this.m_axis.x)%2C%0A%20%20%20%20%20%20%20%20inv_dt%20*%0A%20%20%20%20%20%20%20%20%20%20(this.m_impulse.x%20*%20this.m_perp.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.z)%20*%20this.m_axis.y)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20inv_dt%20*%20this.m_impulse.y%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetJointTranslation%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20p1%20%3D%20bA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%20%20var%20p2%20%3D%20bB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p2.x%20-%20p1.x%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p2.y%20-%20p1.y%3B%0A%20%20%20%20%20%20var%20axis%20%3D%20bA.GetWorldVector(this.m_localXAxis1)%3B%0A%20%20%20%20%20%20var%20translation%20%3D%20axis.x%20*%20dX%20%2B%20axis.y%20*%20dY%3B%0A%20%20%20%20%20%20return%20translation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetJointSpeed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%20bA.m_sweep.c.x%20%2B%20r1X%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%20bA.m_sweep.c.y%20%2B%20r1Y%3B%0A%20%20%20%20%20%20var%20p2X%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%3B%0A%20%20%20%20%20%20var%20p2Y%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p2X%20-%20p1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p2Y%20-%20p1Y%3B%0A%20%20%20%20%20%20var%20axis%20%3D%20bA.GetWorldVector(this.m_localXAxis1)%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w1%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20speed%20%3D%0A%20%20%20%20%20%20%20%20dX%20*%20(-w1%20*%20axis.y)%20%2B%0A%20%20%20%20%20%20%20%20dY%20*%20(w1%20*%20axis.x)%20%2B%0A%20%20%20%20%20%20%20%20(axis.x%20*%20(v2.x%20%2B%20-w2%20*%20r2Y%20-%20v1.x%20-%20-w1%20*%20r1Y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20axis.y%20*%20(v2.y%20%2B%20w2%20*%20r2X%20-%20v1.y%20-%20w1%20*%20r1X))%3B%0A%20%20%20%20%20%20return%20speed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.IsLimitEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_enableLimit%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.EnableLimit%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_enableLimit%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetLowerLimit%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_lowerTranslation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetUpperLimit%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_upperTranslation%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.SetLimits%20%3D%20function%20(lower%2C%20upper)%20%7B%0A%20%20%20%20%20%20if%20(lower%20%3D%3D%3D%20undefined)%20lower%20%3D%200%3B%0A%20%20%20%20%20%20if%20(upper%20%3D%3D%3D%20undefined)%20upper%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_lowerTranslation%20%3D%20lower%3B%0A%20%20%20%20%20%20this.m_upperTranslation%20%3D%20upper%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.IsMotorEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_enableMotor%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.EnableMotor%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_enableMotor%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.SetMotorSpeed%20%3D%20function%20(speed)%20%7B%0A%20%20%20%20%20%20if%20(speed%20%3D%3D%3D%20undefined)%20speed%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_motorSpeed%20%3D%20speed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetMotorSpeed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_motorSpeed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.SetMaxMotorForce%20%3D%20function%20(force)%20%7B%0A%20%20%20%20%20%20if%20(force%20%3D%3D%3D%20undefined)%20force%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_maxMotorForce%20%3D%20force%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.GetMotorForce%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_motorImpulse%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.b2PrismaticJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20this.m_localAnchor1.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchor2.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_localXAxis1.SetV(def.localAxisA)%3B%0A%20%20%20%20%20%20this.m_localYAxis1.x%20%3D%20-this.m_localXAxis1.y%3B%0A%20%20%20%20%20%20this.m_localYAxis1.y%20%3D%20this.m_localXAxis1.x%3B%0A%20%20%20%20%20%20this.m_refAngle%20%3D%20def.referenceAngle%3B%0A%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20this.m_motorMass%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_lowerTranslation%20%3D%20def.lowerTranslation%3B%0A%20%20%20%20%20%20this.m_upperTranslation%20%3D%20def.upperTranslation%3B%0A%20%20%20%20%20%20this.m_maxMotorForce%20%3D%20def.maxMotorForce%3B%0A%20%20%20%20%20%20this.m_motorSpeed%20%3D%20def.motorSpeed%3B%0A%20%20%20%20%20%20this.m_enableLimit%20%3D%20def.enableLimit%3B%0A%20%20%20%20%20%20this.m_enableMotor%20%3D%20def.enableMotor%3B%0A%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20this.m_axis.SetZero()%3B%0A%20%20%20%20%20%20this.m_perp.SetZero()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20this.m_localCenterA.SetV(bA.GetLocalCenter())%3B%0A%20%20%20%20%20%20this.m_localCenterB.SetV(bB.GetLocalCenter())%3B%0A%20%20%20%20%20%20var%20xf1%20%3D%20bA.GetTransform()%3B%0A%20%20%20%20%20%20var%20xf2%20%3D%20bB.GetTransform()%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20this.m_localCenterA.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20this.m_localCenterA.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20this.m_localCenterB.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20this.m_localCenterB.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%20-%20bA.m_sweep.c.x%20-%20r1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%20-%20bA.m_sweep.c.y%20-%20r1Y%3B%0A%20%20%20%20%20%20this.m_invMassA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20this.m_invMassB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20this.m_invIA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20this.m_invIB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this.m_axis.SetV(b2Math.MulMV(xf1.R%2C%20this.m_localXAxis1))%3B%0A%20%20%20%20%20%20%20%20this.m_a1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_axis.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20this.m_a2%20%3D%20r2X%20*%20this.m_axis.y%20-%20r2Y%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20this.m_motorMass%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_invMassA%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_invMassB%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_invIA%20*%20this.m_a1%20*%20this.m_a1%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_invIB%20*%20this.m_a2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_motorMass%20%3E%20Number.MIN_VALUE)%0A%20%20%20%20%20%20%20%20%20%20this.m_motorMass%20%3D%201.0%20%2F%20this.m_motorMass%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20this.m_perp.SetV(b2Math.MulMV(xf1.R%2C%20this.m_localYAxis1))%3B%0A%20%20%20%20%20%20%20%20this.m_s1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_perp.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20%20%20this.m_s2%20%3D%20r2X%20*%20this.m_perp.y%20-%20r2Y%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20%20%20var%20m1%20%3D%20this.m_invMassA%3B%0A%20%20%20%20%20%20%20%20var%20m2%20%3D%20this.m_invMassB%3B%0A%20%20%20%20%20%20%20%20var%20i1%20%3D%20this.m_invIA%3B%0A%20%20%20%20%20%20%20%20var%20i2%20%3D%20this.m_invIB%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_s1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.y%20%3D%20i1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.z%20%3D%20i1%20*%20this.m_s1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.x%20%3D%20this.m_K.col1.y%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.y%20%3D%20i1%20%2B%20i2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.z%20%3D%20i1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col3.x%20%3D%20this.m_K.col1.z%3B%0A%20%20%20%20%20%20%20%20this.m_K.col3.y%20%3D%20this.m_K.col2.z%3B%0A%20%20%20%20%20%20%20%20this.m_K.col3.z%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_a1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_a2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_enableLimit)%20%7B%0A%20%20%20%20%20%20%20%20var%20jointTransition%20%3D%20this.m_axis.x%20*%20dX%20%2B%20this.m_axis.y%20*%20dY%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20b2Math.Abs(this.m_upperTranslation%20-%20this.m_lowerTranslation)%20%3C%0A%20%20%20%20%20%20%20%20%20%202.0%20*%20b2Settings.b2_linearSlop%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_equalLimits%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(jointTransition%20%3C%3D%20this.m_lowerTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_limitState%20!%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_atLowerLimit%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(jointTransition%20%3E%3D%20this.m_upperTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_limitState%20!%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_atUpperLimit%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20var%20PX%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_perp.x%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.z)%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20var%20PY%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_perp.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.z)%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20var%20L1%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_s1%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.z)%20*%20this.m_a1%3B%0A%20%20%20%20%20%20%20%20var%20L2%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20*%20this.m_s2%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%2B%0A%20%20%20%20%20%20%20%20%20%20(this.m_motorImpulse%20%2B%20this.m_impulse.z)%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w1%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20PX%20%3D%200%3B%0A%20%20%20%20%20%20var%20PY%20%3D%200%3B%0A%20%20%20%20%20%20var%20L1%20%3D%200%3B%0A%20%20%20%20%20%20var%20L2%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_equalLimits)%20%7B%0A%20%20%20%20%20%20%20%20var%20Cdot%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.x%20*%20(v2.x%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.y%20*%20(v2.y%20-%20v1.y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_a2%20*%20w2%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_a1%20*%20w1%3B%0A%20%20%20%20%20%20%20%20var%20impulse%20%3D%20this.m_motorMass%20*%20(this.m_motorSpeed%20-%20Cdot)%3B%0A%20%20%20%20%20%20%20%20var%20oldImpulse%20%3D%20this.m_motorImpulse%3B%0A%20%20%20%20%20%20%20%20var%20maxImpulse%20%3D%20step.dt%20*%20this.m_maxMotorForce%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20this.m_motorImpulse%20%2B%20impulse%2C%0A%20%20%20%20%20%20%20%20%20%20-maxImpulse%2C%0A%20%20%20%20%20%20%20%20%20%20maxImpulse%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_motorImpulse%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20PX%20%3D%20impulse%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20PY%20%3D%20impulse%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20L1%20%3D%20impulse%20*%20this.m_a1%3B%0A%20%20%20%20%20%20%20%20L2%20%3D%20impulse%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20Cdot1X%20%3D%0A%20%20%20%20%20%20%20%20this.m_perp.x%20*%20(v2.x%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20this.m_perp.y%20*%20(v2.y%20-%20v1.y)%20%2B%0A%20%20%20%20%20%20%20%20this.m_s2%20*%20w2%20-%0A%20%20%20%20%20%20%20%20this.m_s1%20*%20w1%3B%0A%20%20%20%20%20%20var%20Cdot1Y%20%3D%20w2%20-%20w1%3B%0A%20%20%20%20%20%20if%20(this.m_enableLimit%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_inactiveLimit)%20%7B%0A%20%20%20%20%20%20%20%20var%20Cdot2%20%3D%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.x%20*%20(v2.x%20-%20v1.x)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_axis.y%20*%20(v2.y%20-%20v1.y)%20%2B%0A%20%20%20%20%20%20%20%20%20%20this.m_a2%20*%20w2%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_a1%20*%20w1%3B%0A%20%20%20%20%20%20%20%20var%20f1%20%3D%20this.m_impulse.Copy()%3B%0A%20%20%20%20%20%20%20%20var%20df%20%3D%20this.m_K.Solve33(new%20b2Vec3()%2C%20-Cdot1X%2C%20-Cdot1Y%2C%20-Cdot2)%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.Add(df)%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%20b2Math.Max(this.m_impulse.z%2C%200.0)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%20b2Math.Min(this.m_impulse.z%2C%200.0)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20var%20bX%20%3D%20-Cdot1X%20-%20(this.m_impulse.z%20-%20f1.z)%20*%20this.m_K.col3.x%3B%0A%20%20%20%20%20%20%20%20var%20bY%20%3D%20-Cdot1Y%20-%20(this.m_impulse.z%20-%20f1.z)%20*%20this.m_K.col3.y%3B%0A%20%20%20%20%20%20%20%20var%20f2r%20%3D%20this.m_K.Solve22(new%20b2Vec2()%2C%20bX%2C%20bY)%3B%0A%20%20%20%20%20%20%20%20f2r.x%20%2B%3D%20f1.x%3B%0A%20%20%20%20%20%20%20%20f2r.y%20%2B%3D%20f1.y%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20%3D%20f2r.x%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20%3D%20f2r.y%3B%0A%20%20%20%20%20%20%20%20df.x%20%3D%20this.m_impulse.x%20-%20f1.x%3B%0A%20%20%20%20%20%20%20%20df.y%20%3D%20this.m_impulse.y%20-%20f1.y%3B%0A%20%20%20%20%20%20%20%20df.z%20%3D%20this.m_impulse.z%20-%20f1.z%3B%0A%20%20%20%20%20%20%20%20PX%20%3D%20df.x%20*%20this.m_perp.x%20%2B%20df.z%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20PY%20%3D%20df.x%20*%20this.m_perp.y%20%2B%20df.z%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20%20%20L1%20%3D%20df.x%20*%20this.m_s1%20%2B%20df.y%20%2B%20df.z%20*%20this.m_a1%3B%0A%20%20%20%20%20%20%20%20L2%20%3D%20df.x%20*%20this.m_s2%20%2B%20df.y%20%2B%20df.z%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20var%20df2%20%3D%20this.m_K.Solve22(new%20b2Vec2()%2C%20-Cdot1X%2C%20-Cdot1Y)%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20%2B%3D%20df2.x%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20%2B%3D%20df2.y%3B%0A%20%20%20%20%20%20%20%20PX%20%3D%20df2.x%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20%20%20PY%20%3D%20df2.x%20*%20this.m_perp.y%3B%0A%20%20%20%20%20%20%20%20L1%20%3D%20df2.x%20*%20this.m_s1%20%2B%20df2.y%3B%0A%20%20%20%20%20%20%20%20L2%20%3D%20df2.x%20*%20this.m_s2%20%2B%20df2.y%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20bA.m_linearVelocity.SetV(v1)%3B%0A%20%20%20%20%20%20bA.m_angularVelocity%20%3D%20w1%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.SetV(v2)%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%3D%20w2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20limitC%20%3D%200%3B%0A%20%20%20%20%20%20var%20oldLimitImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20c1%20%3D%20bA.m_sweep.c%3B%0A%20%20%20%20%20%20var%20a1%20%3D%20bA.m_sweep.a%3B%0A%20%20%20%20%20%20var%20c2%20%3D%20bB.m_sweep.c%3B%0A%20%20%20%20%20%20var%20a2%20%3D%20bB.m_sweep.a%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20m1%20%3D%200%3B%0A%20%20%20%20%20%20var%20m2%20%3D%200%3B%0A%20%20%20%20%20%20var%20i1%20%3D%200%3B%0A%20%20%20%20%20%20var%20i2%20%3D%200%3B%0A%20%20%20%20%20%20var%20linearError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20angularError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20active%20%3D%20false%3B%0A%20%20%20%20%20%20var%20C2%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20R1%20%3D%20b2Mat22.FromAngle(a1)%3B%0A%20%20%20%20%20%20var%20R2%20%3D%20b2Mat22.FromAngle(a2)%3B%0A%20%20%20%20%20%20tMat%20%3D%20R1%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20this.m_localCenterA.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20this.m_localCenterA.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20R2%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20this.m_localCenterB.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20this.m_localCenterB.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20c2.x%20%2B%20r2X%20-%20c1.x%20-%20r1X%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20c2.y%20%2B%20r2Y%20-%20c1.y%20-%20r1Y%3B%0A%20%20%20%20%20%20if%20(this.m_enableLimit)%20%7B%0A%20%20%20%20%20%20%20%20this.m_axis%20%3D%20b2Math.MulMV(R1%2C%20this.m_localXAxis1)%3B%0A%20%20%20%20%20%20%20%20this.m_a1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_axis.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20this.m_a2%20%3D%20r2X%20*%20this.m_axis.y%20-%20r2Y%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20%20%20var%20translation%20%3D%20this.m_axis.x%20*%20dX%20%2B%20this.m_axis.y%20*%20dY%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20b2Math.Abs(this.m_upperTranslation%20-%20this.m_lowerTranslation)%20%3C%0A%20%20%20%20%20%20%20%20%20%202.0%20*%20b2Settings.b2_linearSlop%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C2%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20translation%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxLinearCorrection%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20linearError%20%3D%20b2Math.Abs(translation)%3B%0A%20%20%20%20%20%20%20%20%20%20active%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(translation%20%3C%3D%20this.m_lowerTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C2%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20translation%20-%20this.m_lowerTranslation%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20linearError%20%3D%20this.m_lowerTranslation%20-%20translation%3B%0A%20%20%20%20%20%20%20%20%20%20active%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(translation%20%3E%3D%20this.m_upperTranslation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C2%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20translation%20-%20this.m_upperTranslation%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxLinearCorrection%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20linearError%20%3D%20translation%20-%20this.m_upperTranslation%3B%0A%20%20%20%20%20%20%20%20%20%20active%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_perp%20%3D%20b2Math.MulMV(R1%2C%20this.m_localYAxis1)%3B%0A%20%20%20%20%20%20this.m_s1%20%3D%20(dX%20%2B%20r1X)%20*%20this.m_perp.y%20-%20(dY%20%2B%20r1Y)%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20this.m_s2%20%3D%20r2X%20*%20this.m_perp.y%20-%20r2Y%20*%20this.m_perp.x%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20var%20C1X%20%3D%20this.m_perp.x%20*%20dX%20%2B%20this.m_perp.y%20*%20dY%3B%0A%20%20%20%20%20%20var%20C1Y%20%3D%20a2%20-%20a1%20-%20this.m_refAngle%3B%0A%20%20%20%20%20%20linearError%20%3D%20b2Math.Max(linearError%2C%20b2Math.Abs(C1X))%3B%0A%20%20%20%20%20%20angularError%20%3D%20b2Math.Abs(C1Y)%3B%0A%20%20%20%20%20%20if%20(active)%20%7B%0A%20%20%20%20%20%20%20%20m1%20%3D%20this.m_invMassA%3B%0A%20%20%20%20%20%20%20%20m2%20%3D%20this.m_invMassB%3B%0A%20%20%20%20%20%20%20%20i1%20%3D%20this.m_invIA%3B%0A%20%20%20%20%20%20%20%20i2%20%3D%20this.m_invIB%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.x%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_s1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.y%20%3D%20i1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.z%20%3D%20i1%20*%20this.m_s1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.x%20%3D%20this.m_K.col1.y%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.y%20%3D%20i1%20%2B%20i2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.z%20%3D%20i1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col3.x%20%3D%20this.m_K.col1.z%3B%0A%20%20%20%20%20%20%20%20this.m_K.col3.y%20%3D%20this.m_K.col2.z%3B%0A%20%20%20%20%20%20%20%20this.m_K.col3.z%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_a1%20*%20this.m_a1%20%2B%20i2%20*%20this.m_a2%20*%20this.m_a2%3B%0A%20%20%20%20%20%20%20%20this.m_K.Solve33(impulse%2C%20-C1X%2C%20-C1Y%2C%20-C2)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20m1%20%3D%20this.m_invMassA%3B%0A%20%20%20%20%20%20%20%20m2%20%3D%20this.m_invMassB%3B%0A%20%20%20%20%20%20%20%20i1%20%3D%20this.m_invIA%3B%0A%20%20%20%20%20%20%20%20i2%20%3D%20this.m_invIB%3B%0A%20%20%20%20%20%20%20%20var%20k11%20%3D%0A%20%20%20%20%20%20%20%20%20%20m1%20%2B%20m2%20%2B%20i1%20*%20this.m_s1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20var%20k12%20%3D%20i1%20*%20this.m_s1%20%2B%20i2%20*%20this.m_s2%3B%0A%20%20%20%20%20%20%20%20var%20k22%20%3D%20i1%20%2B%20i2%3B%0A%20%20%20%20%20%20%20%20this.m_K.col1.Set(k11%2C%20k12%2C%200.0)%3B%0A%20%20%20%20%20%20%20%20this.m_K.col2.Set(k12%2C%20k22%2C%200.0)%3B%0A%20%20%20%20%20%20%20%20var%20impulse1%20%3D%20this.m_K.Solve22(new%20b2Vec2()%2C%20-C1X%2C%20-C1Y)%3B%0A%20%20%20%20%20%20%20%20impulse.x%20%3D%20impulse1.x%3B%0A%20%20%20%20%20%20%20%20impulse.y%20%3D%20impulse1.y%3B%0A%20%20%20%20%20%20%20%20impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20PX%20%3D%20impulse.x%20*%20this.m_perp.x%20%2B%20impulse.z%20*%20this.m_axis.x%3B%0A%20%20%20%20%20%20var%20PY%20%3D%20impulse.x%20*%20this.m_perp.y%20%2B%20impulse.z%20*%20this.m_axis.y%3B%0A%20%20%20%20%20%20var%20L1%20%3D%20impulse.x%20*%20this.m_s1%20%2B%20impulse.y%20%2B%20impulse.z%20*%20this.m_a1%3B%0A%20%20%20%20%20%20var%20L2%20%3D%20impulse.x%20*%20this.m_s2%20%2B%20impulse.y%20%2B%20impulse.z%20*%20this.m_a2%3B%0A%20%20%20%20%20%20c1.x%20-%3D%20this.m_invMassA%20*%20PX%3B%0A%20%20%20%20%20%20c1.y%20-%3D%20this.m_invMassA%20*%20PY%3B%0A%20%20%20%20%20%20a1%20-%3D%20this.m_invIA%20*%20L1%3B%0A%20%20%20%20%20%20c2.x%20%2B%3D%20this.m_invMassB%20*%20PX%3B%0A%20%20%20%20%20%20c2.y%20%2B%3D%20this.m_invMassB%20*%20PY%3B%0A%20%20%20%20%20%20a2%20%2B%3D%20this.m_invIB%20*%20L2%3B%0A%20%20%20%20%20%20bA.m_sweep.a%20%3D%20a1%3B%0A%20%20%20%20%20%20bB.m_sweep.a%20%3D%20a2%3B%0A%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20linearError%20%3C%3D%20b2Settings.b2_linearSlop%20%26%26%0A%20%20%20%20%20%20%20%20angularError%20%3C%3D%20b2Settings.b2_angularSlop%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2PrismaticJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2PrismaticJointDef.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2PrismaticJointDef.b2PrismaticJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAxisA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJointDef.prototype.b2PrismaticJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_prismaticJoint%3B%0A%20%20%20%20%20%20this.localAxisA.Set(1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.referenceAngle%20%3D%200.0%3B%0A%20%20%20%20%20%20this.enableLimit%20%3D%20false%3B%0A%20%20%20%20%20%20this.lowerTranslation%20%3D%200.0%3B%0A%20%20%20%20%20%20this.upperTranslation%20%3D%200.0%3B%0A%20%20%20%20%20%20this.enableMotor%20%3D%20false%3B%0A%20%20%20%20%20%20this.maxMotorForce%20%3D%200.0%3B%0A%20%20%20%20%20%20this.motorSpeed%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PrismaticJointDef.prototype.Initialize%20%3D%20function%20(bA%2C%20bB%2C%20anchor%2C%20axis)%20%7B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20this.bodyA.GetLocalPoint(anchor)%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20this.bodyB.GetLocalPoint(anchor)%3B%0A%20%20%20%20%20%20this.localAxisA%20%3D%20this.bodyA.GetLocalVector(axis)%3B%0A%20%20%20%20%20%20this.referenceAngle%20%3D%20this.bodyB.GetAngle()%20-%20this.bodyA.GetAngle()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2PulleyJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2PulleyJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2PulleyJoint.b2PulleyJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_groundAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_groundAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_u1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_u2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_impulse%20*%20this.m_u2.x%2C%0A%20%20%20%20%20%20%20%20inv_dt%20*%20this.m_impulse%20*%20this.m_u2.y%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetGroundAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20a%20%3D%20this.m_ground.m_xf.position.Copy()%3B%0A%20%20%20%20%20%20a.Add(this.m_groundAnchor1)%3B%0A%20%20%20%20%20%20return%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetGroundAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20a%20%3D%20this.m_ground.m_xf.position.Copy()%3B%0A%20%20%20%20%20%20a.Add(this.m_groundAnchor2)%3B%0A%20%20%20%20%20%20return%20a%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetLength1%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20p%20%3D%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%20%20var%20sX%20%3D%20this.m_ground.m_xf.position.x%20%2B%20this.m_groundAnchor1.x%3B%0A%20%20%20%20%20%20var%20sY%20%3D%20this.m_ground.m_xf.position.y%20%2B%20this.m_groundAnchor1.y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p.x%20-%20sX%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p.y%20-%20sY%3B%0A%20%20%20%20%20%20return%20Math.sqrt(dX%20*%20dX%20%2B%20dY%20*%20dY)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetLength2%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20var%20p%20%3D%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%20%20var%20sX%20%3D%20this.m_ground.m_xf.position.x%20%2B%20this.m_groundAnchor2.x%3B%0A%20%20%20%20%20%20var%20sY%20%3D%20this.m_ground.m_xf.position.y%20%2B%20this.m_groundAnchor2.y%3B%0A%20%20%20%20%20%20var%20dX%20%3D%20p.x%20-%20sX%3B%0A%20%20%20%20%20%20var%20dY%20%3D%20p.y%20-%20sY%3B%0A%20%20%20%20%20%20return%20Math.sqrt(dX%20*%20dX%20%2B%20dY%20*%20dY)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.GetRatio%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_ratio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.b2PulleyJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20tY%20%3D%200%3B%0A%20%20%20%20%20%20this.m_ground%20%3D%20this.m_bodyA.m_world.m_groundBody%3B%0A%20%20%20%20%20%20this.m_groundAnchor1.x%20%3D%0A%20%20%20%20%20%20%20%20def.groundAnchorA.x%20-%20this.m_ground.m_xf.position.x%3B%0A%20%20%20%20%20%20this.m_groundAnchor1.y%20%3D%0A%20%20%20%20%20%20%20%20def.groundAnchorA.y%20-%20this.m_ground.m_xf.position.y%3B%0A%20%20%20%20%20%20this.m_groundAnchor2.x%20%3D%0A%20%20%20%20%20%20%20%20def.groundAnchorB.x%20-%20this.m_ground.m_xf.position.x%3B%0A%20%20%20%20%20%20this.m_groundAnchor2.y%20%3D%0A%20%20%20%20%20%20%20%20def.groundAnchorB.y%20-%20this.m_ground.m_xf.position.y%3B%0A%20%20%20%20%20%20this.m_localAnchor1.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchor2.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_ratio%20%3D%20def.ratio%3B%0A%20%20%20%20%20%20this.m_constant%20%3D%20def.lengthA%20%2B%20this.m_ratio%20*%20def.lengthB%3B%0A%20%20%20%20%20%20this.m_maxLength1%20%3D%20b2Math.Min(%0A%20%20%20%20%20%20%20%20def.maxLengthA%2C%0A%20%20%20%20%20%20%20%20this.m_constant%20-%20this.m_ratio%20*%20b2PulleyJoint.b2_minPulleyLength%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.m_maxLength2%20%3D%20b2Math.Min(%0A%20%20%20%20%20%20%20%20def.maxLengthB%2C%0A%20%20%20%20%20%20%20%20(this.m_constant%20-%20b2PulleyJoint.b2_minPulleyLength)%20%2F%20this.m_ratio%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_limitImpulse1%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_limitImpulse2%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%20bA.m_sweep.c.x%20%2B%20r1X%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%20bA.m_sweep.c.y%20%2B%20r1Y%3B%0A%20%20%20%20%20%20var%20p2X%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%3B%0A%20%20%20%20%20%20var%20p2Y%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%3B%0A%20%20%20%20%20%20var%20s1X%20%3D%20this.m_ground.m_xf.position.x%20%2B%20this.m_groundAnchor1.x%3B%0A%20%20%20%20%20%20var%20s1Y%20%3D%20this.m_ground.m_xf.position.y%20%2B%20this.m_groundAnchor1.y%3B%0A%20%20%20%20%20%20var%20s2X%20%3D%20this.m_ground.m_xf.position.x%20%2B%20this.m_groundAnchor2.x%3B%0A%20%20%20%20%20%20var%20s2Y%20%3D%20this.m_ground.m_xf.position.y%20%2B%20this.m_groundAnchor2.y%3B%0A%20%20%20%20%20%20this.m_u1.Set(p1X%20-%20s1X%2C%20p1Y%20-%20s1Y)%3B%0A%20%20%20%20%20%20this.m_u2.Set(p2X%20-%20s2X%2C%20p2Y%20-%20s2Y)%3B%0A%20%20%20%20%20%20var%20length1%20%3D%20this.m_u1.Length()%3B%0A%20%20%20%20%20%20var%20length2%20%3D%20this.m_u2.Length()%3B%0A%20%20%20%20%20%20if%20(length1%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20this.m_u1.Multiply(1.0%20%2F%20length1)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_u1.SetZero()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(length2%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20this.m_u2.Multiply(1.0%20%2F%20length2)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_u2.SetZero()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20C%20%3D%20this.m_constant%20-%20length1%20-%20this.m_ratio%20*%20length2%3B%0A%20%20%20%20%20%20if%20(C%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20this.m_state%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_state%20%3D%20b2Joint.e_atUpperLimit%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(length1%20%3C%20this.m_maxLength1)%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState1%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse1%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState1%20%3D%20b2Joint.e_atUpperLimit%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(length2%20%3C%20this.m_maxLength2)%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState2%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse2%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState2%20%3D%20b2Joint.e_atUpperLimit%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20var%20cr1u1%20%3D%20r1X%20*%20this.m_u1.y%20-%20r1Y%20*%20this.m_u1.x%3B%0A%20%20%20%20%20%20var%20cr2u2%20%3D%20r2X%20*%20this.m_u2.y%20-%20r2Y%20*%20this.m_u2.x%3B%0A%20%20%20%20%20%20this.m_limitMass1%20%3D%20bA.m_invMass%20%2B%20bA.m_invI%20*%20cr1u1%20*%20cr1u1%3B%0A%20%20%20%20%20%20this.m_limitMass2%20%3D%20bB.m_invMass%20%2B%20bB.m_invI%20*%20cr2u2%20*%20cr2u2%3B%0A%20%20%20%20%20%20this.m_pulleyMass%20%3D%0A%20%20%20%20%20%20%20%20this.m_limitMass1%20%2B%20this.m_ratio%20*%20this.m_ratio%20*%20this.m_limitMass2%3B%0A%20%20%20%20%20%20this.m_limitMass1%20%3D%201.0%20%2F%20this.m_limitMass1%3B%0A%20%20%20%20%20%20this.m_limitMass2%20%3D%201.0%20%2F%20this.m_limitMass2%3B%0A%20%20%20%20%20%20this.m_pulleyMass%20%3D%201.0%20%2F%20this.m_pulleyMass%3B%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse1%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse2%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20var%20P1X%20%3D%20(-this.m_impulse%20-%20this.m_limitImpulse1)%20*%20this.m_u1.x%3B%0A%20%20%20%20%20%20%20%20var%20P1Y%20%3D%20(-this.m_impulse%20-%20this.m_limitImpulse1)%20*%20this.m_u1.y%3B%0A%20%20%20%20%20%20%20%20var%20P2X%20%3D%0A%20%20%20%20%20%20%20%20%20%20(-this.m_ratio%20*%20this.m_impulse%20-%20this.m_limitImpulse2)%20*%20this.m_u2.x%3B%0A%20%20%20%20%20%20%20%20var%20P2Y%20%3D%0A%20%20%20%20%20%20%20%20%20%20(-this.m_ratio%20*%20this.m_impulse%20-%20this.m_limitImpulse2)%20*%20this.m_u2.y%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20%2B%3D%20bA.m_invMass%20*%20P1X%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20%2B%3D%20bA.m_invMass%20*%20P1Y%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20%2B%3D%20bA.m_invI%20*%20(r1X%20*%20P1Y%20-%20r1Y%20*%20P1X)%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20bB.m_invMass%20*%20P2X%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20bB.m_invMass%20*%20P2Y%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20P2Y%20-%20r2Y%20*%20P2X)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse1%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse2%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20var%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20v1X%20%3D%200%3B%0A%20%20%20%20%20%20var%20v1Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20v2X%20%3D%200%3B%0A%20%20%20%20%20%20var%20v2Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20P1X%20%3D%200%3B%0A%20%20%20%20%20%20var%20P1Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20P2X%20%3D%200%3B%0A%20%20%20%20%20%20var%20P2Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20Cdot%20%3D%200%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20oldImpulse%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_state%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20v1X%20%3D%20bA.m_linearVelocity.x%20%2B%20-bA.m_angularVelocity%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20v1Y%20%3D%20bA.m_linearVelocity.y%20%2B%20bA.m_angularVelocity%20*%20r1X%3B%0A%20%20%20%20%20%20%20%20v2X%20%3D%20bB.m_linearVelocity.x%20%2B%20-bB.m_angularVelocity%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20v2Y%20%3D%20bB.m_linearVelocity.y%20%2B%20bB.m_angularVelocity%20*%20r2X%3B%0A%20%20%20%20%20%20%20%20Cdot%20%3D%0A%20%20%20%20%20%20%20%20%20%20-(this.m_u1.x%20*%20v1X%20%2B%20this.m_u1.y%20*%20v1Y)%20-%0A%20%20%20%20%20%20%20%20%20%20this.m_ratio%20*%20(this.m_u2.x%20*%20v2X%20%2B%20this.m_u2.y%20*%20v2Y)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_pulleyMass%20*%20-Cdot%3B%0A%20%20%20%20%20%20%20%20oldImpulse%20%3D%20this.m_impulse%3B%0A%20%20%20%20%20%20%20%20this.m_impulse%20%3D%20b2Math.Max(0.0%2C%20this.m_impulse%20%2B%20impulse)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_impulse%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20P1X%20%3D%20-impulse%20*%20this.m_u1.x%3B%0A%20%20%20%20%20%20%20%20P1Y%20%3D%20-impulse%20*%20this.m_u1.y%3B%0A%20%20%20%20%20%20%20%20P2X%20%3D%20-this.m_ratio%20*%20impulse%20*%20this.m_u2.x%3B%0A%20%20%20%20%20%20%20%20P2Y%20%3D%20-this.m_ratio%20*%20impulse%20*%20this.m_u2.y%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20%2B%3D%20bA.m_invMass%20*%20P1X%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20%2B%3D%20bA.m_invMass%20*%20P1Y%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20%2B%3D%20bA.m_invI%20*%20(r1X%20*%20P1Y%20-%20r1Y%20*%20P1X)%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20bB.m_invMass%20*%20P2X%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20bB.m_invMass%20*%20P2Y%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20P2Y%20-%20r2Y%20*%20P2X)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_limitState1%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20v1X%20%3D%20bA.m_linearVelocity.x%20%2B%20-bA.m_angularVelocity%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20v1Y%20%3D%20bA.m_linearVelocity.y%20%2B%20bA.m_angularVelocity%20*%20r1X%3B%0A%20%20%20%20%20%20%20%20Cdot%20%3D%20-(this.m_u1.x%20*%20v1X%20%2B%20this.m_u1.y%20*%20v1Y)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20-this.m_limitMass1%20*%20Cdot%3B%0A%20%20%20%20%20%20%20%20oldImpulse%20%3D%20this.m_limitImpulse1%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse1%20%3D%20b2Math.Max(0.0%2C%20this.m_limitImpulse1%20%2B%20impulse)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_limitImpulse1%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20P1X%20%3D%20-impulse%20*%20this.m_u1.x%3B%0A%20%20%20%20%20%20%20%20P1Y%20%3D%20-impulse%20*%20this.m_u1.y%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20%2B%3D%20bA.m_invMass%20*%20P1X%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20%2B%3D%20bA.m_invMass%20*%20P1Y%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20%2B%3D%20bA.m_invI%20*%20(r1X%20*%20P1Y%20-%20r1Y%20*%20P1X)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_limitState2%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20v2X%20%3D%20bB.m_linearVelocity.x%20%2B%20-bB.m_angularVelocity%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20v2Y%20%3D%20bB.m_linearVelocity.y%20%2B%20bB.m_angularVelocity%20*%20r2X%3B%0A%20%20%20%20%20%20%20%20Cdot%20%3D%20-(this.m_u2.x%20*%20v2X%20%2B%20this.m_u2.y%20*%20v2Y)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20-this.m_limitMass2%20*%20Cdot%3B%0A%20%20%20%20%20%20%20%20oldImpulse%20%3D%20this.m_limitImpulse2%3B%0A%20%20%20%20%20%20%20%20this.m_limitImpulse2%20%3D%20b2Math.Max(0.0%2C%20this.m_limitImpulse2%20%2B%20impulse)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_limitImpulse2%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20P2X%20%3D%20-impulse%20*%20this.m_u2.x%3B%0A%20%20%20%20%20%20%20%20P2Y%20%3D%20-impulse%20*%20this.m_u2.y%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20bB.m_invMass%20*%20P2X%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20bB.m_invMass%20*%20P2Y%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20P2Y%20-%20r2Y%20*%20P2X)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20s1X%20%3D%20this.m_ground.m_xf.position.x%20%2B%20this.m_groundAnchor1.x%3B%0A%20%20%20%20%20%20var%20s1Y%20%3D%20this.m_ground.m_xf.position.y%20%2B%20this.m_groundAnchor1.y%3B%0A%20%20%20%20%20%20var%20s2X%20%3D%20this.m_ground.m_xf.position.x%20%2B%20this.m_groundAnchor2.x%3B%0A%20%20%20%20%20%20var%20s2Y%20%3D%20this.m_ground.m_xf.position.y%20%2B%20this.m_groundAnchor2.y%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%200%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%200%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20p1X%20%3D%200%3B%0A%20%20%20%20%20%20var%20p1Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20p2X%20%3D%200%3B%0A%20%20%20%20%20%20var%20p2Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20length1%20%3D%200%3B%0A%20%20%20%20%20%20var%20length2%20%3D%200%3B%0A%20%20%20%20%20%20var%20C%20%3D%200%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20oldImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20oldLimitPositionImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20linearError%20%3D%200.0%3B%0A%20%20%20%20%20%20if%20(this.m_state%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20p1X%20%3D%20bA.m_sweep.c.x%20%2B%20r1X%3B%0A%20%20%20%20%20%20%20%20p1Y%20%3D%20bA.m_sweep.c.y%20%2B%20r1Y%3B%0A%20%20%20%20%20%20%20%20p2X%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%3B%0A%20%20%20%20%20%20%20%20p2Y%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%3B%0A%20%20%20%20%20%20%20%20this.m_u1.Set(p1X%20-%20s1X%2C%20p1Y%20-%20s1Y)%3B%0A%20%20%20%20%20%20%20%20this.m_u2.Set(p2X%20-%20s2X%2C%20p2Y%20-%20s2Y)%3B%0A%20%20%20%20%20%20%20%20length1%20%3D%20this.m_u1.Length()%3B%0A%20%20%20%20%20%20%20%20length2%20%3D%20this.m_u2.Length()%3B%0A%20%20%20%20%20%20%20%20if%20(length1%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u1.Multiply(1.0%20%2F%20length1)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u1.SetZero()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(length2%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u2.Multiply(1.0%20%2F%20length2)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u2.SetZero()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20C%20%3D%20this.m_constant%20-%20length1%20-%20this.m_ratio%20*%20length2%3B%0A%20%20%20%20%20%20%20%20linearError%20%3D%20b2Math.Max(linearError%2C%20-C)%3B%0A%20%20%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20C%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20-this.m_pulleyMass%20*%20C%3B%0A%20%20%20%20%20%20%20%20p1X%20%3D%20-impulse%20*%20this.m_u1.x%3B%0A%20%20%20%20%20%20%20%20p1Y%20%3D%20-impulse%20*%20this.m_u1.y%3B%0A%20%20%20%20%20%20%20%20p2X%20%3D%20-this.m_ratio%20*%20impulse%20*%20this.m_u2.x%3B%0A%20%20%20%20%20%20%20%20p2Y%20%3D%20-this.m_ratio%20*%20impulse%20*%20this.m_u2.y%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.c.x%20%2B%3D%20bA.m_invMass%20*%20p1X%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.c.y%20%2B%3D%20bA.m_invMass%20*%20p1Y%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.a%20%2B%3D%20bA.m_invI%20*%20(r1X%20*%20p1Y%20-%20r1Y%20*%20p1X)%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20bB.m_invMass%20*%20p2X%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20bB.m_invMass%20*%20p2Y%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20p2Y%20-%20r2Y%20*%20p2X)%3B%0A%20%20%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_limitState1%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20p1X%20%3D%20bA.m_sweep.c.x%20%2B%20r1X%3B%0A%20%20%20%20%20%20%20%20p1Y%20%3D%20bA.m_sweep.c.y%20%2B%20r1Y%3B%0A%20%20%20%20%20%20%20%20this.m_u1.Set(p1X%20-%20s1X%2C%20p1Y%20-%20s1Y)%3B%0A%20%20%20%20%20%20%20%20length1%20%3D%20this.m_u1.Length()%3B%0A%20%20%20%20%20%20%20%20if%20(length1%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u1.x%20*%3D%201.0%20%2F%20length1%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_u1.y%20*%3D%201.0%20%2F%20length1%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u1.SetZero()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20C%20%3D%20this.m_maxLength1%20-%20length1%3B%0A%20%20%20%20%20%20%20%20linearError%20%3D%20b2Math.Max(linearError%2C%20-C)%3B%0A%20%20%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20C%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20-this.m_limitMass1%20*%20C%3B%0A%20%20%20%20%20%20%20%20p1X%20%3D%20-impulse%20*%20this.m_u1.x%3B%0A%20%20%20%20%20%20%20%20p1Y%20%3D%20-impulse%20*%20this.m_u1.y%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.c.x%20%2B%3D%20bA.m_invMass%20*%20p1X%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.c.y%20%2B%3D%20bA.m_invMass%20*%20p1Y%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.a%20%2B%3D%20bA.m_invI%20*%20(r1X%20*%20p1Y%20-%20r1Y%20*%20p1X)%3B%0A%20%20%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_limitState2%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20p2X%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%3B%0A%20%20%20%20%20%20%20%20p2Y%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%3B%0A%20%20%20%20%20%20%20%20this.m_u2.Set(p2X%20-%20s2X%2C%20p2Y%20-%20s2Y)%3B%0A%20%20%20%20%20%20%20%20length2%20%3D%20this.m_u2.Length()%3B%0A%20%20%20%20%20%20%20%20if%20(length2%20%3E%20b2Settings.b2_linearSlop)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u2.x%20*%3D%201.0%20%2F%20length2%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_u2.y%20*%3D%201.0%20%2F%20length2%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_u2.SetZero()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20C%20%3D%20this.m_maxLength2%20-%20length2%3B%0A%20%20%20%20%20%20%20%20linearError%20%3D%20b2Math.Max(linearError%2C%20-C)%3B%0A%20%20%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20C%20%2B%20b2Settings.b2_linearSlop%2C%0A%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxLinearCorrection%2C%0A%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20-this.m_limitMass2%20*%20C%3B%0A%20%20%20%20%20%20%20%20p2X%20%3D%20-impulse%20*%20this.m_u2.x%3B%0A%20%20%20%20%20%20%20%20p2Y%20%3D%20-impulse%20*%20this.m_u2.y%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20bB.m_invMass%20*%20p2X%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20bB.m_invMass%20*%20p2Y%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20p2Y%20-%20r2Y%20*%20p2X)%3B%0A%20%20%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20linearError%20%3C%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength%20%3D%202.0%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Box2D.inherit(b2PulleyJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2PulleyJointDef.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2PulleyJointDef.b2PulleyJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.groundAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.groundAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJointDef.prototype.b2PulleyJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_pulleyJoint%3B%0A%20%20%20%20%20%20this.groundAnchorA.Set(-1.0%2C%201.0)%3B%0A%20%20%20%20%20%20this.groundAnchorB.Set(1.0%2C%201.0)%3B%0A%20%20%20%20%20%20this.localAnchorA.Set(-1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.localAnchorB.Set(1.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.lengthA%20%3D%200.0%3B%0A%20%20%20%20%20%20this.maxLengthA%20%3D%200.0%3B%0A%20%20%20%20%20%20this.lengthB%20%3D%200.0%3B%0A%20%20%20%20%20%20this.maxLengthB%20%3D%200.0%3B%0A%20%20%20%20%20%20this.ratio%20%3D%201.0%3B%0A%20%20%20%20%20%20this.collideConnected%20%3D%20true%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2PulleyJointDef.prototype.Initialize%20%3D%20function%20(%0A%20%20%20%20%20%20bA%2C%0A%20%20%20%20%20%20bB%2C%0A%20%20%20%20%20%20gaA%2C%0A%20%20%20%20%20%20gaB%2C%0A%20%20%20%20%20%20anchorA%2C%0A%20%20%20%20%20%20anchorB%2C%0A%20%20%20%20%20%20r%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(r%20%3D%3D%3D%20undefined)%20r%20%3D%200%3B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.groundAnchorA.SetV(gaA)%3B%0A%20%20%20%20%20%20this.groundAnchorB.SetV(gaB)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20this.bodyA.GetLocalPoint(anchorA)%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20this.bodyB.GetLocalPoint(anchorB)%3B%0A%20%20%20%20%20%20var%20d1X%20%3D%20anchorA.x%20-%20gaA.x%3B%0A%20%20%20%20%20%20var%20d1Y%20%3D%20anchorA.y%20-%20gaA.y%3B%0A%20%20%20%20%20%20this.lengthA%20%3D%20Math.sqrt(d1X%20*%20d1X%20%2B%20d1Y%20*%20d1Y)%3B%0A%20%20%20%20%20%20var%20d2X%20%3D%20anchorB.x%20-%20gaB.x%3B%0A%20%20%20%20%20%20var%20d2Y%20%3D%20anchorB.y%20-%20gaB.y%3B%0A%20%20%20%20%20%20this.lengthB%20%3D%20Math.sqrt(d2X%20*%20d2X%20%2B%20d2Y%20*%20d2Y)%3B%0A%20%20%20%20%20%20this.ratio%20%3D%20r%3B%0A%20%20%20%20%20%20var%20C%20%3D%20this.lengthA%20%2B%20this.ratio%20*%20this.lengthB%3B%0A%20%20%20%20%20%20this.maxLengthA%20%3D%20C%20-%20this.ratio%20*%20b2PulleyJoint.b2_minPulleyLength%3B%0A%20%20%20%20%20%20this.maxLengthB%20%3D%20(C%20-%20b2PulleyJoint.b2_minPulleyLength)%20%2F%20this.ratio%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2RevoluteJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2RevoluteJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2RevoluteJoint.b2RevoluteJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.K%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.K1%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.K2%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.K3%20%3D%20new%20b2Mat22()%3B%0A%20%20%20%20%20%20this.impulse3%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.impulse2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.reduced%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor1%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchor2%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.m_mass%20%3D%20new%20b2Mat33()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchor1)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchor2)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(inv_dt%20*%20this.m_impulse.x%2C%20inv_dt%20*%20this.m_impulse.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20inv_dt%20*%20this.m_impulse.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetJointAngle%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20this.m_bodyB.m_sweep.a%20-%20this.m_bodyA.m_sweep.a%20-%20this.m_referenceAngle%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetJointSpeed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.m_angularVelocity%20-%20this.m_bodyA.m_angularVelocity%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.IsLimitEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_enableLimit%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.EnableLimit%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20this.m_enableLimit%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetLowerLimit%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_lowerAngle%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetUpperLimit%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_upperAngle%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.SetLimits%20%3D%20function%20(lower%2C%20upper)%20%7B%0A%20%20%20%20%20%20if%20(lower%20%3D%3D%3D%20undefined)%20lower%20%3D%200%3B%0A%20%20%20%20%20%20if%20(upper%20%3D%3D%3D%20undefined)%20upper%20%3D%200%3B%0A%20%20%20%20%20%20this.m_lowerAngle%20%3D%20lower%3B%0A%20%20%20%20%20%20this.m_upperAngle%20%3D%20upper%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.IsMotorEnabled%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20return%20this.m_enableMotor%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.EnableMotor%20%3D%20function%20(flag)%20%7B%0A%20%20%20%20%20%20this.m_enableMotor%20%3D%20flag%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.SetMotorSpeed%20%3D%20function%20(speed)%20%7B%0A%20%20%20%20%20%20if%20(speed%20%3D%3D%3D%20undefined)%20speed%20%3D%200%3B%0A%20%20%20%20%20%20this.m_bodyA.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_bodyB.SetAwake(true)%3B%0A%20%20%20%20%20%20this.m_motorSpeed%20%3D%20speed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetMotorSpeed%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_motorSpeed%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.SetMaxMotorTorque%20%3D%20function%20(torque)%20%7B%0A%20%20%20%20%20%20if%20(torque%20%3D%3D%3D%20undefined)%20torque%20%3D%200%3B%0A%20%20%20%20%20%20this.m_maxMotorTorque%20%3D%20torque%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.GetMotorTorque%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_maxMotorTorque%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.b2RevoluteJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20this.m_localAnchor1.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchor2.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_referenceAngle%20%3D%20def.referenceAngle%3B%0A%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20this.m_lowerAngle%20%3D%20def.lowerAngle%3B%0A%20%20%20%20%20%20this.m_upperAngle%20%3D%20def.upperAngle%3B%0A%20%20%20%20%20%20this.m_maxMotorTorque%20%3D%20def.maxMotorTorque%3B%0A%20%20%20%20%20%20this.m_motorSpeed%20%3D%20def.motorSpeed%3B%0A%20%20%20%20%20%20this.m_enableLimit%20%3D%20def.enableLimit%3B%0A%20%20%20%20%20%20this.m_enableMotor%20%3D%20def.enableMotor%3B%0A%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%7C%7C%20this.m_enableLimit)%20%7B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20m1%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20m2%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20i1%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20i2%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20this.m_mass.col1.x%20%3D%20m1%20%2B%20m2%20%2B%20r1Y%20*%20r1Y%20*%20i1%20%2B%20r2Y%20*%20r2Y%20*%20i2%3B%0A%20%20%20%20%20%20this.m_mass.col2.x%20%3D%20-r1Y%20*%20r1X%20*%20i1%20-%20r2Y%20*%20r2X%20*%20i2%3B%0A%20%20%20%20%20%20this.m_mass.col3.x%20%3D%20-r1Y%20*%20i1%20-%20r2Y%20*%20i2%3B%0A%20%20%20%20%20%20this.m_mass.col1.y%20%3D%20this.m_mass.col2.x%3B%0A%20%20%20%20%20%20this.m_mass.col2.y%20%3D%20m1%20%2B%20m2%20%2B%20r1X%20*%20r1X%20*%20i1%20%2B%20r2X%20*%20r2X%20*%20i2%3B%0A%20%20%20%20%20%20this.m_mass.col3.y%20%3D%20r1X%20*%20i1%20%2B%20r2X%20*%20i2%3B%0A%20%20%20%20%20%20this.m_mass.col1.z%20%3D%20this.m_mass.col3.x%3B%0A%20%20%20%20%20%20this.m_mass.col2.z%20%3D%20this.m_mass.col3.y%3B%0A%20%20%20%20%20%20this.m_mass.col3.z%20%3D%20i1%20%2B%20i2%3B%0A%20%20%20%20%20%20this.m_motorMass%20%3D%201.0%20%2F%20(i1%20%2B%20i2)%3B%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%3D%3D%20false)%20%7B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_enableLimit)%20%7B%0A%20%20%20%20%20%20%20%20var%20jointAngle%20%3D%20bB.m_sweep.a%20-%20bA.m_sweep.a%20-%20this.m_referenceAngle%3B%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20b2Math.Abs(this.m_upperAngle%20-%20this.m_lowerAngle)%20%3C%0A%20%20%20%20%20%20%20%20%20%202.0%20*%20b2Settings.b2_angularSlop%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_equalLimits%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(jointAngle%20%3C%3D%20this.m_lowerAngle)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_limitState%20!%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_atLowerLimit%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(jointAngle%20%3E%3D%20this.m_upperAngle)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(this.m_limitState%20!%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_atUpperLimit%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_limitState%20%3D%20b2Joint.e_inactiveLimit%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20var%20PX%20%3D%20this.m_impulse.x%3B%0A%20%20%20%20%20%20%20%20var%20PY%20%3D%20this.m_impulse.y%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20m1%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20m1%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%0A%20%20%20%20%20%20%20%20%20%20i1%20*%20(r1X%20*%20PY%20-%20r1Y%20*%20PX%20%2B%20this.m_motorImpulse%20%2B%20this.m_impulse.z)%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20m2%20*%20PX%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20m2%20*%20PY%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20i2%20*%20(r2X%20*%20PY%20-%20r2Y%20*%20PX%20%2B%20this.m_motorImpulse%20%2B%20this.m_impulse.z)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20newImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20r1X%20%3D%200%3B%0A%20%20%20%20%20%20var%20r1Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20r2X%20%3D%200%3B%0A%20%20%20%20%20%20var%20r2Y%20%3D%200%3B%0A%20%20%20%20%20%20var%20v1%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w1%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20v2%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20w2%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20m1%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20m2%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20i1%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20i2%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20if%20(this.m_enableMotor%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_equalLimits)%20%7B%0A%20%20%20%20%20%20%20%20var%20Cdot%20%3D%20w2%20-%20w1%20-%20this.m_motorSpeed%3B%0A%20%20%20%20%20%20%20%20var%20impulse%20%3D%20this.m_motorMass%20*%20-Cdot%3B%0A%20%20%20%20%20%20%20%20var%20oldImpulse%20%3D%20this.m_motorImpulse%3B%0A%20%20%20%20%20%20%20%20var%20maxImpulse%20%3D%20step.dt%20*%20this.m_maxMotorTorque%3B%0A%20%20%20%20%20%20%20%20this.m_motorImpulse%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20this.m_motorImpulse%20%2B%20impulse%2C%0A%20%20%20%20%20%20%20%20%20%20-maxImpulse%2C%0A%20%20%20%20%20%20%20%20%20%20maxImpulse%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20impulse%20%3D%20this.m_motorImpulse%20-%20oldImpulse%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20i1%20*%20impulse%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20i2%20*%20impulse%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20if%20(this.m_enableLimit%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_inactiveLimit)%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20var%20Cdot1X%20%3D%20v2.x%20%2B%20-w2%20*%20r2Y%20-%20v1.x%20-%20-w1%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20var%20Cdot1Y%20%3D%20v2.y%20%2B%20w2%20*%20r2X%20-%20v1.y%20-%20w1%20*%20r1X%3B%0A%20%20%20%20%20%20%20%20var%20Cdot2%20%3D%20w2%20-%20w1%3B%0A%20%20%20%20%20%20%20%20this.m_mass.Solve33(this.impulse3%2C%20-Cdot1X%2C%20-Cdot1Y%2C%20-Cdot2)%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_equalLimits)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.m_impulse.Add(this.impulse3)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20newImpulse%20%3D%20this.m_impulse.z%20%2B%20this.impulse3.z%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(newImpulse%20%3C%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_mass.Solve22(this.reduced%2C%20-Cdot1X%2C%20-Cdot1Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.impulse3.x%20%3D%20this.reduced.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.impulse3.y%20%3D%20this.reduced.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.impulse3.z%20%3D%20-this.m_impulse.z%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20%2B%3D%20this.reduced.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%2B%3D%20this.reduced.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20newImpulse%20%3D%20this.m_impulse.z%20%2B%20this.impulse3.z%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(newImpulse%20%3E%200.0)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_mass.Solve22(this.reduced%2C%20-Cdot1X%2C%20-Cdot1Y)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.impulse3.x%20%3D%20this.reduced.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.impulse3.y%20%3D%20this.reduced.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.impulse3.z%20%3D%20-this.m_impulse.z%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.x%20%2B%3D%20this.reduced.x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.y%20%2B%3D%20this.reduced.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this.m_impulse.z%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20m1%20*%20this.impulse3.x%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20m1%20*%20this.impulse3.y%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%0A%20%20%20%20%20%20%20%20%20%20i1%20*%20(r1X%20*%20this.impulse3.y%20-%20r1Y%20*%20this.impulse3.x%20%2B%20this.impulse3.z)%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20m2%20*%20this.impulse3.x%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20m2%20*%20this.impulse3.y%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20i2%20*%20(r2X%20*%20this.impulse3.y%20-%20r2Y%20*%20this.impulse3.x%20%2B%20this.impulse3.z)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20var%20CdotX%20%3D%20v2.x%20%2B%20-w2%20*%20r2Y%20-%20v1.x%20-%20-w1%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20var%20CdotY%20%3D%20v2.y%20%2B%20w2%20*%20r2X%20-%20v1.y%20-%20w1%20*%20r1X%3B%0A%20%20%20%20%20%20%20%20this.m_mass.Solve22(this.impulse2%2C%20-CdotX%2C%20-CdotY)%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20%2B%3D%20this.impulse2.x%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20%2B%3D%20this.impulse2.y%3B%0A%20%20%20%20%20%20%20%20v1.x%20-%3D%20m1%20*%20this.impulse2.x%3B%0A%20%20%20%20%20%20%20%20v1.y%20-%3D%20m1%20*%20this.impulse2.y%3B%0A%20%20%20%20%20%20%20%20w1%20-%3D%20i1%20*%20(r1X%20*%20this.impulse2.y%20-%20r1Y%20*%20this.impulse2.x)%3B%0A%20%20%20%20%20%20%20%20v2.x%20%2B%3D%20m2%20*%20this.impulse2.x%3B%0A%20%20%20%20%20%20%20%20v2.y%20%2B%3D%20m2%20*%20this.impulse2.y%3B%0A%20%20%20%20%20%20%20%20w2%20%2B%3D%20i2%20*%20(r2X%20*%20this.impulse2.y%20-%20r2Y%20*%20this.impulse2.x)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20bA.m_linearVelocity.SetV(v1)%3B%0A%20%20%20%20%20%20bA.m_angularVelocity%20%3D%20w1%3B%0A%20%20%20%20%20%20bB.m_linearVelocity.SetV(v2)%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%3D%20w2%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20oldLimitImpulse%20%3D%200%3B%0A%20%20%20%20%20%20var%20C%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20angularError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20positionError%20%3D%200.0%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20impulseX%20%3D%200%3B%0A%20%20%20%20%20%20var%20impulseY%20%3D%200%3B%0A%20%20%20%20%20%20if%20(this.m_enableLimit%20%26%26%20this.m_limitState%20!%3D%20b2Joint.e_inactiveLimit)%20%7B%0A%20%20%20%20%20%20%20%20var%20angle%20%3D%20bB.m_sweep.a%20-%20bA.m_sweep.a%20-%20this.m_referenceAngle%3B%0A%20%20%20%20%20%20%20%20var%20limitImpulse%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_equalLimits)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20angle%20-%20this.m_lowerAngle%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxAngularCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxAngularCorrection%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20limitImpulse%20%3D%20-this.m_motorMass%20*%20C%3B%0A%20%20%20%20%20%20%20%20%20%20angularError%20%3D%20b2Math.Abs(C)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atLowerLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C%20%3D%20angle%20-%20this.m_lowerAngle%3B%0A%20%20%20%20%20%20%20%20%20%20angularError%20%3D%20-C%3B%0A%20%20%20%20%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20C%20%2B%20b2Settings.b2_angularSlop%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20-b2Settings.b2_maxAngularCorrection%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20limitImpulse%20%3D%20-this.m_motorMass%20*%20C%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(this.m_limitState%20%3D%3D%20b2Joint.e_atUpperLimit)%20%7B%0A%20%20%20%20%20%20%20%20%20%20C%20%3D%20angle%20-%20this.m_upperAngle%3B%0A%20%20%20%20%20%20%20%20%20%20angularError%20%3D%20C%3B%0A%20%20%20%20%20%20%20%20%20%20C%20%3D%20b2Math.Clamp(%0A%20%20%20%20%20%20%20%20%20%20%20%20C%20-%20b2Settings.b2_angularSlop%2C%0A%20%20%20%20%20%20%20%20%20%20%20%200.0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20b2Settings.b2_maxAngularCorrection%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20limitImpulse%20%3D%20-this.m_motorMass%20*%20C%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20bA.m_sweep.a%20-%3D%20bA.m_invI%20*%20limitImpulse%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20bB.m_invI%20*%20limitImpulse%3B%0A%20%20%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20%20%20var%20r1X%20%3D%20this.m_localAnchor1.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20var%20r1Y%20%3D%20this.m_localAnchor1.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r1X%20%2B%20tMat.col2.x%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1Y%20%3D%20tMat.col1.y%20*%20r1X%20%2B%20tMat.col2.y%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20r1X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20%20%20var%20r2X%20%3D%20this.m_localAnchor2.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20%20%20var%20r2Y%20%3D%20this.m_localAnchor2.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20r2X%20%2B%20tMat.col2.x%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2Y%20%3D%20tMat.col1.y%20*%20r2X%20%2B%20tMat.col2.y%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20r2X%20%3D%20tX%3B%0A%20%20%20%20%20%20%20%20var%20CX%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%20-%20bA.m_sweep.c.x%20-%20r1X%3B%0A%20%20%20%20%20%20%20%20var%20CY%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%20-%20bA.m_sweep.c.y%20-%20r1Y%3B%0A%20%20%20%20%20%20%20%20var%20CLengthSquared%20%3D%20CX%20*%20CX%20%2B%20CY%20*%20CY%3B%0A%20%20%20%20%20%20%20%20var%20CLength%20%3D%20Math.sqrt(CLengthSquared)%3B%0A%20%20%20%20%20%20%20%20positionError%20%3D%20CLength%3B%0A%20%20%20%20%20%20%20%20var%20invMass1%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invMass2%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20%20%20var%20invI1%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20invI2%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20%20%20var%20k_allowedStretch%20%3D%2010.0%20*%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%20%20%20%20if%20(CLengthSquared%20%3E%20k_allowedStretch%20*%20k_allowedStretch)%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20uX%20%3D%20CX%20%2F%20CLength%3B%0A%20%20%20%20%20%20%20%20%20%20var%20uY%20%3D%20CY%20%2F%20CLength%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k%20%3D%20invMass1%20%2B%20invMass2%3B%0A%20%20%20%20%20%20%20%20%20%20var%20m%20%3D%201.0%20%2F%20k%3B%0A%20%20%20%20%20%20%20%20%20%20impulseX%20%3D%20m%20*%20-CX%3B%0A%20%20%20%20%20%20%20%20%20%20impulseY%20%3D%20m%20*%20-CY%3B%0A%20%20%20%20%20%20%20%20%20%20var%20k_beta%20%3D%200.5%3B%0A%20%20%20%20%20%20%20%20%20%20bA.m_sweep.c.x%20-%3D%20k_beta%20*%20invMass1%20*%20impulseX%3B%0A%20%20%20%20%20%20%20%20%20%20bA.m_sweep.c.y%20-%3D%20k_beta%20*%20invMass1%20*%20impulseY%3B%0A%20%20%20%20%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20k_beta%20*%20invMass2%20*%20impulseX%3B%0A%20%20%20%20%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20k_beta%20*%20invMass2%20*%20impulseY%3B%0A%20%20%20%20%20%20%20%20%20%20CX%20%3D%20bB.m_sweep.c.x%20%2B%20r2X%20-%20bA.m_sweep.c.x%20-%20r1X%3B%0A%20%20%20%20%20%20%20%20%20%20CY%20%3D%20bB.m_sweep.c.y%20%2B%20r2Y%20-%20bA.m_sweep.c.y%20-%20r1Y%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20this.K1.col1.x%20%3D%20invMass1%20%2B%20invMass2%3B%0A%20%20%20%20%20%20%20%20this.K1.col2.x%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.K1.col1.y%20%3D%200.0%3B%0A%20%20%20%20%20%20%20%20this.K1.col2.y%20%3D%20invMass1%20%2B%20invMass2%3B%0A%20%20%20%20%20%20%20%20this.K2.col1.x%20%3D%20invI1%20*%20r1Y%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20this.K2.col2.x%20%3D%20-invI1%20*%20r1X%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20this.K2.col1.y%20%3D%20-invI1%20*%20r1X%20*%20r1Y%3B%0A%20%20%20%20%20%20%20%20this.K2.col2.y%20%3D%20invI1%20*%20r1X%20*%20r1X%3B%0A%20%20%20%20%20%20%20%20this.K3.col1.x%20%3D%20invI2%20*%20r2Y%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20this.K3.col2.x%20%3D%20-invI2%20*%20r2X%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20this.K3.col1.y%20%3D%20-invI2%20*%20r2X%20*%20r2Y%3B%0A%20%20%20%20%20%20%20%20this.K3.col2.y%20%3D%20invI2%20*%20r2X%20*%20r2X%3B%0A%20%20%20%20%20%20%20%20this.K.SetM(this.K1)%3B%0A%20%20%20%20%20%20%20%20this.K.AddM(this.K2)%3B%0A%20%20%20%20%20%20%20%20this.K.AddM(this.K3)%3B%0A%20%20%20%20%20%20%20%20this.K.Solve(b2RevoluteJoint.tImpulse%2C%20-CX%2C%20-CY)%3B%0A%20%20%20%20%20%20%20%20impulseX%20%3D%20b2RevoluteJoint.tImpulse.x%3B%0A%20%20%20%20%20%20%20%20impulseY%20%3D%20b2RevoluteJoint.tImpulse.y%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.c.x%20-%3D%20bA.m_invMass%20*%20impulseX%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.c.y%20-%3D%20bA.m_invMass%20*%20impulseY%3B%0A%20%20%20%20%20%20%20%20bA.m_sweep.a%20-%3D%20bA.m_invI%20*%20(r1X%20*%20impulseY%20-%20r1Y%20*%20impulseX)%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20bB.m_invMass%20*%20impulseX%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20bB.m_invMass%20*%20impulseY%3B%0A%20%20%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20bB.m_invI%20*%20(r2X%20*%20impulseY%20-%20r2Y%20*%20impulseX)%3B%0A%20%20%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20positionError%20%3C%3D%20b2Settings.b2_linearSlop%20%26%26%0A%20%20%20%20%20%20%20%20angularError%20%3C%3D%20b2Settings.b2_angularSlop%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.postDefs.push(function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20Box2D.inherit(b2RevoluteJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2RevoluteJointDef.prototype.__super%20%3D%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2RevoluteJointDef.b2RevoluteJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJointDef.prototype.b2RevoluteJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_revoluteJoint%3B%0A%20%20%20%20%20%20this.localAnchorA.Set(0.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.localAnchorB.Set(0.0%2C%200.0)%3B%0A%20%20%20%20%20%20this.referenceAngle%20%3D%200.0%3B%0A%20%20%20%20%20%20this.lowerAngle%20%3D%200.0%3B%0A%20%20%20%20%20%20this.upperAngle%20%3D%200.0%3B%0A%20%20%20%20%20%20this.maxMotorTorque%20%3D%200.0%3B%0A%20%20%20%20%20%20this.motorSpeed%20%3D%200.0%3B%0A%20%20%20%20%20%20this.enableLimit%20%3D%20false%3B%0A%20%20%20%20%20%20this.enableMotor%20%3D%20false%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2RevoluteJointDef.prototype.Initialize%20%3D%20function%20(bA%2C%20bB%2C%20anchor)%20%7B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20this.bodyA.GetLocalPoint(anchor)%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20this.bodyB.GetLocalPoint(anchor)%3B%0A%20%20%20%20%20%20this.referenceAngle%20%3D%20this.bodyB.GetAngle()%20-%20this.bodyA.GetAngle()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2WeldJoint%2C%20Box2D.Dynamics.Joints.b2Joint)%3B%0A%20%20%20%20b2WeldJoint.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2Joint.prototype%3B%0A%20%20%20%20b2WeldJoint.b2WeldJoint%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.m_localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.m_impulse%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.m_mass%20%3D%20new%20b2Mat33()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.GetAnchorA%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyA.GetWorldPoint(this.m_localAnchorA)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.GetAnchorB%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_bodyB.GetWorldPoint(this.m_localAnchorB)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.GetReactionForce%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20new%20b2Vec2(inv_dt%20*%20this.m_impulse.x%2C%20inv_dt%20*%20this.m_impulse.y)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.GetReactionTorque%20%3D%20function%20(inv_dt)%20%7B%0A%20%20%20%20%20%20if%20(inv_dt%20%3D%3D%3D%20undefined)%20inv_dt%20%3D%200%3B%0A%20%20%20%20%20%20return%20inv_dt%20*%20this.m_impulse.z%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.b2WeldJoint%20%3D%20function%20(def)%20%7B%0A%20%20%20%20%20%20this.__super.b2Joint.call(this%2C%20def)%3B%0A%20%20%20%20%20%20this.m_localAnchorA.SetV(def.localAnchorA)%3B%0A%20%20%20%20%20%20this.m_localAnchorB.SetV(def.localAnchorB)%3B%0A%20%20%20%20%20%20this.m_referenceAngle%20%3D%20def.referenceAngle%3B%0A%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20this.m_mass%20%3D%20new%20b2Mat33()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.InitVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20rAX%20%3D%20this.m_localAnchorA.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rAY%20%3D%20this.m_localAnchorA.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rAX%20%2B%20tMat.col2.x%20*%20rAY%3B%0A%20%20%20%20%20%20rAY%20%3D%20tMat.col1.y%20*%20rAX%20%2B%20tMat.col2.y%20*%20rAY%3B%0A%20%20%20%20%20%20rAX%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20rBX%20%3D%20this.m_localAnchorB.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rBY%20%3D%20this.m_localAnchorB.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rBX%20%2B%20tMat.col2.x%20*%20rBY%3B%0A%20%20%20%20%20%20rBY%20%3D%20tMat.col1.y%20*%20rBX%20%2B%20tMat.col2.y%20*%20rBY%3B%0A%20%20%20%20%20%20rBX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20mA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20mB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20iA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20iB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20this.m_mass.col1.x%20%3D%20mA%20%2B%20mB%20%2B%20rAY%20*%20rAY%20*%20iA%20%2B%20rBY%20*%20rBY%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col2.x%20%3D%20-rAY%20*%20rAX%20*%20iA%20-%20rBY%20*%20rBX%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col3.x%20%3D%20-rAY%20*%20iA%20-%20rBY%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col1.y%20%3D%20this.m_mass.col2.x%3B%0A%20%20%20%20%20%20this.m_mass.col2.y%20%3D%20mA%20%2B%20mB%20%2B%20rAX%20*%20rAX%20*%20iA%20%2B%20rBX%20*%20rBX%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col3.y%20%3D%20rAX%20*%20iA%20%2B%20rBX%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col1.z%20%3D%20this.m_mass.col3.x%3B%0A%20%20%20%20%20%20this.m_mass.col2.z%20%3D%20this.m_mass.col3.y%3B%0A%20%20%20%20%20%20this.m_mass.col3.z%20%3D%20iA%20%2B%20iB%3B%0A%20%20%20%20%20%20if%20(step.warmStarting)%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.x%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.y%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20this.m_impulse.z%20*%3D%20step.dtRatio%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.x%20-%3D%20mA%20*%20this.m_impulse.x%3B%0A%20%20%20%20%20%20%20%20bA.m_linearVelocity.y%20-%3D%20mA%20*%20this.m_impulse.y%3B%0A%20%20%20%20%20%20%20%20bA.m_angularVelocity%20-%3D%0A%20%20%20%20%20%20%20%20%20%20iA%20*%0A%20%20%20%20%20%20%20%20%20%20(rAX%20*%20this.m_impulse.y%20-%20rAY%20*%20this.m_impulse.x%20%2B%20this.m_impulse.z)%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.x%20%2B%3D%20mB%20*%20this.m_impulse.x%3B%0A%20%20%20%20%20%20%20%20bB.m_linearVelocity.y%20%2B%3D%20mB%20*%20this.m_impulse.y%3B%0A%20%20%20%20%20%20%20%20bB.m_angularVelocity%20%2B%3D%0A%20%20%20%20%20%20%20%20%20%20iB%20*%0A%20%20%20%20%20%20%20%20%20%20(rBX%20*%20this.m_impulse.y%20-%20rBY%20*%20this.m_impulse.x%20%2B%20this.m_impulse.z)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20this.m_impulse.SetZero()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.SolveVelocityConstraints%20%3D%20function%20(step)%20%7B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20var%20vA%20%3D%20bA.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20wA%20%3D%20bA.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20vB%20%3D%20bB.m_linearVelocity%3B%0A%20%20%20%20%20%20var%20wB%20%3D%20bB.m_angularVelocity%3B%0A%20%20%20%20%20%20var%20mA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20mB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20iA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20iB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20rAX%20%3D%20this.m_localAnchorA.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rAY%20%3D%20this.m_localAnchorA.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rAX%20%2B%20tMat.col2.x%20*%20rAY%3B%0A%20%20%20%20%20%20rAY%20%3D%20tMat.col1.y%20*%20rAX%20%2B%20tMat.col2.y%20*%20rAY%3B%0A%20%20%20%20%20%20rAX%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20rBX%20%3D%20this.m_localAnchorB.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rBY%20%3D%20this.m_localAnchorB.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rBX%20%2B%20tMat.col2.x%20*%20rBY%3B%0A%20%20%20%20%20%20rBY%20%3D%20tMat.col1.y%20*%20rBX%20%2B%20tMat.col2.y%20*%20rBY%3B%0A%20%20%20%20%20%20rBX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20Cdot1X%20%3D%20vB.x%20-%20wB%20*%20rBY%20-%20vA.x%20%2B%20wA%20*%20rAY%3B%0A%20%20%20%20%20%20var%20Cdot1Y%20%3D%20vB.y%20%2B%20wB%20*%20rBX%20-%20vA.y%20-%20wA%20*%20rAX%3B%0A%20%20%20%20%20%20var%20Cdot2%20%3D%20wB%20-%20wA%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.m_mass.Solve33(impulse%2C%20-Cdot1X%2C%20-Cdot1Y%2C%20-Cdot2)%3B%0A%20%20%20%20%20%20this.m_impulse.Add(impulse)%3B%0A%20%20%20%20%20%20vA.x%20-%3D%20mA%20*%20impulse.x%3B%0A%20%20%20%20%20%20vA.y%20-%3D%20mA%20*%20impulse.y%3B%0A%20%20%20%20%20%20wA%20-%3D%20iA%20*%20(rAX%20*%20impulse.y%20-%20rAY%20*%20impulse.x%20%2B%20impulse.z)%3B%0A%20%20%20%20%20%20vB.x%20%2B%3D%20mB%20*%20impulse.x%3B%0A%20%20%20%20%20%20vB.y%20%2B%3D%20mB%20*%20impulse.y%3B%0A%20%20%20%20%20%20wB%20%2B%3D%20iB%20*%20(rBX%20*%20impulse.y%20-%20rBY%20*%20impulse.x%20%2B%20impulse.z)%3B%0A%20%20%20%20%20%20bA.m_angularVelocity%20%3D%20wA%3B%0A%20%20%20%20%20%20bB.m_angularVelocity%20%3D%20wB%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJoint.prototype.SolvePositionConstraints%20%3D%20function%20(baumgarte)%20%7B%0A%20%20%20%20%20%20if%20(baumgarte%20%3D%3D%3D%20undefined)%20baumgarte%20%3D%200%3B%0A%20%20%20%20%20%20var%20tMat%3B%0A%20%20%20%20%20%20var%20tX%20%3D%200%3B%0A%20%20%20%20%20%20var%20bA%20%3D%20this.m_bodyA%3B%0A%20%20%20%20%20%20var%20bB%20%3D%20this.m_bodyB%3B%0A%20%20%20%20%20%20tMat%20%3D%20bA.m_xf.R%3B%0A%20%20%20%20%20%20var%20rAX%20%3D%20this.m_localAnchorA.x%20-%20bA.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rAY%20%3D%20this.m_localAnchorA.y%20-%20bA.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rAX%20%2B%20tMat.col2.x%20*%20rAY%3B%0A%20%20%20%20%20%20rAY%20%3D%20tMat.col1.y%20*%20rAX%20%2B%20tMat.col2.y%20*%20rAY%3B%0A%20%20%20%20%20%20rAX%20%3D%20tX%3B%0A%20%20%20%20%20%20tMat%20%3D%20bB.m_xf.R%3B%0A%20%20%20%20%20%20var%20rBX%20%3D%20this.m_localAnchorB.x%20-%20bB.m_sweep.localCenter.x%3B%0A%20%20%20%20%20%20var%20rBY%20%3D%20this.m_localAnchorB.y%20-%20bB.m_sweep.localCenter.y%3B%0A%20%20%20%20%20%20tX%20%3D%20tMat.col1.x%20*%20rBX%20%2B%20tMat.col2.x%20*%20rBY%3B%0A%20%20%20%20%20%20rBY%20%3D%20tMat.col1.y%20*%20rBX%20%2B%20tMat.col2.y%20*%20rBY%3B%0A%20%20%20%20%20%20rBX%20%3D%20tX%3B%0A%20%20%20%20%20%20var%20mA%20%3D%20bA.m_invMass%3B%0A%20%20%20%20%20%20var%20mB%20%3D%20bB.m_invMass%3B%0A%20%20%20%20%20%20var%20iA%20%3D%20bA.m_invI%3B%0A%20%20%20%20%20%20var%20iB%20%3D%20bB.m_invI%3B%0A%20%20%20%20%20%20var%20C1X%20%3D%20bB.m_sweep.c.x%20%2B%20rBX%20-%20bA.m_sweep.c.x%20-%20rAX%3B%0A%20%20%20%20%20%20var%20C1Y%20%3D%20bB.m_sweep.c.y%20%2B%20rBY%20-%20bA.m_sweep.c.y%20-%20rAY%3B%0A%20%20%20%20%20%20var%20C2%20%3D%20bB.m_sweep.a%20-%20bA.m_sweep.a%20-%20this.m_referenceAngle%3B%0A%20%20%20%20%20%20var%20k_allowedStretch%20%3D%2010.0%20*%20b2Settings.b2_linearSlop%3B%0A%20%20%20%20%20%20var%20positionError%20%3D%20Math.sqrt(C1X%20*%20C1X%20%2B%20C1Y%20*%20C1Y)%3B%0A%20%20%20%20%20%20var%20angularError%20%3D%20b2Math.Abs(C2)%3B%0A%20%20%20%20%20%20if%20(positionError%20%3E%20k_allowedStretch)%20%7B%0A%20%20%20%20%20%20%20%20iA%20*%3D%201.0%3B%0A%20%20%20%20%20%20%20%20iB%20*%3D%201.0%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20this.m_mass.col1.x%20%3D%20mA%20%2B%20mB%20%2B%20rAY%20*%20rAY%20*%20iA%20%2B%20rBY%20*%20rBY%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col2.x%20%3D%20-rAY%20*%20rAX%20*%20iA%20-%20rBY%20*%20rBX%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col3.x%20%3D%20-rAY%20*%20iA%20-%20rBY%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col1.y%20%3D%20this.m_mass.col2.x%3B%0A%20%20%20%20%20%20this.m_mass.col2.y%20%3D%20mA%20%2B%20mB%20%2B%20rAX%20*%20rAX%20*%20iA%20%2B%20rBX%20*%20rBX%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col3.y%20%3D%20rAX%20*%20iA%20%2B%20rBX%20*%20iB%3B%0A%20%20%20%20%20%20this.m_mass.col1.z%20%3D%20this.m_mass.col3.x%3B%0A%20%20%20%20%20%20this.m_mass.col2.z%20%3D%20this.m_mass.col3.y%3B%0A%20%20%20%20%20%20this.m_mass.col3.z%20%3D%20iA%20%2B%20iB%3B%0A%20%20%20%20%20%20var%20impulse%20%3D%20new%20b2Vec3()%3B%0A%20%20%20%20%20%20this.m_mass.Solve33(impulse%2C%20-C1X%2C%20-C1Y%2C%20-C2)%3B%0A%20%20%20%20%20%20bA.m_sweep.c.x%20-%3D%20mA%20*%20impulse.x%3B%0A%20%20%20%20%20%20bA.m_sweep.c.y%20-%3D%20mA%20*%20impulse.y%3B%0A%20%20%20%20%20%20bA.m_sweep.a%20-%3D%20iA%20*%20(rAX%20*%20impulse.y%20-%20rAY%20*%20impulse.x%20%2B%20impulse.z)%3B%0A%20%20%20%20%20%20bB.m_sweep.c.x%20%2B%3D%20mB%20*%20impulse.x%3B%0A%20%20%20%20%20%20bB.m_sweep.c.y%20%2B%3D%20mB%20*%20impulse.y%3B%0A%20%20%20%20%20%20bB.m_sweep.a%20%2B%3D%20iB%20*%20(rBX%20*%20impulse.y%20-%20rBY%20*%20impulse.x%20%2B%20impulse.z)%3B%0A%20%20%20%20%20%20bA.SynchronizeTransform()%3B%0A%20%20%20%20%20%20bB.SynchronizeTransform()%3B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20positionError%20%3C%3D%20b2Settings.b2_linearSlop%20%26%26%0A%20%20%20%20%20%20%20%20angularError%20%3C%3D%20b2Settings.b2_angularSlop%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20Box2D.inherit(b2WeldJointDef%2C%20Box2D.Dynamics.Joints.b2JointDef)%3B%0A%20%20%20%20b2WeldJointDef.prototype.__super%20%3D%20Box2D.Dynamics.Joints.b2JointDef.prototype%3B%0A%20%20%20%20b2WeldJointDef.b2WeldJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this%2C%20arguments)%3B%0A%20%20%20%20%20%20this.localAnchorA%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%20%20this.localAnchorB%20%3D%20new%20b2Vec2()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJointDef.prototype.b2WeldJointDef%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.__super.b2JointDef.call(this)%3B%0A%20%20%20%20%20%20this.type%20%3D%20b2Joint.e_weldJoint%3B%0A%20%20%20%20%20%20this.referenceAngle%20%3D%200.0%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2WeldJointDef.prototype.Initialize%20%3D%20function%20(bA%2C%20bB%2C%20anchor)%20%7B%0A%20%20%20%20%20%20this.bodyA%20%3D%20bA%3B%0A%20%20%20%20%20%20this.bodyB%20%3D%20bB%3B%0A%20%20%20%20%20%20this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchor))%3B%0A%20%20%20%20%20%20this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchor))%3B%0A%20%20%20%20%20%20this.referenceAngle%20%3D%20this.bodyB.GetAngle()%20-%20this.bodyA.GetAngle()%3B%0A%20%20%20%20%7D%3B%0A%20%20%7D)()%3B%0A%20%20(function%20()%20%7B%0A%20%20%20%20var%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%3B%0A%20%20%20%20b2DebugDraw.b2DebugDraw%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_drawScale%20%3D%201.0%3B%0A%20%20%20%20%20%20this.m_lineThickness%20%3D%201.0%3B%0A%20%20%20%20%20%20this.m_alpha%20%3D%201.0%3B%0A%20%20%20%20%20%20this.m_fillAlpha%20%3D%201.0%3B%0A%20%20%20%20%20%20this.m_xformScale%20%3D%201.0%3B%0A%20%20%20%20%20%20var%20__this%20%3D%20this%3B%0A%20%20%20%20%20%20%2F%2F%23WORKAROUND%0A%20%20%20%20%20%20this.m_sprite%20%3D%20%7B%0A%20%20%20%20%20%20%20%20graphics%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20clear%3A%20function%20()%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20__this.m_ctx.clearRect(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20__this.m_ctx.canvas.width%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20__this.m_ctx.canvas.height%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype._color%20%3D%20function%20(color%2C%20alpha)%20%7B%0A%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%22rgba(%22%20%2B%0A%20%20%20%20%20%20%20%20((color%20%26%200xff0000)%20%3E%3E%2016)%20%2B%0A%20%20%20%20%20%20%20%20%22%2C%22%20%2B%0A%20%20%20%20%20%20%20%20((color%20%26%200xff00)%20%3E%3E%208)%20%2B%0A%20%20%20%20%20%20%20%20%22%2C%22%20%2B%0A%20%20%20%20%20%20%20%20(color%20%26%200xff)%20%2B%0A%20%20%20%20%20%20%20%20%22%2C%22%20%2B%0A%20%20%20%20%20%20%20%20alpha%20%2B%0A%20%20%20%20%20%20%20%20%22)%22%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.b2DebugDraw%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20this.m_drawFlags%20%3D%200%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetFlags%20%3D%20function%20(flags)%20%7B%0A%20%20%20%20%20%20if%20(flags%20%3D%3D%3D%20undefined)%20flags%20%3D%200%3B%0A%20%20%20%20%20%20this.m_drawFlags%20%3D%20flags%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetFlags%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_drawFlags%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.AppendFlags%20%3D%20function%20(flags)%20%7B%0A%20%20%20%20%20%20if%20(flags%20%3D%3D%3D%20undefined)%20flags%20%3D%200%3B%0A%20%20%20%20%20%20this.m_drawFlags%20%7C%3D%20flags%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.ClearFlags%20%3D%20function%20(flags)%20%7B%0A%20%20%20%20%20%20if%20(flags%20%3D%3D%3D%20undefined)%20flags%20%3D%200%3B%0A%20%20%20%20%20%20this.m_drawFlags%20%26%3D%20~flags%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetSprite%20%3D%20function%20(sprite)%20%7B%0A%20%20%20%20%20%20this.m_ctx%20%3D%20sprite%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetSprite%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_ctx%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetDrawScale%20%3D%20function%20(drawScale)%20%7B%0A%20%20%20%20%20%20if%20(drawScale%20%3D%3D%3D%20undefined)%20drawScale%20%3D%200%3B%0A%20%20%20%20%20%20this.m_drawScale%20%3D%20drawScale%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetDrawScale%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_drawScale%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetLineThickness%20%3D%20function%20(lineThickness)%20%7B%0A%20%20%20%20%20%20if%20(lineThickness%20%3D%3D%3D%20undefined)%20lineThickness%20%3D%200%3B%0A%20%20%20%20%20%20this.m_lineThickness%20%3D%20lineThickness%3B%0A%20%20%20%20%20%20this.m_ctx.strokeWidth%20%3D%20lineThickness%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetLineThickness%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_lineThickness%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetAlpha%20%3D%20function%20(alpha)%20%7B%0A%20%20%20%20%20%20if%20(alpha%20%3D%3D%3D%20undefined)%20alpha%20%3D%200%3B%0A%20%20%20%20%20%20this.m_alpha%20%3D%20alpha%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetAlpha%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_alpha%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetFillAlpha%20%3D%20function%20(alpha)%20%7B%0A%20%20%20%20%20%20if%20(alpha%20%3D%3D%3D%20undefined)%20alpha%20%3D%200%3B%0A%20%20%20%20%20%20this.m_fillAlpha%20%3D%20alpha%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetFillAlpha%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_fillAlpha%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.SetXFormScale%20%3D%20function%20(xformScale)%20%7B%0A%20%20%20%20%20%20if%20(xformScale%20%3D%3D%3D%20undefined)%20xformScale%20%3D%200%3B%0A%20%20%20%20%20%20this.m_xformScale%20%3D%20xformScale%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.GetXFormScale%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20return%20this.m_xformScale%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawPolygon%20%3D%20function%20(vertices%2C%20vertexCount%2C%20color)%20%7B%0A%20%20%20%20%20%20if%20(!vertexCount)%20return%3B%0A%20%20%20%20%20%20var%20s%20%3D%20this.m_ctx%3B%0A%20%20%20%20%20%20var%20drawScale%20%3D%20this.m_drawScale%3B%0A%20%20%20%20%20%20s.beginPath()%3B%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(color.color%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.moveTo(vertices%5B0%5D.x%20*%20drawScale%2C%20vertices%5B0%5D.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20vertexCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20s.lineTo(vertices%5Bi%5D.x%20*%20drawScale%2C%20vertices%5Bi%5D.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20s.lineTo(vertices%5B0%5D.x%20*%20drawScale%2C%20vertices%5B0%5D.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20s.closePath()%3B%0A%20%20%20%20%20%20s.stroke()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawSolidPolygon%20%3D%20function%20(%0A%20%20%20%20%20%20vertices%2C%0A%20%20%20%20%20%20vertexCount%2C%0A%20%20%20%20%20%20color%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(!vertexCount)%20return%3B%0A%20%20%20%20%20%20var%20s%20%3D%20this.m_ctx%3B%0A%20%20%20%20%20%20var%20drawScale%20%3D%20this.m_drawScale%3B%0A%20%20%20%20%20%20s.beginPath()%3B%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(color.color%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.fillStyle%20%3D%20this._color(color.color%2C%20this.m_fillAlpha)%3B%0A%20%20%20%20%20%20s.moveTo(vertices%5B0%5D.x%20*%20drawScale%2C%20vertices%5B0%5D.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20for%20(var%20i%20%3D%201%3B%20i%20%3C%20vertexCount%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20s.lineTo(vertices%5Bi%5D.x%20*%20drawScale%2C%20vertices%5Bi%5D.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20s.lineTo(vertices%5B0%5D.x%20*%20drawScale%2C%20vertices%5B0%5D.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20s.closePath()%3B%0A%20%20%20%20%20%20s.fill()%3B%0A%20%20%20%20%20%20s.stroke()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawCircle%20%3D%20function%20(center%2C%20radius%2C%20color)%20%7B%0A%20%20%20%20%20%20if%20(!radius)%20return%3B%0A%20%20%20%20%20%20var%20s%20%3D%20this.m_ctx%3B%0A%20%20%20%20%20%20var%20drawScale%20%3D%20this.m_drawScale%3B%0A%20%20%20%20%20%20s.beginPath()%3B%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(color.color%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.arc(%0A%20%20%20%20%20%20%20%20center.x%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%20center.y%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%20radius%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20Math.PI%20*%202%2C%0A%20%20%20%20%20%20%20%20true%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20s.closePath()%3B%0A%20%20%20%20%20%20s.stroke()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawSolidCircle%20%3D%20function%20(%0A%20%20%20%20%20%20center%2C%0A%20%20%20%20%20%20radius%2C%0A%20%20%20%20%20%20axis%2C%0A%20%20%20%20%20%20color%0A%20%20%20%20)%20%7B%0A%20%20%20%20%20%20if%20(!radius)%20return%3B%0A%20%20%20%20%20%20var%20s%20%3D%20this.m_ctx%2C%0A%20%20%20%20%20%20%20%20drawScale%20%3D%20this.m_drawScale%2C%0A%20%20%20%20%20%20%20%20cx%20%3D%20center.x%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%20cy%20%3D%20center.y%20*%20drawScale%3B%0A%20%20%20%20%20%20s.moveTo(0%2C%200)%3B%0A%20%20%20%20%20%20s.beginPath()%3B%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(color.color%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.fillStyle%20%3D%20this._color(color.color%2C%20this.m_fillAlpha)%3B%0A%20%20%20%20%20%20s.arc(cx%2C%20cy%2C%20radius%20*%20drawScale%2C%200%2C%20Math.PI%20*%202%2C%20true)%3B%0A%20%20%20%20%20%20s.moveTo(cx%2C%20cy)%3B%0A%20%20%20%20%20%20s.lineTo(%0A%20%20%20%20%20%20%20%20(center.x%20%2B%20axis.x%20*%20radius)%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%20(center.y%20%2B%20axis.y%20*%20radius)%20*%20drawScale%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20s.closePath()%3B%0A%20%20%20%20%20%20s.fill()%3B%0A%20%20%20%20%20%20s.stroke()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawSegment%20%3D%20function%20(p1%2C%20p2%2C%20color)%20%7B%0A%20%20%20%20%20%20var%20s%20%3D%20this.m_ctx%2C%0A%20%20%20%20%20%20%20%20drawScale%20%3D%20this.m_drawScale%3B%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(color.color%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.beginPath()%3B%0A%20%20%20%20%20%20s.moveTo(p1.x%20*%20drawScale%2C%20p1.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20s.lineTo(p2.x%20*%20drawScale%2C%20p2.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20s.closePath()%3B%0A%20%20%20%20%20%20s.stroke()%3B%0A%20%20%20%20%7D%3B%0A%20%20%20%20b2DebugDraw.prototype.DrawTransform%20%3D%20function%20(xf)%20%7B%0A%20%20%20%20%20%20var%20s%20%3D%20this.m_ctx%2C%0A%20%20%20%20%20%20%20%20drawScale%20%3D%20this.m_drawScale%3B%0A%20%20%20%20%20%20s.beginPath()%3B%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(0xff0000%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.moveTo(xf.position.x%20*%20drawScale%2C%20xf.position.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20s.lineTo(%0A%20%20%20%20%20%20%20%20(xf.position.x%20%2B%20this.m_xformScale%20*%20xf.R.col1.x)%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%20(xf.position.y%20%2B%20this.m_xformScale%20*%20xf.R.col1.y)%20*%20drawScale%0A%20%20%20%20%20%20)%3B%0A%0A%20%20%20%20%20%20s.strokeStyle%20%3D%20this._color(0xff00%2C%20this.m_alpha)%3B%0A%20%20%20%20%20%20s.moveTo(xf.position.x%20*%20drawScale%2C%20xf.position.y%20*%20drawScale)%3B%0A%20%20%20%20%20%20s.lineTo(%0A%20%20%20%20%20%20%20%20(xf.position.x%20%2B%20this.m_xformScale%20*%20xf.R.col2.x)%20*%20drawScale%2C%0A%20%20%20%20%20%20%20%20(xf.position.y%20%2B%20this.m_xformScale%20*%20xf.R.col2.y)%20*%20drawScale%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20s.closePath()%3B%0A%20%20%20%20%20%20s.stroke()%3B%0A%20%20%20%20%7D%3B%0A%20%20%7D)()%3B%0A%20%20var%20i%3B%0A%20%20for%20(i%20%3D%200%3B%20i%20%3C%20Box2D.postDefs.length%3B%20%2B%2Bi)%20Box2D.postDefs%5Bi%5D()%3B%0A%0A%20%20const%20ArgumentType%20%3D%20Scratch.ArgumentType%3B%0A%20%20const%20BlockType%20%3D%20Scratch.BlockType%3B%0A%20%20%2F%2F%20const%20MathUtil%20%3D%20require('..%2F..%2Futil%2Fmath-util')%3B%0A%20%20%2F%2F%20const%20Clone%20%3D%20require('..%2F..%2Futil%2Fclone')%3B%0A%20%20const%20Cast%20%3D%20%7B%0A%20%20%20%20toNumber%3A%20(n)%20%3D%3E%20%2Bn%20%7C%7C%200%2C%0A%20%20%7D%3B%0A%20%20%2F%2F%20const%20Cast%20%3D%20require('..%2F..%2Futil%2Fcast')%3B%0A%20%20%2F%2F%20const%20Runtime%20%3D%20require('..%2F..%2Fengine%2Fruntime')%3B%0A%20%20%2F%2F%20const%20RenderedTarget%20%3D%20require('..%2F..%2Fsprites%2Frendered-target')%3B%0A%20%20%2F%2F%20const%20formatMessage%20%3D%20require('format-message')%3B%0A%20%20const%20formatMessage%20%3D%20(obj)%20%3D%3E%20obj.default%3B%0A%20%20%2F%2F%20const%20MathUtil%20%3D%20require('..%2F..%2Futil%2Fmath-util')%3B%0A%20%20%2F%2F%20const%20Timer%20%3D%20require('..%2F..%2Futil%2Ftimer')%3B%0A%20%20%2F%2F%20const%20Matter%20%3D%20require('matterJs%2Fmatter')%3B%0A%20%20%2F%2F%20const%20Matter%20%3D%20require('matter-js')%3B%0A%20%20const%20ROTATION_STYLE_ALL_AROUND%20%3D%20%22all%20around%22%3B%0A%0A%20%20%2F%2F%20const%20Box2D%20%3D%20require('.%2FBox2d.min').box2d%3B%0A%0A%20%20%2F%2F%20window.decomp%20%3D%20require('poly-decomp')%3B%0A%0A%20%20const%20b2World%20%3D%20Box2D.Dynamics.b2World%3B%0A%20%20const%20b2Vec2%20%3D%20Box2D.Common.Math.b2Vec2%3B%0A%20%20const%20b2AABB%20%3D%20Box2D.Collision.b2AABB%3B%0A%20%20const%20b2BodyDef%20%3D%20Box2D.Dynamics.b2BodyDef%3B%0A%20%20const%20b2Body%20%3D%20Box2D.Dynamics.b2Body%3B%0A%20%20const%20b2FixtureDef%20%3D%20Box2D.Dynamics.b2FixtureDef%3B%0A%20%20%2F%2F%20const%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%3B%0A%20%20%2F%2F%20const%20b2Fixture%20%3D%20Box2D.Dynamics.b2Fixture%3B%0A%20%20const%20b2Contact%20%3D%20Box2D.Dynamics.Contacts.b2Contact%3B%0A%20%20%2F%2F%20const%20b2MassData%20%3D%20Box2D.Collision.Shapes.b2MassData%3B%0A%20%20const%20b2PolygonShape%20%3D%20Box2D.Collision.Shapes.b2PolygonShape%3B%0A%20%20const%20b2CircleShape%20%3D%20Box2D.Collision.Shapes.b2CircleShape%3B%0A%20%20%2F%2F%20const%20b2DebugDraw%20%3D%20Box2D.Dynamics.b2DebugDraw%3B%0A%20%20const%20b2MouseJointDef%20%3D%20Box2D.Dynamics.Joints.b2MouseJointDef%3B%0A%20%20const%20b2Math%20%3D%20Box2D.Common.Math.b2Math%3B%0A%0A%20%20let%20world%3B%0A%20%20let%20zoom%3B%0A%0A%20%20const%20fixDef%20%3D%20new%20b2FixtureDef()%3B%0A%20%20const%20bodyDef%20%3D%20new%20b2BodyDef()%3B%0A%0A%20%20%2F%2F%20const%20uid_seq%20%3D%200%3B%0A%20%20%2F%2F%20let%20ujidSeq%20%3D%200%3B%0A%0A%20%20const%20prevPos%20%3D%20%7B%7D%3B%0A%20%20%2F**%0A%20%20*%20Active%20b2Body%2Fs%20in%20the%20world.%0A%20%20*%20%40type%20%7BObject.%3Cstring%2C*%3E%7D%0A%20%20*%2F%0A%20%20const%20bodies%20%3D%20%7B%7D%3B%0A%20%20%2F%2F%20const%20joints%20%3D%20%7B%7D%3B%0A%20%20const%20pinned%20%3D%20%7B%7D%3B%20%2F%2F%20Map%20of%20IDs%20to%20pinned%20joints%0A%20%20%2F**%0A%20%20*%20The%20runtime%20instantiating%20this%20block%20package.%0A%20%20*%20%40type%20%7BArray%7D%0A%20%20*%2F%0A%20%20const%20stageBodies%20%3D%20%5B%5D%3B%0A%0A%20%20%2F%2F%20const%20categorySeq%20%3D%201%3B%0A%20%20%2F%2F%20const%20categories%20%3D%20%7Bdefault%3A%201%7D%3B%0A%0A%20%20const%20bodyCategoryBits%20%3D%201%3B%0A%20%20const%20bodyMaskBits%20%3D%201%3B%0A%20%20%2F%2F%20const%20noCollideSeq%20%3D%200%3B%0A%0A%20%20const%20toRad%20%3D%20Math.PI%20%2F%20180%3B%0A%0A%20%20%2F%2F%20Used%20to%20record%20the%20scroll%20position%20of%20all%20sprites%0A%20%20const%20_scroll%20%3D%20new%20b2Vec2(0%2C%200)%3B%0A%0A%20%20const%20STAGE_TYPE_OPTIONS%20%3D%20%7B%0A%20%20%20%20BOXED%3A%20%22boxed%22%2C%0A%20%20%20%20FLOOR%3A%20%22floor%22%2C%0A%20%20%20%20OPEN%3A%20%22open%22%2C%0A%20%20%7D%3B%0A%0A%20%20const%20SPACE_TYPE_OPTIONS%20%3D%20%7B%0A%20%20%20%20WORLD%3A%20%22world%22%2C%0A%20%20%20%20STAGE%3A%20%22stage%22%2C%0A%20%20%20%20RELATIVE%3A%20%22relative%22%2C%0A%20%20%7D%3B%0A%0A%20%20const%20WHERE_TYPE_OPTIONS%20%3D%20%7B%0A%20%20%20%20ANY%3A%20%22any%22%2C%0A%20%20%20%20FEET%3A%20%22feet%22%2C%0A%20%20%7D%3B%0A%0A%20%20const%20SHAPE_TYPE_OPTIONS%20%3D%20%7B%0A%20%20%20%20COSTUME%3A%20%22costume%22%2C%0A%20%20%20%20CIRCLE%3A%20%22circle%22%2C%0A%20%20%20%20SVG_POLYGON%3A%20%22svg%22%2C%0A%20%20%20%20ALL%3A%20%22all%22%2C%0A%20%20%7D%3B%0A%0A%20%20const%20_definePolyFromHull%20%3D%20function%20(hullPoints)%20%7B%0A%20%20%20%20fixDef.shape%20%3D%20new%20b2PolygonShape()%3B%0A%0A%20%20%20%20const%20vertices%20%3D%20%5B%5D%3B%0A%0A%20%20%20%20let%20prev%20%3D%20null%3B%0A%20%20%20%20for%20(let%20i%20%3D%20hullPoints.length%20-%201%3B%20i%20%3E%3D%200%3B%20i--)%20%7B%0A%20%20%20%20%20%20%2F%2F%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20hullPoints.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20const%20b2Vec%20%3D%20new%20b2Vec2(hullPoints%5Bi%5D.x%20%2F%20zoom%2C%20hullPoints%5Bi%5D.y%20%2F%20zoom)%3B%0A%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20prev%20!%3D%3D%20null%20%26%26%0A%20%20%20%20%20%20%20%20b2Math.SubtractVV(b2Vec%2C%20prev).LengthSquared()%20%3E%20Number.MIN_VALUE%0A%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20vertices.push(b2Vec)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20prev%20%3D%20b2Vec%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20fixDef.shape.SetAsArray(vertices)%3B%0A%20%20%7D%3B%0A%0A%20%20const%20_placeBody%20%3D%20function%20(id%2C%20x%2C%20y%2C%20dir)%20%7B%0A%20%20%20%20if%20(bodies%5Bid%5D)%20%7B%0A%20%20%20%20%20%20world.DestroyBody(bodies%5Bid%5D)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20fixDef.filter.categoryBits%20%3D%20bodyCategoryBits%3B%0A%20%20%20%20fixDef.filter.maskBits%20%3D%20bodyMaskBits%3B%0A%0A%20%20%20%20bodyDef.position.x%20%3D%20(x%20%2B%20_scroll.x)%20%2F%20zoom%3B%0A%20%20%20%20bodyDef.position.y%20%3D%20(y%20%2B%20_scroll.y)%20%2F%20zoom%3B%0A%20%20%20%20bodyDef.angle%20%3D%20(90%20-%20dir)%20*%20toRad%3B%0A%0A%20%20%20%20const%20body%20%3D%20world.CreateBody(bodyDef)%3B%0A%20%20%20%20body.uid%20%3D%20id%3B%0A%20%20%20%20body.CreateFixture(fixDef)%3B%0A%20%20%20%20bodies%5Bid%5D%20%3D%20body%3B%0A%20%20%20%20return%20body%3B%0A%20%20%7D%3B%0A%0A%20%20const%20_applyForce%20%3D%20function%20(id%2C%20ftype%2C%20x%2C%20y%2C%20dir%2C%20pow)%20%7B%0A%20%20%20%20const%20body%20%3D%20bodies%5Bid%5D%3B%0A%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20dir%20%3D%20(90%20-%20dir)%20*%20toRad%3B%0A%0A%20%20%20%20if%20(ftype%20%3D%3D%3D%20%22Impulse%22)%20%7B%0A%20%20%20%20%20%20const%20center%20%3D%20body.GetLocalCenter()%3B%20%2F%2F%20get%20the%20mass%20data%20from%20you%20body%0A%0A%20%20%20%20%20%20body.ApplyImpulse(%0A%20%20%20%20%20%20%20%20%7B%20x%3A%20pow%20*%20Math.cos(dir)%2C%20y%3A%20pow%20*%20Math.sin(dir)%20%7D%2C%0A%20%20%20%20%20%20%20%20body.GetWorldPoint(%7B%20x%3A%20x%20%2F%20zoom%20%2B%20center.x%2C%20y%3A%20y%20%2F%20zoom%20%2B%20center.y%20%7D)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%20else%20if%20(ftype%20%3D%3D%3D%20%22World%20Impulse%22)%20%7B%0A%20%20%20%20%20%20body.ApplyForce(%0A%20%20%20%20%20%20%20%20%7B%20x%3A%20pow%20*%20Math.cos(dir)%2C%20y%3A%20pow%20*%20Math.sin(dir)%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20x%3A%20x%20%2F%20zoom%2C%20y%3A%20y%20%2F%20zoom%20%7D%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%0A%20%20%2F%2F%20%5B''%2C%20'Define%20Spring%20Length%3A%20%25n%20Damping%3A%20%25n%20%20Freq%3A%20%25n'%2C%20'_defineSpring'%2C%20100%2C%200.5%2C%208%5D%2C%0A%20%20const%20defSpring%20%3D%20%7B%20len%3A%20100%2C%20damp%3A%200.7%2C%20freq%3A%205%20%7D%3B%0A%20%20const%20_defineSpring%20%3D%20function%20(len%2C%20damp%2C%20freq)%20%7B%0A%20%20%20%20defSpring.len%20%3D%20len%20%3C%200.1%20%3F%200.1%20%3A%20len%20%2F%20zoom%3B%0A%20%20%20%20defSpring.damp%20%3D%20damp%20%3C%200%20%3F%200.7%20%3A%20damp%3B%0A%20%20%20%20defSpring.freq%20%3D%20freq%20%3E%200%20%3F%20freq%20%3A%205%3B%0A%20%20%7D%3B%0A%0A%20%20const%20_createJointOfType%20%3D%20function%20(%0A%20%20%20%20jName%2C%0A%20%20%20%20typ%2C%0A%20%20%20%20bodyID%2C%0A%20%20%20%20x%2C%0A%20%20%20%20y%2C%0A%20%20%20%20bodyID2%2C%0A%20%20%20%20x2%2C%0A%20%20%20%20y2%0A%20%20)%20%7B%0A%20%20%20%20%2F%2F%20if%20(jName.length%20%3E%200)%20ext.destroyJoint(jName)%3B%0A%0A%20%20%20%20if%20(!bodyID)%20bodyID%20%3D%20null%3B%0A%20%20%20%20if%20(!bodyID2)%20bodyID2%20%3D%20null%3B%0A%20%20%20%20if%20(!bodyID%20%26%26%20!bodyID2)%20%7B%0A%20%20%20%20%20%20return%20null%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20const%20body%20%3D%20bodyID%20%3F%20bodies%5BbodyID%5D%20%3A%20world.GetGroundBody()%3B%0A%20%20%20%20const%20body2%20%3D%20bodyID2%20%3F%20bodies%5BbodyID2%5D%20%3A%20world.GetGroundBody()%3B%0A%0A%20%20%20%20if%20(!body%20%7C%7C%20!body2)%20return%20null%3B%0A%0A%20%20%20%20let%20md%3B%0A%20%20%20%20switch%20(typ)%20%7B%0A%20%20%20%20%20%20case%20%22Spring%22%3A%0A%20%20%20%20%20%20%20%20md%20%3D%20new%20Box2D.Dynamics.Joints.b2DistanceJointDef()%3B%0A%20%20%20%20%20%20%20%20md.length%20%3D%20defSpring.len%3B%0A%20%20%20%20%20%20%20%20md.dampingRatio%20%3D%20defSpring.damp%3B%0A%20%20%20%20%20%20%20%20md.frequencyHz%20%3D%20defSpring.freq%3B%0A%20%20%20%20%20%20%20%20md.bodyA%20%3D%20body%3B%0A%20%20%20%20%20%20%20%20md.bodyB%20%3D%20body2%3B%0A%20%20%20%20%20%20%20%20md.localAnchorA%20%3D%20%7B%20x%3A%20x%20%2F%20zoom%2C%20y%3A%20y%20%2F%20zoom%20%7D%3B%0A%20%20%20%20%20%20%20%20md.localAnchorB%20%3D%20%7B%20x%3A%20x2%20%2F%20zoom%2C%20y%3A%20y2%20%2F%20zoom%20%7D%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20case%20%22Rotating%22%3A%0A%20%20%20%20%20%20%20%20md%20%3D%20new%20Box2D.Dynamics.Joints.b2RevoluteJointDef()%3B%0A%20%20%20%20%20%20%20%20md.bodyA%20%3D%20body%3B%0A%20%20%20%20%20%20%20%20md.bodyB%20%3D%20body2%3B%0A%20%20%20%20%20%20%20%20md.localAnchorA%20%3D%20%7B%20x%3A%20x%20%2F%20zoom%2C%20y%3A%20y%20%2F%20zoom%20%7D%3B%0A%20%20%20%20%20%20%20%20if%20(x2%20%3D%3D%3D%20null)%20%7B%0A%20%20%20%20%20%20%20%20%20%20if%20(body2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20md.localAnchorB%20%3D%20body2.GetLocalPoint(body.GetPosition())%3B%20%2F%2F%20Wheel%20Type%20Joint...%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20md.localAnchorB%20%3D%20body.GetWorldPoint(%7B%20x%3A%20x%20%2F%20zoom%2C%20y%3A%20y%20%2F%20zoom%20%7D)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20md.localAnchorB%20%3D%20%7B%20x%3A%20x2%20%2F%20zoom%2C%20y%3A%20y2%20%2F%20zoom%20%7D%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20break%3B%0A%0A%20%20%20%20%20%20case%20%22Mouse%22%3A%0A%20%20%20%20%20%20%20%20md%20%3D%20new%20b2MouseJointDef()%3B%0A%20%20%20%20%20%20%20%20if%20(bodyID)%20%7B%0A%20%20%20%20%20%20%20%20%20%20md.bodyB%20%3D%20body%3B%0A%20%20%20%20%20%20%20%20%20%20md.target.Set(x%20%2F%20zoom%2C%20y%20%2F%20zoom)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20md.bodyB%20%3D%20body2%3B%0A%20%20%20%20%20%20%20%20%20%20md.target.Set(x2%20%2F%20zoom%2C%20y2%20%2F%20zoom)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20md.bodyA%20%3D%20world.GetGroundBody()%3B%0A%20%20%20%20%20%20%20%20md.collideConnected%20%3D%20true%3B%0A%20%20%20%20%20%20%20%20md.maxForce%20%3D%20300.0%20*%20body.GetMass()%3B%0A%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20md.collideConnected%20%3D%20true%3B%0A%20%20%20%20%2F%2F%20md.maxForce%20%3D%20300.0%20*%20body.GetMass()%3B%0A%20%20%20%20const%20joint%20%3D%20world.CreateJoint(md)%3B%0A%20%20%20%20if%20(bodyID)%20%7B%0A%20%20%20%20%20%20body.SetAwake(true)%3B%0A%20%20%20%20%7D%0A%20%20%20%20if%20(bodyID2)%20%7B%0A%20%20%20%20%20%20body2.SetAwake(true)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20if%20(!jName)%20%7B%0A%20%20%20%20%2F%2F%20%20%20%20%20ujidSeq%2B%2B%3B%0A%20%20%20%20%2F%2F%20%20%20%20%20jName%20%3D%20%60_%24%7BujidSeq%7D%60%3B%0A%20%20%20%20%2F%2F%20%7D%0A%20%20%20%20%2F%2F%20joints%5BjName%5D%20%3D%20joint%3B%0A%20%20%20%20return%20joint%3B%0A%20%20%7D%3B%0A%0A%20%20%2F**%0A%20%20*%20Set%20the%20X%20and%20Y%20coordinates%20(No%20Fencing)%0A%20%20*%20%40param%20%7B!RenderedTarget%7D%20rt%20the%20renderedTarget.%0A%20%20*%20%40param%20%7B!number%7D%20x%20New%20X%20coordinate%2C%20in%20Scratch%20coordinates.%0A%20%20*%20%40param%20%7B!number%7D%20y%20New%20Y%20coordinate%2C%20in%20Scratch%20coordinates.%0A%20%20*%20%40param%20%7B%3Fboolean%7D%20force%20Force%20setting%20X%2FY%2C%20in%20case%20of%20dragging%0A%20%20*%2F%0A%20%20const%20_setXY%20%3D%20function%20(rt%2C%20x%2C%20y%2C%20force)%20%7B%0A%20%20%20%20if%20(rt.isStage)%20return%3B%0A%20%20%20%20if%20(rt.dragging%20%26%26%20!force)%20return%3B%0A%20%20%20%20const%20oldX%20%3D%20rt.x%3B%0A%20%20%20%20const%20oldY%20%3D%20rt.y%3B%0A%20%20%20%20if%20(rt.renderer)%20%7B%0A%20%20%20%20%20%20%2F%2F%20const%20position%20%3D%20rt.renderer.getFencedPositionOfDrawable(rt.drawableID%2C%20%5Bx%2C%20y%5D)%3B%0A%20%20%20%20%20%20rt.x%20%3D%20x%3B%20%2F%2F%20position%5B0%5D%3B%0A%20%20%20%20%20%20rt.y%20%3D%20y%3B%20%2F%2F%20position%5B1%5D%3B%0A%0A%20%20%20%20%20%20rt.renderer.updateDrawableProperties(rt.drawableID%2C%20%7B%0A%20%20%20%20%20%20%20%20position%3A%20%5Bx%2C%20y%5D%2C%0A%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20if%20(rt.visible)%20%7B%0A%20%20%20%20%20%20%20%20rt.emit(%22EVENT_TARGET_VISUAL_CHANGE%22%2C%20rt)%3B%0A%20%20%20%20%20%20%20%20rt.runtime.requestRedraw()%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20rt.x%20%3D%20x%3B%0A%20%20%20%20%20%20rt.y%20%3D%20y%3B%0A%20%20%20%20%7D%0A%20%20%20%20rt.emit(%22EVENT_TARGET_MOVED%22%2C%20rt%2C%20oldX%2C%20oldY%2C%20force)%3B%0A%20%20%20%20rt.runtime.requestTargetsUpdate(rt)%3B%0A%20%20%7D%3B%0A%0A%20%20const%20createStageBody%20%3D%20function%20()%20%7B%0A%20%20%20%20const%20body%20%3D%20world.CreateBody(bodyDef)%3B%0A%20%20%20%20body.CreateFixture(fixDef)%3B%0A%20%20%20%20stageBodies.push(body)%3B%0A%20%20%7D%3B%0A%0A%20%20const%20_setStageType%20%3D%20function%20(type)%20%7B%0A%20%20%20%20%2F%2F%20Clear%20down%20previous%20stage%0A%20%20%20%20if%20(stageBodies.length%20%3E%200)%20%7B%0A%20%20%20%20%20%20for%20(const%20stageBodyID%20in%20stageBodies)%20%7B%0A%20%20%20%20%20%20%20%20world.DestroyBody(stageBodies%5BstageBodyID%5D)%3B%0A%20%20%20%20%20%20%20%20delete%20stageBodies%5BstageBodyID%5D%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20Build%20up%20new%20stage%0A%20%20%20%20bodyDef.type%20%3D%20b2Body.b2_staticBody%3B%0A%20%20%20%20fixDef.shape%20%3D%20new%20b2PolygonShape()%3B%0A%20%20%20%20bodyDef.angle%20%3D%200%3B%0A%0A%20%20%20%20if%20(type%20%3D%3D%3D%20STAGE_TYPE_OPTIONS.BOXED)%20%7B%0A%20%20%20%20%20%20fixDef.shape.SetAsBox(250%20%2F%20zoom%2C%2010%20%2F%20zoom)%3B%0A%20%20%20%20%20%20bodyDef.position.Set(0%2C%20-190%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20bodyDef.position.Set(0%2C%201000%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20fixDef.shape.SetAsBox(10%20%2F%20zoom%2C%20800%20%2F%20zoom)%3B%0A%20%20%20%20%20%20bodyDef.position.Set(-250%20%2F%20zoom%2C%20540%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20bodyDef.position.Set(250%20%2F%20zoom%2C%20540%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%7D%20else%20if%20(type%20%3D%3D%3D%20STAGE_TYPE_OPTIONS.FLOOR)%20%7B%0A%20%20%20%20%20%20fixDef.shape.SetAsBox(5000%20%2F%20zoom%2C%20100%20%2F%20zoom)%3B%0A%20%20%20%20%20%20bodyDef.position.Set(0%2C%20-280%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20bodyDef.position.Set(-10000%2C%20-280%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20bodyDef.position.Set(10000%2C%20-280%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20bodyDef.position.Set(-20000%2C%20-280%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%20%20bodyDef.position.Set(20000%2C%20-280%20%2F%20zoom)%3B%0A%20%20%20%20%20%20createStageBody()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20bodyDef.type%20%3D%20b2Body.b2_dynamicBody%3B%0A%0A%20%20%20%20for%20(const%20bodyID%20in%20bodies)%20%7B%0A%20%20%20%20%20%20bodies%5BbodyID%5D.SetAwake(true)%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%0A%20%20const%20blockIconURI%20%3D%20%22data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB2ZXJzaW9uPSIxLjEiDQoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOmE9Imh0dHA6Ly9ucy5hZG9iZS5jb20vQWRvYmVTVkdWaWV3ZXJFeHRlbnNpb25zLzMuMC8iDQoJIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSItMy43IC0zLjcgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgLTMuNyAtMy43IDQwIDQwIg0KCSB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iOC45IiB5PSIxLjUiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzE2OUZCMCIgc3Ryb2tlLXdpZHRoPSIzIiB3aWR0aD0iMTQuOCIgaGVpZ2h0PSIxNC44Ii8%2BDQo8cmVjdCB4PSIxLjUiIHk9IjE2LjMiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzE2OUZCMCIgc3Ryb2tlLXdpZHRoPSIzIiB3aWR0aD0iMTQuOCIgaGVpZ2h0PSIxNC44Ii8%2BDQo8cmVjdCB4PSIxNi4zIiB5PSIxNi4zIiBmaWxsPSIjRkZGRkZGIiBzdHJva2U9IiMxNjlGQjAiIHN0cm9rZS13aWR0aD0iMyIgd2lkdGg9IjE0LjgiIGhlaWdodD0iMTQuOCIvPg0KPC9zdmc%2B%22%3B%0A%20%20const%20menuIconURI%20%3D%20%22data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB2ZXJzaW9uPSIxLjEiDQoJIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOmE9Imh0dHA6Ly9ucy5hZG9iZS5jb20vQWRvYmVTVkdWaWV3ZXJFeHRlbnNpb25zLzMuMC8iDQoJIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSItMy43IC0zLjcgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgLTMuNyAtMy43IDQwIDQwIg0KCSB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iOC45IiB5PSIxLjUiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzE2OUZCMCIgc3Ryb2tlLXdpZHRoPSIzIiB3aWR0aD0iMTQuOCIgaGVpZ2h0PSIxNC44Ii8%2BDQo8cmVjdCB4PSIxLjUiIHk9IjE2LjMiIGZpbGw9IiNGRkZGRkYiIHN0cm9rZT0iIzE2OUZCMCIgc3Ryb2tlLXdpZHRoPSIzIiB3aWR0aD0iMTQuOCIgaGVpZ2h0PSIxNC44Ii8%2BDQo8cmVjdCB4PSIxNi4zIiB5PSIxNi4zIiBmaWxsPSIjRkZGRkZGIiBzdHJva2U9IiMxNjlGQjAiIHN0cm9rZS13aWR0aD0iMyIgd2lkdGg9IjE0LjgiIGhlaWdodD0iMTQuOCIvPg0KPC9zdmc%2B%22%3B%0A%20%20const%20vm%20%3D%20Scratch.vm%3B%0A%0A%20%20class%20Scratch3Griffpatch%20%7B%0A%20%20%20%20constructor()%20%7B%0A%20%20%20%20%20%20%2F**%0A%20%20%20%20%20%20%20*%20The%20runtime%20instantiating%20this%20block%20package.%0A%20%20%20%20%20%20%20*%20%40type%20%7BRuntime%7D%0A%20%20%20%20%20%20%20*%2F%0A%20%20%20%20%20%20this.runtime%20%3D%20vm.runtime%3B%0A%0A%20%20%20%20%20%20%2F%2F%20Clear%20target%20motion%20state%20values%20when%20the%20project%20starts.%0A%20%20%20%20%20%20this.runtime.on(%22PROJECT_START%22%2C%20this.reset.bind(this))%3B%0A%0A%20%20%20%20%20%20world%20%3D%20new%20b2World(%0A%20%20%20%20%20%20%20%20new%20b2Vec2(0%2C%20-10)%2C%20%2F%2F%20gravity%20(10)%0A%20%20%20%20%20%20%20%20true%20%2F%2F%20allow%20sleep%0A%20%20%20%20%20%20)%3B%0A%0A%20%20%20%20%20%20zoom%20%3D%2050%3B%20%2F%2F%20scale%3B%0A%0A%20%20%20%20%20%20this.map%20%3D%20%7B%7D%3B%0A%0A%20%20%20%20%20%20fixDef.density%20%3D%201.0%3B%20%2F%2F%201.0%0A%20%20%20%20%20%20fixDef.friction%20%3D%200.5%3B%20%2F%2F%200.5%0A%20%20%20%20%20%20fixDef.restitution%20%3D%200.2%3B%20%2F%2F%200.2%0A%0A%20%20%20%20%20%20_setStageType(STAGE_TYPE_OPTIONS.BOXED)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20reset()%20%7B%0A%20%20%20%20%20%20for%20(const%20body%20in%20bodies)%20%7B%0A%20%20%20%20%20%20%20%20if%20(pinned%5Bbody.uid%5D)%20%7B%0A%20%20%20%20%20%20%20%20%20%20world.DestroyJoint(pinned%5Bbody.uid%5D)%3B%0A%20%20%20%20%20%20%20%20%20%20delete%20pinned%5Bbody.uid%5D%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20world.DestroyBody(bodies%5Bbody%5D)%3B%0A%20%20%20%20%20%20%20%20delete%20bodies%5Bbody%5D%3B%0A%20%20%20%20%20%20%20%20delete%20prevPos%5Bbody%5D%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%2F%2F%20todo%3A%20delete%20joins%3F%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20The%20key%20to%20load%20%26%20store%20a%20target's%20music-related%20state.%0A%20%20%20%20%20*%20%40type%20%7Bstring%7D%0A%20%20%20%20%20*%2F%0A%20%20%20%20static%20get%20STATE_KEY()%20%7B%0A%20%20%20%20%20%20return%20%22Scratch.Griffpatch%22%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20%40returns%20%7Bobject%7D%20metadata%20for%20this%20extension%20and%20its%20blocks.%0A%20%20%20%20%20*%2F%0A%20%20%20%20getInfo()%20%7B%0A%20%20%20%20%20%20return%20%7B%0A%20%20%20%20%20%20%20%20id%3A%20%22griffpatch%22%2C%0A%20%20%20%20%20%20%20%20name%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.categoryName%22%2C%0A%20%20%20%20%20%20%20%20%20%20default%3A%20%22Physics%22%2C%0A%20%20%20%20%20%20%20%20%20%20description%3A%20%22Label%20for%20the%20Griffpatch%20extension%20category%22%2C%0A%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20docsURI%3A%20%22https%3A%2F%2Fextensions.turbowarp.org%2Fbox2d.html%22%2C%0A%20%20%20%20%20%20%20%20menuIconURI%3A%20menuIconURI%2C%0A%20%20%20%20%20%20%20%20blockIconURI%3A%20blockIconURI%2C%0A%20%20%20%20%20%20%20%20blocks%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20Global%20Setup%20------------------%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setStage%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setStage%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22setup%20stage%20%5BstageType%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20stage%20type%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20stageType%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22StageTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20STAGE_TYPE_OPTIONS.BOXED%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setGravity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setGravity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20gravity%20to%20x%3A%20%5Bgx%5D%20y%3A%20%5Bgy%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20gravity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20gx%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20gy%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20-10%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getGravityX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getGravityX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22gravity%20x%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Get%20the%20gravity's%20x%20value%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getGravityY%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getGravityY%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22gravity%20y%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Get%20the%20gravity's%20y%20value%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setPhysics%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setPhysics%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22enable%20for%20%5Bshape%5D%20mode%20%5Bmode%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Enable%20Physics%20for%20this%20Sprite%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20shape%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22ShapeTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20%22costume%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20mode%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22EnableModeTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20%22normal%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20opcode%3A%20'setPhysics'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20id%3A%20'griffpatch.setPhysics'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20default%3A%20'enable%20physics%20for%20sprite%20%5Bshape%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20description%3A%20'Enable%20Physics%20for%20this%20Sprite'%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20shape%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'ShapeTypes'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'costume'%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20opcode%3A%20'setPhysicsAll'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20id%3A%20'griffpatch.setPhysicsAll'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20default%3A%20'enable%20physics%20for%20all%20sprites'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20description%3A%20'Enable%20Physics%20For%20All%20Sprites'%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D)%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22doTick%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.doTick%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22step%20simulation%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Run%20a%20single%20tick%20of%20the%20physics%20simulation%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setPosition%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setPosition%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22go%20to%20x%3A%20%5Bx%5D%20y%3A%20%5By%5D%20%5Bspace%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Position%20Sprite%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20x%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20y%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20space%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22SpaceTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20%22world%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20applyForce%20(target%2C%20ftype%2C%20x%2C%20y%2C%20dir%2C%20pow)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20applyAngForce%20(target%2C%20pow)%20%7B%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20velocity%20to%20sx%3A%20%5Bsx%5D%20sy%3A%20%5Bsy%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20Velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20sx%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20sy%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22changeVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.changeVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22change%20velocity%20by%20sx%3A%20%5Bsx%5D%20sy%3A%20%5Bsy%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Change%20Velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20sx%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20sy%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getVelocityX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getVelocityX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22x%20velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22get%20the%20x%20velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getVelocityY%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getVelocityY%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22y%20velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22get%20the%20y%20velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22applyForce%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.applyForce%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22push%20with%20force%20%5Bforce%5D%20in%20direction%20%5Bdir%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Push%20this%20object%20in%20a%20given%20direction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20force%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2025%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dir%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.ANGLE%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22applyAngForce%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.applyAngForce%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22spin%20with%20force%20%5Bforce%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Push%20this%20object%20in%20a%20given%20direction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20force%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20500%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setAngVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setAngVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20angular%20velocity%20to%20%5Bforce%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20angular%20velocity%20of%20the%20sprite%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20force%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2030%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getAngVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getAngVelocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22angular%20velocity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Get%20the%20angular%20velocity%20of%20the%20sprite%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setStatic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setStatic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20fixed%20%5Bstatic%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Sets%20whether%20this%20block%20is%20static%20or%20dynamic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20static%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22StaticTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20%22static%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getStatic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getStatic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22fixed%3F%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22get%20whether%20this%20sprite%20is%20fixed%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.BOOLEAN%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setDensity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setDensity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20density%20%5Bdensity%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20density%20of%20the%20object%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20density%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22DensityTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setDensityValue%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20func%3A%20%22setDensity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setDensityValue%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20density%20to%20%5Bdensity%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20density%20of%20the%20object%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20density%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getDensity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getDensity%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22density%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Get%20the%20density%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setFriction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setFriction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20friction%20%5Bfriction%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20friction%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20friction%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22FrictionTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2050%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setFrictionValue%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20func%3A%20%22setFriction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setFrictionValue%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20friction%20to%20%5Bfriction%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20friction%20value%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20friction%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2050%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getFriction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getFriction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22friction%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Get%20the%20friction%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setRestitution%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setRestitution%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20bounce%20%5Brestitution%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20bounce%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20restitution%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22RestitutionTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2020%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setRestitutionValue%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20func%3A%20%22setRestitution%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setRestitutionValue%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20bounce%20to%20%5Brestitution%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20bounce%20value%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20restitution%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2020%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getRestitution%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getRestitution%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22bounce%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Get%20the%20bounce%20value%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setProperties%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setProperties%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20density%20%5Bdensity%5D%20roughness%20%5Bfriction%5D%20bounce%20%5Brestitution%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Set%20the%20density%20of%20the%20object%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20density%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22DensityTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20friction%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22FrictionTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2050%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20restitution%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22RestitutionTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2020%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20hideFromPalette%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20opcode%3A%20'pinSprite'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20id%3A%20'griffpatch.pinSprite'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20default%3A%20'pin%20to%20world%20at%20sprite%5C's%20x%3A%20%5Bx%5D%20y%3A%20%5By%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20description%3A%20'Pin%20the%20sprite'%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20x%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20y%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getTouching%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getTouching%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22touching%20%5Bwhere%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22get%20the%20name%20of%20any%20sprites%20we%20are%20touching%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20where%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20%22WhereTypes%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20%22any%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20Scene%20Scrolling%20-------------------%0A%0A%20%20%20%20%20%20%20%20%20%20%22---%22%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22setScroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.setScroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22set%20scroll%20x%3A%20%5Box%5D%20y%3A%20%5Boy%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Sets%20whether%20this%20block%20is%20static%20or%20dynamic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ox%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20oy%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22changeScroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.changeScroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22change%20scroll%20by%20x%3A%20%5Box%5D%20y%3A%20%5Boy%5D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22Sets%20whether%20this%20block%20is%20static%20or%20dynamic%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ox%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20oy%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getScrollX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getScrollX%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22x%20scroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22get%20the%20x%20scroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20%22getScrollY%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20formatMessage(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%3A%20%22griffpatch.getScrollY%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%20%22y%20scroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%20%22get%20the%20y%20scroll%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%5D%2C%0A%0A%20%20%20%20%20%20%20%20menus%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20StageTypes%3A%20this.STAGE_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20SpaceTypes%3A%20this.SPACE_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20WhereTypes%3A%20this.WHERE_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20ShapeTypes%3A%20this.SHAPE_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20EnableModeTypes%3A%20this.ENABLE_TYPES_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20StaticTypes%3A%20this.STATIC_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20FrictionTypes%3A%20this.FRICTION_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20RestitutionTypes%3A%20this.RESTITUTION_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%20%20DensityTypes%3A%20this.DENSITY_TYPE_MENU%2C%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20STAGE_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22boxed%20stage%22%2C%20value%3A%20STAGE_TYPE_OPTIONS.BOXED%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22open%20(with%20floor)%22%2C%20value%3A%20STAGE_TYPE_OPTIONS.FLOOR%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22open%20(no%20floor)%22%2C%20value%3A%20STAGE_TYPE_OPTIONS.OPEN%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20SPACE_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22in%20world%22%2C%20value%3A%20SPACE_TYPE_OPTIONS.WORLD%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22on%20stage%22%2C%20value%3A%20SPACE_TYPE_OPTIONS.STAGE%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22relative%22%2C%20value%3A%20SPACE_TYPE_OPTIONS.RELATIVE%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20WHERE_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22any%22%2C%20value%3A%20WHERE_TYPE_OPTIONS.ANY%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22feet%22%2C%20value%3A%20WHERE_TYPE_OPTIONS.FEET%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20SHAPE_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22this%20costume%22%2C%20value%3A%20SHAPE_TYPE_OPTIONS.COSTUME%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22this%20circle%22%2C%20value%3A%20SHAPE_TYPE_OPTIONS.CIRCLE%20%7D%2C%0A%20%20%20%20%20%20%20%20%2F%2F%20%7B%20text%3A%20%22this%20polygon%22%2C%20value%3A%20SHAPE_TYPE_OPTIONS.SVG_POLYGON%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22all%20sprites%22%2C%20value%3A%20SHAPE_TYPE_OPTIONS.ALL%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20ENABLE_TYPES_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22normal%22%2C%20value%3A%20%22normal%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22precision%22%2C%20value%3A%20%22bullet%22%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20STATIC_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22free%22%2C%20value%3A%20%22dynamic%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22fixed%20in%20place%22%2C%20value%3A%20%22static%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22fixed%20(but%20can%20rotate)%22%2C%20value%3A%20%22pinned%22%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20DENSITY_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22very%20light%22%2C%20value%3A%20%2225%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22light%22%2C%20value%3A%20%2250%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22normal%22%2C%20value%3A%20%22100%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22heavy%22%2C%20value%3A%20%22200%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22very%20heavy%22%2C%20value%3A%20%22400%22%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20FRICTION_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22none%22%2C%20value%3A%20%220%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22smooth%22%2C%20value%3A%20%2220%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22normal%22%2C%20value%3A%20%2250%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22rough%22%2C%20value%3A%20%2275%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22extremely%20rough%22%2C%20value%3A%20%22100%22%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20get%20RESTITUTION_TYPE_MENU()%20%7B%0A%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22none%22%2C%20value%3A%20%220%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22little%22%2C%20value%3A%20%2210%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22normal%22%2C%20value%3A%20%2220%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22quite%20bouncy%22%2C%20value%3A%20%2240%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22very%20bouncy%22%2C%20value%3A%20%2270%22%20%7D%2C%0A%20%20%20%20%20%20%20%20%7B%20text%3A%20%22unstable%22%2C%20value%3A%20%22100%22%20%7D%2C%0A%20%20%20%20%20%20%5D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Play%20a%20drum%20sound%20for%20some%20number%20of%20beats.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20x%20-%20x%20offset.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20y%20-%20y%20offset.%0A%20%20%20%20%20*%2F%0A%20%20%20%20doTick()%20%7B%0A%20%20%20%20%20%20%2F%2F%20args%2C%20util)%20%7B%0A%20%20%20%20%20%20%2F%2F%20this._playDrumForBeats(args.DRUM%2C%20args.BEATS%2C%20util)%3B%0A%20%20%20%20%20%20%2F%2F%20if%20(util.runtime.audioEngine%20%3D%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20%2F%2F%20if%20(util.target.sprite.soundBank%20%3D%3D%3D%20null)%20return%3B%0A%0A%20%20%20%20%20%20%2F%2F%20const%20dx%20%3D%20Cast.toNumber(args.x)%3B%0A%20%20%20%20%20%20%2F%2F%20const%20dy%20%3D%20Cast.toNumber(args.y)%3B%0A%0A%20%20%20%20%20%20%2F%2F%20const%20allTargets%20%3D%20this.runtime.targets%3B%0A%20%20%20%20%20%20%2F%2F%20if%20(allTargets%20%3D%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20%2F%2F%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20allTargets.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20const%20target%20%3D%20allTargets%5Bi%5D%3B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20if%20(!target.isStage)%20%7B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20%20%20%20%20target.setXY(target.x%20%2B%20dx%2C%20target.y%20%2B%20dy)%3B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20%7D%0A%20%20%20%20%20%20%2F%2F%20%7D%0A%0A%20%20%20%20%20%20%2F%2F%20util.target.setXY(util.target.x%20%2B%20dx%2C%20util.target.y%20%2B%20dy)%3B%0A%0A%20%20%20%20%20%20%2F%2F%20Matter.Engine.update(this.engine%2C%201000%20%2F%2030)%3B%0A%20%20%20%20%20%20this._checkMoved()%3B%0A%0A%20%20%20%20%20%20%2F%2F%20world.Step(1%20%2F%2030%2C%2010%2C%2010)%3B%0A%20%20%20%20%20%20world.Step(1%20%2F%2030%2C%2010%2C%2010)%3B%0A%20%20%20%20%20%20world.ClearForces()%3B%0A%0A%20%20%20%20%20%20for%20(const%20targetID%20in%20bodies)%20%7B%0A%20%20%20%20%20%20%20%20const%20body%20%3D%20bodies%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20const%20target%20%3D%20this.runtime.getTargetById(targetID)%3B%0A%20%20%20%20%20%20%20%20if%20(!target)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20Drop%20target%20from%20simulation%0A%20%20%20%20%20%20%20%20%20%20world.DestroyBody(body)%3B%0A%20%20%20%20%20%20%20%20%20%20delete%20bodies%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20%20%20delete%20prevPos%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20const%20position%20%3D%20body.GetPosition()%3B%0A%0A%20%20%20%20%20%20%20%20_setXY(%0A%20%20%20%20%20%20%20%20%20%20target%2C%0A%20%20%20%20%20%20%20%20%20%20position.x%20*%20zoom%20-%20_scroll.x%2C%0A%20%20%20%20%20%20%20%20%20%20position.y%20*%20zoom%20-%20_scroll.y%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20if%20(target.rotationStyle%20%3D%3D%3D%20ROTATION_STYLE_ALL_AROUND)%20%7B%0A%20%20%20%20%20%20%20%20%20%20target.setDirection(90%20-%20body.GetAngle()%20%2F%20toRad)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20prevPos%5BtargetID%5D%20%3D%20%7B%20x%3A%20target.x%2C%20y%3A%20target.y%2C%20dir%3A%20target.direction%20%7D%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20_checkMoved()%20%7B%0A%20%20%20%20%20%20for%20(const%20targetID%20in%20bodies)%20%7B%0A%20%20%20%20%20%20%20%20const%20body%20%3D%20bodies%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20const%20target%20%3D%20this.runtime.getTargetById(targetID)%3B%0A%20%20%20%20%20%20%20%20if%20(!target)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20Drop%20target%20from%20simulation%0A%20%20%20%20%20%20%20%20%20%20world.DestroyBody(body)%3B%0A%20%20%20%20%20%20%20%20%20%20delete%20bodies%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20%20%20delete%20prevPos%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20const%20prev%20%3D%20prevPos%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20const%20fixedRotation%20%3D%20target.rotationStyle%20!%3D%3D%20ROTATION_STYLE_ALL_AROUND%3B%0A%0A%20%20%20%20%20%20%20%20if%20(prev%20%26%26%20(prev.x%20!%3D%3D%20target.x%20%7C%7C%20prev.y%20!%3D%3D%20target.y))%20%7B%0A%20%20%20%20%20%20%20%20%20%20const%20pos%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20%20%20%20%20(target.x%20%2B%20_scroll.x)%20%2F%20zoom%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(target.y%20%2B%20_scroll.y)%20%2F%20zoom%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20this._setPosition(body%2C%20pos)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(!fixedRotation)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20body.SetAngle((90%20-%20target.direction)%20*%20toRad)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20body.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(!fixedRotation%20%26%26%20prev%20%26%26%20prev.dir%20!%3D%3D%20target.direction)%20%7B%0A%20%20%20%20%20%20%20%20%20%20body.SetAngle((90%20-%20target.direction)%20*%20toRad)%3B%0A%20%20%20%20%20%20%20%20%20%20body.SetAwake(true)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Play%20a%20drum%20sound%20for%20some%20number%20of%20beats.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20x%20-%20x%20offset.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20y%20-%20y%20offset.%0A%20%20%20%20%20*%2F%0A%20%20%20%20setPhysicsAll()%20%7B%0A%20%20%20%20%20%20const%20allTargets%20%3D%20this.runtime.targets%3B%0A%20%20%20%20%20%20if%20(allTargets%20%3D%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20allTargets.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20const%20target%20%3D%20allTargets%5Bi%5D%3B%0A%20%20%20%20%20%20%20%20if%20(!target.isStage%20%26%26%20!bodies%5Btarget.id%5D)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this.setPhysicsFor(target)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Play%20a%20drum%20sound%20for%20some%20number%20of%20beats.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40property%20%7Bstring%7D%20shape%20-%20the%20shape%0A%20%20%20%20%20*%2F%0A%20%20%20%20setPhysics(args%2C%20util)%20%7B%0A%20%20%20%20%20%20%2F%2F%20this._playDrumForBeats(args.DRUM%2C%20args.BEATS%2C%20util)%3B%0A%20%20%20%20%20%20%2F%2F%20if%20(util.runtime.audioEngine%20%3D%3D%3D%20null)%20return%3B%0A%20%20%20%20%20%20%2F%2F%20if%20(util.target.sprite.soundBank%20%3D%3D%3D%20null)%20return%3B%0A%0A%20%20%20%20%20%20%2F%2F%20const%20dx%20%3D%20Cast.toNumber(args.x)%3B%0A%20%20%20%20%20%20%2F%2F%20const%20dy%20%3D%20Cast.toNumber(args.y)%3B%0A%0A%20%20%20%20%20%20if%20(args.shape%20%3D%3D%3D%20SHAPE_TYPE_OPTIONS.ALL)%20%7B%0A%20%20%20%20%20%20%20%20this.setPhysicsAll()%3B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20const%20target%20%3D%20util.target%3B%0A%20%20%20%20%20%20const%20body%20%3D%20this.setPhysicsFor(target%2C%20args.shape)%3B%0A%20%20%20%20%20%20if%20(body)%20%7B%0A%20%20%20%20%20%20%20%20body.SetBullet(args.mode%20%3D%3D%3D%20%22bullet%22)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20setPhysicsFor(target%2C%20shape)%20%7B%0A%20%20%20%20%20%20const%20r%20%3D%20this.runtime.renderer%3B%0A%20%20%20%20%20%20const%20drawable%20%3D%20r._allDrawables%5Btarget.drawableID%5D%3B%0A%0A%20%20%20%20%20%20%2F%2F%20Tell%20the%20Drawable%20about%20its%20updated%20convex%20hullPoints%2C%20if%20necessary.%0A%20%20%20%20%20%20if%20(drawable.needsConvexHullPoints())%20%7B%0A%20%20%20%20%20%20%20%20const%20points%20%3D%20r._getConvexHullPointsForDrawable(target.drawableID)%3B%0A%20%20%20%20%20%20%20%20drawable.setConvexHullPoints(points)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%2F%2F%20if%20(drawable._transformDirty)%20%7B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20drawable._calculateTransform()%3B%0A%20%20%20%20%20%20%2F%2F%20%7D%0A%20%20%20%20%20%20%2F%2F%20const%20points%20%3D%20drawable._getTransformedHullPoints()%3B%0A%20%20%20%20%20%20%2F%2F%0A%20%20%20%20%20%20%2F%2F%20const%20hullPoints%20%3D%20%5B%5D%3B%0A%20%20%20%20%20%20%2F%2F%20for%20(const%20i%20in%20points)%20%7B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20hullPoints.push(%7Bx%3A%20points%5Bi%5D%5B0%5D%20-%20target.x%2C%20y%3A%20points%5Bi%5D%5B1%5D%20-%20target.y%7D)%3B%0A%20%20%20%20%20%20%2F%2F%20%7D%0A%0A%20%20%20%20%20%20const%20points%20%3D%20drawable._convexHullPoints%3B%0A%20%20%20%20%20%20const%20scaleX%20%3D%20drawable.scale%5B0%5D%20%2F%20100%3B%0A%20%20%20%20%20%20const%20scaleY%20%3D%20drawable.scale%5B1%5D%20%2F%20-100%3B%20%2F%2F%20Flip%20Y%20for%20hulls%0A%20%20%20%20%20%20const%20offset%20%3D%20drawable.skin.rotationCenter%3B%0A%20%20%20%20%20%20let%20allHulls%20%3D%20null%3B%0A%0A%20%20%20%20%20%20if%20(shape%20%3D%3D%3D%20SHAPE_TYPE_OPTIONS.CIRCLE)%20%7B%0A%20%20%20%20%20%20%20%20fixDef.shape%20%3D%20new%20b2CircleShape()%3B%0A%20%20%20%20%20%20%20%20const%20size%20%3D%20drawable.skin.size%3B%0A%20%20%20%20%20%20%20%20fixDef.shape.SetRadius(%0A%20%20%20%20%20%20%20%20%20%20(size%5B0%5D%20*%20Math.abs(scaleX)%20%2B%20size%5B1%5D%20*%20Math.abs(scaleY))%20%2F%204.0%20%2F%20zoom%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%2F%2F%20fixDef.shape.SetRadius((drawable.getBounds().width%20%2F%202)%20%2F%20zoom)%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(shape%20%3D%3D%3D%20SHAPE_TYPE_OPTIONS.SVG_POLYGON)%20%7B%0A%20%20%20%20%20%20%20%20const%20svg%20%3D%20drawable._skin._svgRenderer._svgTag%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20recurse%20through%20childNodes%20of%20type%20'g'%2C%20looking%20for%20type%20'path'%0A%0A%20%20%20%20%20%20%20%20const%20hullPoints%20%3D%20%5B%5D%3B%0A%20%20%20%20%20%20%20%20if%20(svg)%20%7B%0A%20%20%20%20%20%20%20%20%20%20this._fetchPolygonPointsFromSVG(%0A%20%20%20%20%20%20%20%20%20%20%20%20svg%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20hullPoints%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20offset%5B0%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20offset%5B1%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20scaleX%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20scaleY%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20_definePolyFromHull(hullPoints%5B0%5D)%3B%0A%20%20%20%20%20%20%20%20allHulls%20%3D%20hullPoints%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20const%20hullPoints%20%3D%20%5B%5D%3B%0A%20%20%20%20%20%20%20%20for%20(const%20i%20in%20points)%20%7B%0A%20%20%20%20%20%20%20%20%20%20hullPoints.push(%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20x%3A%20(points%5Bi%5D%5B0%5D%20-%20offset%5B0%5D)%20*%20scaleX%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20y%3A%20(points%5Bi%5D%5B1%5D%20-%20offset%5B1%5D)%20*%20scaleY%2C%0A%20%20%20%20%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20_definePolyFromHull(hullPoints)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20const%20fixedRotation%20%3D%20target.rotationStyle%20!%3D%3D%20ROTATION_STYLE_ALL_AROUND%3B%0A%20%20%20%20%20%20const%20body%20%3D%20_placeBody(%0A%20%20%20%20%20%20%20%20target.id%2C%0A%20%20%20%20%20%20%20%20target.x%2C%0A%20%20%20%20%20%20%20%20target.y%2C%0A%20%20%20%20%20%20%20%20fixedRotation%20%3F%2090%20%3A%20target.direction%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20if%20(target.rotationStyle%20!%3D%3D%20ROTATION_STYLE_ALL_AROUND)%20%7B%0A%20%20%20%20%20%20%20%20body.SetFixedRotation(true)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20if%20(allHulls)%20%7B%0A%20%20%20%20%20%20%20%20for%20(let%20i%20%3D%201%3B%20i%20%3C%20allHulls.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20%20%20%20%20%20%20_definePolyFromHull(allHulls%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20%20%20body.CreateFixture(fixDef)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20return%20body%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%0A%20%20%20%20%20*%20%40param%20svg%20the%20svg%20element%0A%20%20%20%20%20*%20%40param%20%7BArray%7D%20hullPointsList%20array%20of%20points%0A%20%20%20%20%20*%20%40private%0A%20%20%20%20%20*%2F%0A%20%20%20%20_fetchPolygonPointsFromSVG(svg%2C%20hullPointsList%2C%20ox%2C%20oy%2C%20scaleX%2C%20scaleY)%20%7B%0A%20%20%20%20%20%20if%20(svg.tagName%20%3D%3D%3D%20%22g%22%20%7C%7C%20svg.tagName%20%3D%3D%3D%20%22svg%22)%20%7B%0A%20%20%20%20%20%20%20%20if%20(svg.hasChildNodes())%20%7B%0A%20%20%20%20%20%20%20%20%20%20for%20(const%20node%20of%20svg.childNodes)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this._fetchPolygonPointsFromSVG(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20node%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20hullPointsList%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20ox%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20oy%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20scaleX%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20scaleY%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20if%20(svg.tagName%20!%3D%3D%20%22path%22)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%2F%2F%20This%20is%20it%20boys!%20Get%20that%20svg%20data%20%3A)%0A%20%20%20%20%20%20%2F%2F%20%3Cpath%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20d%3D%22M%201%20109.7118%20L%201%201.8097%20L%2060.3049%2038.0516%20L%20117.9625%201.8097%20L%20117.9625%20109.7118%20L%2059.8931%2073.8817%20Z%20%22%0A%20%20%20%20%20%20%2F%2F%20%20data-paper-data%3D%22%7B%26quot%3BorigPos%26quot%3B%3Anull%7D%22%20stroke-width%3D%222%22%20fill%3D%22%239966ff%22%2F%3E%0A%0A%20%20%20%20%20%20let%20fx%3B%0A%20%20%20%20%20%20let%20fy%3B%0A%0A%20%20%20%20%20%20const%20hullPoints%20%3D%20%5B%5D%3B%0A%20%20%20%20%20%20hullPointsList.push(hullPoints)%3B%0A%0A%20%20%20%20%20%20const%20tokens%20%3D%20svg.getAttribute(%22d%22).split(%22%20%22)%3B%0A%20%20%20%20%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20tokens.length%3B%20)%20%7B%0A%20%20%20%20%20%20%20%20const%20token%20%3D%20tokens%5Bi%2B%2B%5D%3B%0A%20%20%20%20%20%20%20%20if%20(token%20%3D%3D%3D%20%22M%22%20%7C%7C%20token%20%3D%3D%3D%20%22L%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20const%20x%20%3D%20Cast.toNumber(tokens%5Bi%2B%2B%5D)%3B%0A%20%20%20%20%20%20%20%20%20%20const%20y%20%3D%20Cast.toNumber(tokens%5Bi%2B%2B%5D)%3B%0A%20%20%20%20%20%20%20%20%20%20hullPoints.push(%7B%20x%3A%20(x%20-%20ox)%20*%20scaleX%2C%20y%3A%20(y%20-%20oy)%20*%20scaleY%20%7D)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(token%20%3D%3D%3D%20%22M%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20fx%20%3D%20x%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20fy%20%3D%20y%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(token%20%3D%3D%3D%20%22Z%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20hullPoints.push(%7B%20x%3A%20(fx%20-%20ox)%20*%20scaleX%2C%20y%3A%20(fy%20-%20oy)%20*%20scaleY%20%7D)%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20applyForce(args%2C%20util)%20%7B%0A%20%20%20%20%20%20_applyForce(%0A%20%20%20%20%20%20%20%20util.target.id%2C%0A%20%20%20%20%20%20%20%20%22Impulse%22%2C%0A%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20Cast.toNumber(args.dir)%2C%0A%20%20%20%20%20%20%20%20Cast.toNumber(args.force)%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20applyAngForce(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.ApplyTorque(-Cast.toNumber(args.force))%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setAngVelocity(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20body.SetAngularVelocity(-Cast.toNumber(args.force))%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getAngVelocity(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20const%20vel%20%3D%20-body.GetAngularVelocity()%3B%0A%20%20%20%20%20%20return%20vel%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setDensity(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.GetFixtureList().SetDensity(Cast.toNumber(args.density)%20%2F%20100.0)%3B%0A%20%20%20%20%20%20body.ResetMassData()%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20getDensity(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20return%20body.GetFixtureList().GetDensity()%20*%20100%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setFriction(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.GetFixtureList().SetFriction(Cast.toNumber(args.friction)%20%2F%20100.0)%3B%0A%20%20%20%20%20%20body.ResetMassData()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getFriction(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20return%20body.GetFixtureList().GetFriction()%20*%20100%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setRestitution(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.GetFixtureList().SetRestitution(Cast.toNumber(args.restitution)%20%2F%20100.0)%3B%0A%20%20%20%20%20%20body.ResetMassData()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getRestitution(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20return%20body.GetFixtureList().GetRestitution()%20*%20100%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setProperties(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.GetFixtureList().SetDensity(Cast.toNumber(args.density)%20%2F%20100.0)%3B%0A%20%20%20%20%20%20body.GetFixtureList().SetFriction(Cast.toNumber(args.friction)%20%2F%20100.0)%3B%0A%20%20%20%20%20%20body.GetFixtureList().SetRestitution(Cast.toNumber(args.restitution)%20%2F%20100.0)%3B%0A%20%20%20%20%20%20body.ResetMassData()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20pinSprite(args%2C%20util)%20%7B%0A%20%20%20%20%20%20if%20(!bodies%5Butil.target.id%5D)%20%7B%0A%20%20%20%20%20%20%20%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20const%20x%20%3D%20Cast.toNumber(args.x)%3B%0A%20%20%20%20%20%20const%20y%20%3D%20Cast.toNumber(args.y)%3B%0A%0A%20%20%20%20%20%20_createJointOfType(%0A%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20%22Rotating%22%2C%0A%20%20%20%20%20%20%20%20util.target.id%2C%0A%20%20%20%20%20%20%20%20x%2C%0A%20%20%20%20%20%20%20%20y%2C%0A%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20null%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Set's%20the%20sprites%20position.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20x%20-%20x%20offset.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20y%20-%20y%20offset.%0A%20%20%20%20%20*%20%40property%20%7Bstring%7D%20space%20-%20Space%20type%20(SPACE_TYPE_OPTIONS)%0A%20%20%20%20%20*%2F%0A%20%20%20%20setPosition(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20x%20%3D%20Cast.toNumber(args.x)%3B%0A%20%20%20%20%20%20const%20y%20%3D%20Cast.toNumber(args.y)%3B%0A%20%20%20%20%20%20const%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%0A%20%20%20%20%20%20switch%20(args.space)%20%7B%0A%20%20%20%20%20%20%20%20case%20SPACE_TYPE_OPTIONS.STAGE%3A%0A%20%20%20%20%20%20%20%20%20%20_setXY(util.target%2C%20x%2C%20y)%3B%20%2F%2F%20Position%20on%20stage%20(after%20scroll)%0A%20%20%20%20%20%20%20%20%20%20if%20(body)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this._setPosition(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20body%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20new%20b2Vec2((x%20%2B%20_scroll.x)%20%2F%20zoom%2C%20(y%20%2B%20_scroll.y)%20%2F%20zoom)%0A%20%20%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20case%20SPACE_TYPE_OPTIONS.RELATIVE%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20_setXY(util.target%2C%20util.target.x%20%2B%20x%2C%20util.target.x%20%2B%20y)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(body)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20pos%20%3D%20body.GetPosition()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20pos2%20%3D%20new%20b2Vec2(pos.x%20%2B%20x%20%2F%20zoom%2C%20pos.y%20%2B%20y%20%2F%20zoom)%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20this._setPosition(body%2C%20pos2)%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20break%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20default%3A%0A%20%20%20%20%20%20%20%20%20%20_setXY(util.target%2C%20x%20-%20_scroll.x%2C%20y%20-%20_scroll.y)%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(body)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20this._setPosition(body%2C%20new%20b2Vec2(x%20%2F%20zoom%2C%20y%20%2F%20zoom))%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20_setPosition(body%2C%20pos2)%20%7B%0A%20%20%20%20%20%20const%20md%20%3D%20pinned%5Bbody.uid%5D%3B%0A%20%20%20%20%20%20if%20(md)%20%7B%0A%20%20%20%20%20%20%20%20world.DestroyJoint(md)%3B%0A%20%20%20%20%20%20%20%20pinned%5Bbody.uid%5D%20%3D%20_createJointOfType(%0A%20%20%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20%20%20%22Rotating%22%2C%0A%20%20%20%20%20%20%20%20%20%20body.uid%2C%0A%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20%20%20pos2.x%20*%20zoom%2C%0A%20%20%20%20%20%20%20%20%20%20pos2.y%20*%20zoom%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20body.SetPosition(pos2)%3B%0A%20%20%20%20%20%20%2F%2F%20if%20(md)%20%7B%0A%20%20%20%20%20%20%2F%2F%20%20%20%20%20pinned%5Bbody.uid%5D%20%3D%20_createJointOfType(null%2C%20'Rotating'%2C%20body.uid%2C%200%2C%200%2C%20null%2C%20null%2C%20null)%3B%0A%20%20%20%20%20%20%2F%2F%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Set%20the%20sprites%20velocity.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20sx%20-%20speed%20x.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20sy%20-%20speed%20y.%0A%20%20%20%20%20*%2F%0A%20%20%20%20setVelocity(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.SetAwake(true)%3B%0A%0A%20%20%20%20%20%20const%20x%20%3D%20Cast.toNumber(args.sx)%3B%0A%20%20%20%20%20%20const%20y%20%3D%20Cast.toNumber(args.sy)%3B%0A%20%20%20%20%20%20const%20force%20%3D%20new%20b2Vec2(x%2C%20y)%3B%0A%20%20%20%20%20%20force.Multiply(30%20%2F%20zoom)%3B%0A%20%20%20%20%20%20body.SetLinearVelocity(force)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Change%20the%20sprites%20velocity.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20sx%20-%20speed%20x.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20sy%20-%20speed%20y.%0A%20%20%20%20%20*%2F%0A%20%20%20%20changeVelocity(args%2C%20util)%20%7B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(util.target)%3B%0A%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20body.SetAwake(true)%3B%0A%0A%20%20%20%20%20%20const%20x%20%3D%20Cast.toNumber(args.sx)%3B%0A%20%20%20%20%20%20const%20y%20%3D%20Cast.toNumber(args.sy)%3B%0A%20%20%20%20%20%20const%20force%20%3D%20new%20b2Vec2(x%2C%20y)%3B%0A%20%20%20%20%20%20force.Multiply(30%20%2F%20zoom)%3B%0A%20%20%20%20%20%20force.Add(body.GetLinearVelocity())%3B%0A%20%20%20%20%20%20body.SetLinearVelocity(force)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Get%20the%20current%20tempo.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40return%20%7Bboolean%7D%20-%20the%20current%20tempo%2C%20in%20beats%20per%20minute.%0A%20%20%20%20%20*%2F%0A%20%20%20%20getStatic(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20const%20type%20%3D%20body.GetType()%3B%0A%20%20%20%20%20%20return%20type%20%3D%3D%3D%20b2Body.b2_staticBody%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Get%20the%20current%20tempo.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40return%20%7Bnumber%7D%20-%20the%20current%20x%20velocity.%0A%20%20%20%20%20*%2F%0A%20%20%20%20getVelocityX(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20const%20x%20%3D%20body.GetLinearVelocity().x%3B%0A%20%20%20%20%20%20return%20(x%20*%20zoom)%20%2F%2030%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Get%20the%20current%20tempo.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40return%20%7Bboolean%7D%20-%20the%20current%20y%20velocity.%0A%20%20%20%20%20*%2F%0A%20%20%20%20getVelocityY(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20const%20y%20%3D%20body.GetLinearVelocity().y%3B%0A%20%20%20%20%20%20return%20(y%20*%20zoom)%20%2F%2030%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Sets%20the%20static%20property%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20util%20-%20utility%20object%20provided%20by%20the%20runtime.%0A%20%20%20%20%20*%20%40property%20%7Bstring%7D%20static%20-%20static%20or%20not%0A%20%20%20%20%20*%2F%0A%20%20%20%20setStatic(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20target%20%3D%20util.target%3B%0A%20%20%20%20%20%20let%20body%20%3D%20bodies%5Butil.target.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20body%20%3D%20this.setPhysicsFor(target)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20body.SetType(%0A%20%20%20%20%20%20%20%20args.static%20%3D%3D%3D%20%22static%22%20%3F%20b2Body.b2_staticBody%20%3A%20b2Body.b2_dynamicBody%0A%20%20%20%20%20%20)%3B%0A%0A%20%20%20%20%20%20const%20pos%20%3D%20new%20b2Vec2(%0A%20%20%20%20%20%20%20%20(target.x%20%2B%20_scroll.x)%20%2F%20zoom%2C%0A%20%20%20%20%20%20%20%20(target.y%20%2B%20_scroll.y)%20%2F%20zoom%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20const%20fixedRotation%20%3D%20target.rotationStyle%20!%3D%3D%20ROTATION_STYLE_ALL_AROUND%3B%0A%20%20%20%20%20%20body.SetPositionAndAngle(%0A%20%20%20%20%20%20%20%20pos%2C%0A%20%20%20%20%20%20%20%20fixedRotation%20%3F%200%20%3A%20(90%20-%20target.direction)%20*%20toRad%0A%20%20%20%20%20%20)%3B%0A%0A%20%20%20%20%20%20if%20(args.static%20%3D%3D%3D%20%22pinned%22)%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20Find%20what's%20behind%20the%20sprite%20(pin%20to%20that)%0A%20%20%20%20%20%20%20%20const%20point%20%3D%20new%20b2AABB()%3B%0A%20%20%20%20%20%20%20%20point.lowerBound.SetV(pos)%3B%0A%20%20%20%20%20%20%20%20point.upperBound.SetV(pos)%3B%0A%20%20%20%20%20%20%20%20let%20body2ID%20%3D%20null%3B%0A%20%20%20%20%20%20%20%20world.QueryAABB((fixture)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20%20%20const%20body2%20%3D%20fixture.GetBody()%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(body2%20!%3D%3D%20body%20%26%26%20fixture.TestPoint(pos.x%2C%20pos.y))%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20body2ID%20%3D%20body2.uid%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%20%20%7D%2C%20point)%3B%0A%0A%20%20%20%20%20%20%20%20pinned%5Btarget.id%5D%20%3D%20_createJointOfType(%0A%20%20%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20%20%20%22Rotating%22%2C%0A%20%20%20%20%20%20%20%20%20%20target.id%2C%0A%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%200%2C%0A%20%20%20%20%20%20%20%20%20%20body2ID%2C%0A%20%20%20%20%20%20%20%20%20%20null%2C%0A%20%20%20%20%20%20%20%20%20%20null%0A%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20const%20pin%20%3D%20pinned%5Btarget.id%5D%3B%0A%20%20%20%20%20%20%20%20if%20(pin)%20%7B%0A%20%20%20%20%20%20%20%20%20%20world.DestroyJoint(pin)%3B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20delete%20joints%5Bpin.I%5D%3B%0A%20%20%20%20%20%20%20%20%20%20delete%20pinned%5Btarget.id%5D%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Sets%20the%20sprite%20offset%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20ox%20-%20x%20offset.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20oy%20-%20y%20offset.%0A%20%20%20%20%20*%2F%0A%20%20%20%20setScroll(args)%20%7B%0A%20%20%20%20%20%20this._checkMoved()%3B%0A%20%20%20%20%20%20_scroll.x%20%3D%20Cast.toNumber(args.ox)%3B%0A%20%20%20%20%20%20_scroll.y%20%3D%20Cast.toNumber(args.oy)%3B%0A%20%20%20%20%20%20this._repositionBodies()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Sets%20the%20sprite%20offset%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20ox%20-%20x%20offset.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20oy%20-%20y%20offset.%0A%20%20%20%20%20*%2F%0A%20%20%20%20changeScroll(args)%20%7B%0A%20%20%20%20%20%20this._checkMoved()%3B%0A%20%20%20%20%20%20_scroll.x%20%2B%3D%20Cast.toNumber(args.ox)%3B%0A%20%20%20%20%20%20_scroll.y%20%2B%3D%20Cast.toNumber(args.oy)%3B%0A%20%20%20%20%20%20this._repositionBodies()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Get%20the%20scroll%20x.%0A%20%20%20%20%20*%20%40return%20%7Bnumber%7D%20-%20the%20current%20x%20velocity.%0A%20%20%20%20%20*%2F%0A%20%20%20%20getScrollX()%20%7B%0A%20%20%20%20%20%20return%20_scroll.x%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Get%20the%20scroll%20x.%0A%20%20%20%20%20*%20%40return%20%7Bnumber%7D%20-%20the%20current%20x%20velocity.%0A%20%20%20%20%20*%2F%0A%20%20%20%20getScrollY()%20%7B%0A%20%20%20%20%20%20return%20_scroll.y%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20_repositionBodies()%20%7B%0A%20%20%20%20%20%20for%20(const%20targetID%20in%20bodies)%20%7B%0A%20%20%20%20%20%20%20%20const%20body%20%3D%20bodies%5BtargetID%5D%3B%0A%20%20%20%20%20%20%20%20const%20target%20%3D%20this.runtime.getTargetById(targetID)%3B%0A%20%20%20%20%20%20%20%20if%20(target)%20%7B%0A%20%20%20%20%20%20%20%20%20%20const%20position%20%3D%20body.GetPosition()%3B%0A%20%20%20%20%20%20%20%20%20%20_setXY(%0A%20%20%20%20%20%20%20%20%20%20%20%20target%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20position.x%20*%20zoom%20-%20_scroll.x%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20position.y%20*%20zoom%20-%20_scroll.y%0A%20%20%20%20%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20%20%20%20%20prevPos%5BtargetID%5D%20%3D%20%7B%20x%3A%20target.x%2C%20y%3A%20target.y%2C%20dir%3A%20target.direction%20%7D%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20getTouching(args%2C%20util)%20%7B%0A%20%20%20%20%20%20const%20target%20%3D%20util.target%3B%0A%20%20%20%20%20%20const%20body%20%3D%20bodies%5Btarget.id%5D%3B%0A%20%20%20%20%20%20if%20(!body)%20%7B%0A%20%20%20%20%20%20%20%20return%20%22%22%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20const%20where%20%3D%20args.where%3B%0A%20%20%20%20%20%20let%20touching%20%3D%20%22%22%3B%0A%20%20%20%20%20%20const%20contacts%20%3D%20body.GetContactList()%3B%0A%20%20%20%20%20%20for%20(let%20ce%20%3D%20contacts%3B%20ce%3B%20ce%20%3D%20ce.next)%20%7B%0A%20%20%20%20%20%20%20%20%2F%2F%20noinspection%20JSBitwiseOperatorUsage%0A%20%20%20%20%20%20%20%20if%20(ce.contact.m_flags%20%26%20b2Contact.e_islandFlag)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20ce.contact.IsSensor()%20%3D%3D%3D%20true%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20ce.contact.IsEnabled()%20%3D%3D%3D%20false%20%7C%7C%0A%20%20%20%20%20%20%20%20%20%20ce.contact.IsTouching()%20%3D%3D%3D%20false%0A%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20const%20contact%20%3D%20ce.contact%3B%0A%20%20%20%20%20%20%20%20const%20fixtureA%20%3D%20contact.GetFixtureA()%3B%0A%20%20%20%20%20%20%20%20const%20fixtureB%20%3D%20contact.GetFixtureB()%3B%0A%20%20%20%20%20%20%20%20const%20bodyA%20%3D%20fixtureA.GetBody()%3B%0A%20%20%20%20%20%20%20%20const%20bodyB%20%3D%20fixtureB.GetBody()%3B%0A%0A%20%20%20%20%20%20%20%20%2F%2F%20const%20myFix%20%3D%20touchingB%20%3F%20fixtureA%20%3A%20fixtureB%3B%0A%0A%20%20%20%20%20%20%20%20const%20touchingB%20%3D%20bodyA%20%3D%3D%3D%20body%3B%0A%20%20%20%20%20%20%20%20if%20(where%20!%3D%3D%20%22any%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20const%20man%20%3D%20new%20Box2D.Collision.b2WorldManifold()%3B%0A%20%20%20%20%20%20%20%20%20%20contact.GetWorldManifold(man)%3B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20man.m_points%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20const%20mx%20%3D%20man.m_normal.x%3B%0A%20%20%20%20%20%20%20%20%20%20%2F%2F%20const%20my%20%3D%20man.m_normal.y%3B%0A%0A%20%20%20%20%20%20%20%20%20%20if%20(where%20%3D%3D%3D%20%22feet%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20if%20(my%20%3E%20-0.6)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20fixture%20%3D%20body.GetFixtureList()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20y%20%3D%20man.m_points%5B0%5D.y%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20y%20%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20fixture.m_aabb.lowerBound.y%20*%200.75%20%2B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fixture.m_aabb.upperBound.y%20*%200.25%0A%20%20%20%20%20%20%20%20%20%20%20%20)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20const%20lp%20%3D%20body.GetLocalPoint(man.m_points%5B0%5D).Normalize()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20if%20(lp.y)%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%0A%20%20%20%20%20%20%20%20const%20other%20%3D%20touchingB%20%3F%20bodyB%20%3A%20bodyA%3B%0A%20%20%20%20%20%20%20%20const%20uid%20%3D%20other.uid%3B%0A%20%20%20%20%20%20%20%20const%20target2%20%3D%20uid%0A%20%20%20%20%20%20%20%20%20%20%3F%20this.runtime.getTargetById(uid)%0A%20%20%20%20%20%20%20%20%20%20%3A%20this.runtime.getTargetForStage()%3B%0A%20%20%20%20%20%20%20%20if%20(target2)%20%7B%0A%20%20%20%20%20%20%20%20%20%20const%20name%20%3D%20target2.sprite.name%3B%0A%20%20%20%20%20%20%20%20%20%20if%20(touching.length%20%3D%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20touching%20%3D%20name%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20touching%20%2B%3D%20%60%2C%24%7Bname%7D%60%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20touching%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Sets%20the%20stage%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20stageType%20-%20Stage%20Type.%0A%20%20%20%20%20*%2F%0A%20%20%20%20setStage(args)%20%7B%0A%20%20%20%20%20%20_setStageType(args.stageType)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F**%0A%20%20%20%20%20*%20Sets%20the%20gravity%0A%20%20%20%20%20*%20%40param%20%7Bobject%7D%20args%20-%20the%20block%20arguments.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20gx%20-%20Gravity%20x.%0A%20%20%20%20%20*%20%40property%20%7Bnumber%7D%20gy%20-%20Gravity%20y.%0A%20%20%20%20%20*%2F%0A%20%20%20%20setGravity(args)%20%7B%0A%20%20%20%20%20%20world.SetGravity(%0A%20%20%20%20%20%20%20%20new%20b2Vec2(Cast.toNumber(args.gx)%2C%20Cast.toNumber(args.gy))%0A%20%20%20%20%20%20)%3B%0A%20%20%20%20%20%20for%20(const%20bodyID%20in%20bodies)%20%7B%0A%20%20%20%20%20%20%20%20bodies%5BbodyID%5D.SetAwake(true)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20getGravityX()%20%7B%0A%20%20%20%20%20%20return%20world.GetGravity().x%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getGravityY()%20%7B%0A%20%20%20%20%20%20return%20world.GetGravity().y%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20Scratch.extensions.register(new%20Scratch3Griffpatch())%3B%0A%7D)(Scratch)%3B%0A%20%7D)(Scratch)%3B","data:text/javascript;,(function(Scratch)%20%7B%20(function%20(Scratch)%20%7B%0A%20%20'use%20strict'%3B%0A%0A%20%20if%20(!Scratch.extensions.unsandboxed)%20%7B%0A%20%20%20%20throw%20new%20Error('Runtime%20Options%20extension%20needs%20to%20be%20run%20unsandboxed')%3B%0A%20%20%7D%0A%0A%20%20const%20greenFlagURI%20%3D%20'data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAABFFBMVEUAAACAgABVqlVJkklAn0BNmTNLljxGlzpDmzdFmjpGmzxHmz9Fmj1FmT5Emj1GmT1GmD1EmDxGmTxEmT1GmjxGmT1FmDxEmT5EmTxGmT5FmD1GmT5FmT1Gmj1EmT5FmT1FmT1FmDxGmT1FmjxLs09LtE9Jr0xJsk1Js05JtVBKtU5KtVBKtlBJrkpJsE1KtlFIrEpIsExLt1FLuFJKuVNIqkhLulNIp0VJqkhKtlJLvVRMvFNFmT5GpUVFmT1HpEVHokNMvlVFmT1Ho0NFmTxLvlVGoUFMvlVLvlVGn0BFmT1Nv1ZEmz5FmTxFmTxFmT1NvlZFmz9FmT5FnT9FnD5GnT9Mv1ZMv1ZMv1ZFmT1Mv1b%2F%2F%2F%2F70P2GAAAAWXRSTlMAAgMHCAoRFhcwMz0%2FRkdQVGFmaWpxcnh7gIGEhZKZo6eprLq%2Fv8DAwMDAwMDBwcHCwsPDxcbIysrLzM3Pz9DQ1NTV1dfZ29vg4uXm5%2Bjp6ens7fDx9Pv8%2FnPb5aAAAAABYktHRFt0vJU0AAAAsUlEQVQoz2NgwA3YhNiwS4hHykoou9goCrKiSUhGhqhZe7gbm3rxQwQ4BJihEupRYODooMDFyMAu6uMsgyoRFW5kHxjkqeuhL4cmAQM4JXRwSWjjktDEJaGFS0IVIeFtZuIaAZdQgUmY2%2FoqyTu5WcEkNGAS%2FkJMQJrbySAAJBxmGSoIlYAoYGCR8rPVM7QItuNlQJVgYGDlE5MU5kSErhz2%2BKCihEikNHYJJh5mBhIAADBcR%2Fr5OJzCAAAAAElFTkSuQmCC'%3B%0A%20%20const%20TURBO_MODE%20%3D%20'turbo%20mode'%3B%0A%20%20const%20INTERPOLATION%20%3D%20'interpolation'%3B%0A%20%20const%20REMOVE_FENCING%20%3D%20'remove%20fencing'%3B%0A%20%20const%20REMOVE_MISC_LIMITS%20%3D%20'remove%20misc%20limits'%3B%0A%20%20const%20HIGH_QUALITY_PEN%20%3D%20'high%20quality%20pen'%3B%0A%0A%20%20class%20RuntimeOptions%20%7B%0A%20%20%20%20getInfo%20()%20%7B%0A%20%20%20%20%20%20return%20%7B%0A%20%20%20%20%20%20%20%20id%3A%20'runtimeoptions'%2C%0A%20%20%20%20%20%20%20%20name%3A%20'Runtime%20Options'%2C%0A%20%20%20%20%20%20%20%20color1%3A%20'%238c9abf'%2C%0A%20%20%20%20%20%20%20%20color2%3A%20'%237d8aab'%2C%0A%20%20%20%20%20%20%20%20color3%3A%20'%236f7b99'%2C%0A%20%20%20%20%20%20%20%20blocks%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'getEnabled'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'is%20%5Bthing%5D%20enabled%3F'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.BOOLEAN%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20thing%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20TURBO_MODE%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'thing'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setEnabled'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20%5Bthing%5D%20to%20%5Benabled%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20thing%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20TURBO_MODE%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'thing'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20enabled%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'true'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'enabled'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'getFramerate'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'get%20framerate%20limit'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setFramerate'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20framerate%20limit%20to%20%5Bfps%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20fps%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'30'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'getCloneLimit'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'get%20clone%20limit'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setCloneLimit'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20clone%20limit%20%5Blimit%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20limit%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'300'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'clones'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'getDimension'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'get%20stage%20%5Bdimension%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20dimension%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'width'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'dimension'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setDimensions'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20stage%20size%20width%3A%20%5Bwidth%5D%20height%3A%20%5Bheight%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20width%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'480'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20height%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'360'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setUsername'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20username%20to%20%5Busername%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20username%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20''%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'greenFlag'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'run%20green%20flag%20%5Bflag%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20flag%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.IMAGE%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20dataURI%3A%20greenFlagURI%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20menus%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20thing%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20acceptReporters%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20items%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'turbo%20mode'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20TURBO_MODE%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'interpolation'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20INTERPOLATION%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'remove%20fencing'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20REMOVE_FENCING%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'remove%20misc%20limits'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20REMOVE_MISC_LIMITS%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'high%20quality%20pen'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20HIGH_QUALITY_PEN%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20enabled%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20acceptReporters%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20items%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'enabled'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20'true'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'disabled'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20'false'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20clones%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20acceptReporters%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20items%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'default%20(300)'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20'300'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'Infinity'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20'Infinity'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20dimension%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20acceptReporters%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20items%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'width'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20'width'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'height'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20'height'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getEnabled%20(%7B%20thing%20%7D)%20%7B%0A%20%20%20%20%20%20if%20(thing%20%3D%3D%3D%20TURBO_MODE)%20%7B%0A%20%20%20%20%20%20%20%20return%20Scratch.vm.runtime.turboMode%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20INTERPOLATION)%20%7B%0A%20%20%20%20%20%20%20%20return%20Scratch.vm.runtime.interpolationEnabled%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20REMOVE_FENCING)%20%7B%0A%20%20%20%20%20%20%20%20return%20!Scratch.vm.runtime.runtimeOptions.fencing%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20REMOVE_MISC_LIMITS)%20%7B%0A%20%20%20%20%20%20%20%20return%20!Scratch.vm.runtime.runtimeOptions.miscLimits%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20HIGH_QUALITY_PEN)%20%7B%0A%20%20%20%20%20%20%20%20return%20Scratch.renderer.useHighQualityRender%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%20false%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setEnabled%20(%7B%20thing%2C%20enabled%20%7D)%20%7B%0A%20%20%20%20%20%20enabled%20%3D%20Scratch.Cast.toBoolean(enabled)%3B%0A%0A%20%20%20%20%20%20if%20(thing%20%3D%3D%3D%20TURBO_MODE)%20%7B%0A%20%20%20%20%20%20%20%20Scratch.vm.setTurboMode(enabled)%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20INTERPOLATION)%20%7B%0A%20%20%20%20%20%20%20%20Scratch.vm.setInterpolation(enabled)%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20REMOVE_FENCING)%20%7B%0A%20%20%20%20%20%20%20%20Scratch.vm.setRuntimeOptions(%7B%0A%20%20%20%20%20%20%20%20%20%20fencing%3A%20!enabled%0A%20%20%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20REMOVE_MISC_LIMITS)%20%7B%0A%20%20%20%20%20%20%20%20Scratch.vm.setRuntimeOptions(%7B%0A%20%20%20%20%20%20%20%20%20%20miscLimits%3A%20!enabled%0A%20%20%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(thing%20%3D%3D%3D%20HIGH_QUALITY_PEN)%20%7B%0A%20%20%20%20%20%20%20%20Scratch.renderer.setUseHighQualityRender(enabled)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%0A%20%20%20%20getFramerate%20()%20%7B%0A%20%20%20%20%20%20return%20Scratch.vm.runtime.frameLoop.framerate%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setFramerate%20(%7B%20fps%20%7D)%20%7B%0A%20%20%20%20%20%20fps%20%3D%20Scratch.Cast.toNumber(fps)%3B%0A%20%20%20%20%20%20Scratch.vm.setFramerate(fps)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getCloneLimit%20()%20%7B%0A%20%20%20%20%20%20return%20Scratch.vm.runtime.runtimeOptions.maxClones%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setCloneLimit%20(%7B%20limit%20%7D)%20%7B%0A%20%20%20%20%20%20limit%20%3D%20Scratch.Cast.toNumber(limit)%3B%0A%20%20%20%20%20%20Scratch.vm.setRuntimeOptions(%7B%0A%20%20%20%20%20%20%20%20maxClones%3A%20limit%0A%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20getDimension%20(%7B%20dimension%20%7D)%20%7B%0A%20%20%20%20%20%20if%20(dimension%20%3D%3D%3D%20'width')%20%7B%0A%20%20%20%20%20%20%20%20return%20Scratch.vm.runtime.stageWidth%3B%0A%20%20%20%20%20%20%7D%20else%20if%20(dimension%20%3D%3D%3D%20'height')%20%7B%0A%20%20%20%20%20%20%20%20return%20Scratch.vm.runtime.stageHeight%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20return%200%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setDimensions%20(%7B%20width%2C%20height%20%7D)%20%7B%0A%20%20%20%20%20%20width%20%3D%20Scratch.Cast.toNumber(width)%3B%0A%20%20%20%20%20%20height%20%3D%20Scratch.Cast.toNumber(height)%3B%0A%20%20%20%20%20%20Scratch.vm.setStageSize(width%2C%20height)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setUsername%20(%7B%20username%20%7D)%20%7B%0A%20%20%20%20%20%20Scratch.vm.runtime.ioDevices.userData._username%20%3D%20Scratch.Cast.toString(username)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20greenFlag%20()%20%7B%0A%20%20%20%20%20%20Scratch.vm.runtime.greenFlag()%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20Scratch.extensions.register(new%20RuntimeOptions())%3B%0A%7D)(window.Scratch)%3B%0A%20%7D)(Scratch)%3B","data:text/javascript;,(function(Scratch)%20%7B%20(function(Scratch)%20%7B%0A%20%20'use%20strict'%3B%0A%0A%20%20if%20(!Scratch.extensions.unsandboxed)%20%7B%0A%20%20%20%20throw%20new%20Error('files%20extension%20must%20be%20run%20unsandboxed')%3B%0A%20%20%7D%0A%0A%20%20const%20MODE_MODAL%20%3D%20'modal'%3B%0A%20%20const%20MODE_IMMEDIATELY_SHOW_SELECTOR%20%3D%20'selector'%3B%0A%20%20const%20MODE_ONLY_SELECTOR%20%3D%20'only-selector'%3B%0A%20%20const%20ALL_MODES%20%3D%20%5BMODE_MODAL%2C%20MODE_IMMEDIATELY_SHOW_SELECTOR%2C%20MODE_ONLY_SELECTOR%5D%3B%0A%20%20let%20openFileSelectorMode%20%3D%20MODE_MODAL%3B%0A%0A%20%20const%20AS_TEXT%20%3D%20'text'%3B%0A%20%20const%20AS_DATA_URL%20%3D%20'url'%3B%0A%0A%20%20%2F**%0A%20%20%20*%20%40param%20%7Bstring%7D%20accept%20See%20MODE_%20constants%20above%0A%20%20%20*%20%40param%20%7Bstring%7D%20as%20See%20AS_%20constants%20above%0A%20%20%20*%20%40returns%20%7BPromise%3Cstring%3E%7D%20format%20given%20by%20as%20parameter%0A%20%20%20*%2F%0A%20%20const%20showFilePrompt%20%3D%20(accept%2C%20as)%20%3D%3E%20new%20Promise((_resolve)%20%3D%3E%20%7B%0A%20%20%20%20%2F%2F%20We%20can't%20reliably%20show%20an%20%3Cinput%3E%20picker%20without%20%22user%20interaction%22%20in%20all%20environments%2C%0A%20%20%20%20%2F%2F%20so%20we%20have%20to%20show%20our%20own%20UI%20anyways.%20We%20may%20as%20well%20use%20this%20to%20implement%20some%20nice%20features%0A%20%20%20%20%2F%2F%20that%20native%20file%20pickers%20don't%20have%3A%0A%20%20%20%20%2F%2F%20%20-%20Easy%20drag%2Bdrop%0A%20%20%20%20%2F%2F%20%20-%20Reliable%20cancel%20button%20(input%20cancel%20event%20is%20still%20basically%20nonexistent)%0A%20%20%20%20%2F%2F%20%20%20%20This%20is%20important%20so%20we%20can%20make%20this%20just%20a%20reporter%20instead%20of%20a%20command%2Bhat%20block.%0A%20%20%20%20%2F%2F%20%20%20%20Without%20an%20interface%2C%20the%20script%20would%20be%20stalled%20if%20the%20prompt%20was%20just%20cancelled.%0A%0A%20%20%20%20%2F**%20%40param%20%7Bstring%7D%20text%20*%2F%0A%20%20%20%20const%20callback%20%3D%20(text)%20%3D%3E%20%7B%0A%20%20%20%20%20%20_resolve(text)%3B%0A%20%20%20%20%20%20outer.remove()%3B%0A%20%20%20%20%20%20document.body.removeEventListener('keydown'%2C%20handleKeyDown)%3B%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20let%20isReadingFile%20%3D%20false%3B%0A%0A%20%20%20%20%2F**%20%40param%20%7BFile%7D%20file%20*%2F%0A%20%20%20%20const%20readFile%20%3D%20(file)%20%3D%3E%20%7B%0A%20%20%20%20%20%20if%20(isReadingFile)%20%7B%0A%20%20%20%20%20%20%20%20return%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20isReadingFile%20%3D%20true%3B%0A%0A%20%20%20%20%20%20const%20reader%20%3D%20new%20FileReader()%3B%0A%20%20%20%20%20%20reader.onload%20%3D%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20callback(%2F**%20%40type%20%7Bstring%7D%20*%2F%20(reader.result))%3B%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%20%20reader.onerror%20%3D%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20console.error('Failed%20to%20read%20file%20as%20text'%2C%20reader.error)%3B%0A%20%20%20%20%20%20%20%20callback('')%3B%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%20%20if%20(as%20%3D%3D%3D%20AS_TEXT)%20%7B%0A%20%20%20%20%20%20%20%20reader.readAsText(file)%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20reader.readAsDataURL(file)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%0A%20%20%20%20%2F**%20%40param%20%7BKeyboardEvent%7D%20e%20*%2F%0A%20%20%20%20const%20handleKeyDown%20%3D%20(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20if%20(e.key%20%3D%3D%3D%20'Escape')%20%7B%0A%20%20%20%20%20%20%20%20e.stopPropagation()%3B%0A%20%20%20%20%20%20%20%20e.preventDefault()%3B%0A%20%20%20%20%20%20%20%20callback('')%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%3B%0A%20%20%20%20document.body.addEventListener('keydown'%2C%20handleKeyDown%2C%20%7B%0A%20%20%20%20%20%20capture%3A%20true%0A%20%20%20%20%7D)%3B%0A%0A%20%20%20%20const%20INITIAL_BORDER_COLOR%20%3D%20'%23888'%3B%0A%20%20%20%20const%20DROPPING_BORDER_COLOR%20%3D%20'%2303a9fc'%3B%0A%0A%20%20%20%20const%20outer%20%3D%20document.createElement('div')%3B%0A%20%20%20%20outer.className%20%3D%20'extension-content'%3B%0A%20%20%20%20outer.style.position%20%3D%20'fixed'%3B%0A%20%20%20%20outer.style.top%20%3D%20'0'%3B%0A%20%20%20%20outer.style.left%20%3D%20'0'%3B%0A%20%20%20%20outer.style.width%20%3D%20'100%25'%3B%0A%20%20%20%20outer.style.height%20%3D%20'100%25'%3B%0A%20%20%20%20outer.style.display%20%3D%20'flex'%3B%0A%20%20%20%20outer.style.alignItems%20%3D%20'center'%3B%0A%20%20%20%20outer.style.justifyContent%20%3D%20'center'%3B%0A%20%20%20%20outer.style.background%20%3D%20'rgba(0%2C%200%2C%200%2C%200.5)'%3B%0A%20%20%20%20outer.style.zIndex%20%3D%20'20000'%3B%0A%20%20%20%20outer.style.color%20%3D%20'black'%3B%0A%20%20%20%20outer.style.colorScheme%20%3D%20'light'%3B%0A%20%20%20%20outer.addEventListener('dragover'%2C%20(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20if%20(e.dataTransfer.types.includes('Files'))%20%7B%0A%20%20%20%20%20%20%20%20e.preventDefault()%3B%0A%20%20%20%20%20%20%20%20e.dataTransfer.dropEffect%20%3D%20'copy'%3B%0A%20%20%20%20%20%20%20%20modal.style.borderColor%20%3D%20DROPPING_BORDER_COLOR%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D)%3B%0A%20%20%20%20outer.addEventListener('dragleave'%2C%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20modal.style.borderColor%20%3D%20INITIAL_BORDER_COLOR%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20outer.addEventListener('drop'%2C%20(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20const%20file%20%3D%20e.dataTransfer.files%5B0%5D%3B%0A%20%20%20%20%20%20if%20(file)%20%7B%0A%20%20%20%20%20%20%20%20e.preventDefault()%3B%0A%20%20%20%20%20%20%20%20readFile(file)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D)%3B%0A%20%20%20%20outer.addEventListener('click'%2C%20(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20if%20(e.target%20%3D%3D%3D%20outer)%20%7B%0A%20%20%20%20%20%20%20%20callback('')%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D)%3B%0A%0A%20%20%20%20const%20modal%20%3D%20document.createElement('button')%3B%0A%20%20%20%20modal.style.boxShadow%20%3D%20'0%200%2010px%20-5px%20currentColor'%3B%0A%20%20%20%20modal.style.cursor%20%3D%20'pointer'%3B%0A%20%20%20%20modal.style.font%20%3D%20'inherit'%3B%0A%20%20%20%20modal.style.background%20%3D%20'white'%3B%0A%20%20%20%20modal.style.padding%20%3D%20'16px'%3B%0A%20%20%20%20modal.style.borderRadius%20%3D%20'16px'%3B%0A%20%20%20%20modal.style.border%20%3D%20%608px%20dashed%20%24%7BINITIAL_BORDER_COLOR%7D%60%3B%0A%20%20%20%20modal.style.position%20%3D%20'relative'%3B%0A%20%20%20%20modal.style.textAlign%20%3D%20'center'%3B%0A%20%20%20%20modal.addEventListener('click'%2C%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20input.click()%3B%0A%20%20%20%20%7D)%3B%0A%20%20%20%20modal.focus()%3B%0A%20%20%20%20outer.appendChild(modal)%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement('input')%3B%0A%20%20%20%20input.type%20%3D%20'file'%3B%0A%20%20%20%20input.accept%20%3D%20accept%3B%0A%20%20%20%20input.addEventListener('change'%2C%20(e)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%2F%2F%20%40ts-expect-error%0A%20%20%20%20%20%20const%20file%20%3D%20e.target.files%5B0%5D%3B%0A%20%20%20%20%20%20if%20(file)%20%7B%0A%20%20%20%20%20%20%20%20readFile(file)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D)%3B%0A%0A%20%20%20%20const%20title%20%3D%20document.createElement('div')%3B%0A%20%20%20%20title.textContent%20%3D%20'Select%20or%20drop%20file'%3B%0A%20%20%20%20title.style.fontSize%20%3D%20'1.5em'%3B%0A%20%20%20%20title.style.marginBottom%20%3D%20'8px'%3B%0A%20%20%20%20modal.appendChild(title)%3B%0A%0A%20%20%20%20const%20subtitle%20%3D%20document.createElement('div')%3B%0A%20%20%20%20const%20formattedAccept%20%3D%20accept%20%7C%7C%20'any'%3B%0A%20%20%20%20subtitle.textContent%20%3D%20%60Accepted%20formats%3A%20%24%7BformattedAccept%7D%60%3B%0A%20%20%20%20modal.appendChild(subtitle)%3B%0A%0A%20%20%20%20document.body.appendChild(outer)%3B%0A%0A%20%20%20%20if%20(openFileSelectorMode%20%3D%3D%3D%20MODE_IMMEDIATELY_SHOW_SELECTOR%20%7C%7C%20openFileSelectorMode%20%3D%3D%3D%20MODE_ONLY_SELECTOR)%20%7B%0A%20%20%20%20%20%20input.click()%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20(openFileSelectorMode%20%3D%3D%3D%20MODE_ONLY_SELECTOR)%20%7B%0A%20%20%20%20%20%20%2F%2F%20Note%20that%20browser%20support%20for%20cancel%20is%20currently%20quite%20bad%0A%20%20%20%20%20%20input.addEventListener('cancel'%2C%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20callback('')%3B%0A%20%20%20%20%20%20%7D)%3B%0A%20%20%20%20%20%20outer.remove()%3B%0A%20%20%20%20%7D%0A%20%20%7D)%3B%0A%0A%20%20%2F**%0A%20%20%20*%20%40param%20%7Bstring%7D%20text%20Text%20to%20download%0A%20%20%20*%20%40param%20%7Bstring%7D%20file%20Name%20of%20the%20file%0A%20%20%20*%2F%0A%20%20const%20download%20%3D%20(text%2C%20file)%20%3D%3E%20%7B%0A%20%20%20%20const%20blob%20%3D%20new%20Blob(%5Btext%5D)%3B%0A%20%20%20%20const%20url%20%3D%20URL.createObjectURL(blob)%3B%0A%20%20%20%20const%20link%20%3D%20document.createElement('a')%3B%0A%20%20%20%20link.href%20%3D%20url%3B%0A%20%20%20%20link.download%20%3D%20file%3B%0A%20%20%20%20document.body.appendChild(link)%3B%0A%20%20%20%20link.click()%3B%0A%20%20%20%20link.remove()%3B%0A%20%20%20%20URL.revokeObjectURL(url)%3B%0A%20%20%7D%3B%0A%0A%20%20class%20Files%20%7B%0A%20%20%20%20getInfo%20()%20%7B%0A%20%20%20%20%20%20return%20%7B%0A%20%20%20%20%20%20%20%20id%3A%20'files'%2C%0A%20%20%20%20%20%20%20%20name%3A%20'Files'%2C%0A%20%20%20%20%20%20%20%20color1%3A%20'%23fcb103'%2C%0A%20%20%20%20%20%20%20%20color2%3A%20'%23db9a37'%2C%0A%20%20%20%20%20%20%20%20color3%3A%20'%23db8937'%2C%0A%20%20%20%20%20%20%20%20blocks%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'showPicker'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'open%20a%20file'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20disableMonitor%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20hideFromPalette%3A%20true%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'showPickerExtensions'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'open%20a%20%5Bextension%5D%20file'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20extension%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'.txt'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20hideFromPalette%3A%20true%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'showPickerAs'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'open%20a%20file%20as%20%5Bas%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20as%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'encoding'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'showPickerExtensionsAs'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'open%20a%20%5Bextension%5D%20file%20as%20%5Bas%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20extension%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'.txt'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20as%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'encoding'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'download'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'download%20%5Btext%5D%20as%20%5Bfile%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'Hello%2C%20world!'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20file%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20'save.txt'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setOpenMode'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20open%20file%20selector%20mode%20to%20%5Bmode%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20mode%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.STRING%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20MODE_MODAL%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20menu%3A%20'automaticallyOpen'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%20%20menus%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20encoding%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20acceptReporters%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20items%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'text'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20AS_TEXT%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'data%3A%20URL'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20AS_DATA_URL%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20automaticallyOpen%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20acceptReporters%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20items%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'show%20modal'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20MODE_MODAL%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'open%20selector%20immediately'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%3A%20MODE_IMMEDIATELY_SHOW_SELECTOR%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20showPicker%20()%20%7B%0A%20%20%20%20%20%20return%20showFilePrompt(''%2C%20AS_TEXT)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20showPickerExtensions%20(args)%20%7B%0A%20%20%20%20%20%20return%20showFilePrompt(args.extension%2C%20AS_TEXT)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20showPickerAs%20(args)%20%7B%0A%20%20%20%20%20%20return%20showFilePrompt(''%2C%20args.as)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20showPickerExtensionsAs%20(args)%20%7B%0A%20%20%20%20%20%20return%20showFilePrompt(args.extension%2C%20args.as)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20download%20(args)%20%7B%0A%20%20%20%20%20%20download(args.text%2C%20args.file)%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20setOpenMode%20(args)%20%7B%0A%20%20%20%20%20%20if%20(ALL_MODES.includes(args.mode))%20%7B%0A%20%20%20%20%20%20%20%20openFileSelectorMode%20%3D%20args.mode%3B%0A%20%20%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20console.warn(%60unknown%20mode%60%2C%20args.mode)%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20Scratch.extensions.register(new%20Files())%3B%0A%7D)(Scratch)%3B%0A%20%7D)(Scratch)%3B","data:text/javascript;,(function(Scratch)%20%7B%20(function%20(Scratch)%20%7B%0A%20%20'use%20strict'%3B%0A%0A%20%20const%20STRETCH_X%20%3D%20Symbol('stretch.x')%3B%0A%20%20const%20STRETCH_Y%20%3D%20Symbol('stretch.y')%3B%0A%0A%20%20const%20vm%20%3D%20Scratch.vm%3B%0A%0A%20%20%2F**%0A%20%20%20*%20%40param%20%7BVM.RenderedTarget%7D%20target%0A%20%20%20*%20%40param%20%7BVM.RenderedTarget%7D%20%5BoriginalTarget%5D%20If%20target%20is%20a%20clone%2C%20the%20original%20to%20copy%20from.%0A%20%20%20*%2F%0A%20%20const%20implementStretchForTarget%20%3D%20(target%2C%20originalTarget)%20%3D%3E%20%7B%0A%20%20%20%20if%20(STRETCH_X%20in%20target)%20%7B%0A%20%20%20%20%20%20%2F%2F%20Target%20already%20has%20stretch.%20Don't%20implement%20again.%0A%20%20%20%20%20%20return%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20target%5BSTRETCH_X%5D%20%3D%20originalTarget%20%3F%20originalTarget%5BSTRETCH_X%5D%20%3A%20100%3B%0A%20%20%20%20target%5BSTRETCH_Y%5D%20%3D%20originalTarget%20%3F%20originalTarget%5BSTRETCH_Y%5D%20%3A%20100%3B%0A%0A%20%20%20%20const%20original%20%3D%20target._getRenderedDirectionAndScale%3B%0A%20%20%20%20target._getRenderedDirectionAndScale%20%3D%20function%20()%20%7B%0A%20%20%20%20%20%20const%20result%20%3D%20original.call(this)%3B%0A%0A%20%20%20%20%20%20result.scale%5B0%5D%20*%3D%20this%5BSTRETCH_X%5D%20%2F%20100%3B%0A%20%20%20%20%20%20result.scale%5B1%5D%20*%3D%20this%5BSTRETCH_Y%5D%20%2F%20100%3B%0A%0A%20%20%20%20%20%20return%20result%3B%0A%20%20%20%20%7D%3B%0A%20%20%7D%3B%0A%20%20vm.runtime.targets.forEach((target)%20%3D%3E%20implementStretchForTarget(target))%3B%0A%20%20vm.runtime.on('targetWasCreated'%2C%20(target%2C%20originalTarget)%20%3D%3E%20implementStretchForTarget(target%2C%20originalTarget))%3B%0A%20%20vm.runtime.on('PROJECT_LOADED'%2C%20()%20%3D%3E%20%7B%0A%20%20%20%20vm.runtime.targets.forEach((target)%20%3D%3E%20implementStretchForTarget(target))%3B%0A%20%20%7D)%3B%0A%0A%20%20%2F**%0A%20%20%20*%20%40param%20%7BVM.RenderedTarget%7D%20target%0A%20%20%20*%2F%0A%20%20const%20forceUpdateDirectionAndScale%20%3D%20(target)%20%3D%3E%20%7B%0A%20%20%20%20target.setDirection(target.direction)%3B%0A%20%20%7D%3B%0A%0A%20%20class%20Stretch%20%7B%0A%20%20%20%20getInfo()%20%7B%0A%20%20%20%20%20%20return%20%7B%0A%20%20%20%20%20%20%20%20id%3A%20'stretch'%2C%0A%20%20%20%20%20%20%20%20name%3A%20'Stretch'%2C%0A%20%20%20%20%20%20%20%20color1%3A%20'%234287f5'%2C%0A%20%20%20%20%20%20%20%20color2%3A%20'%232b62ba'%2C%0A%20%20%20%20%20%20%20%20color3%3A%20'%23204785'%2C%0A%20%20%20%20%20%20%20%20blocks%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setStretch'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20stretch%20to%20x%3A%20%5BX%5D%20y%3A%20%5BY%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20X%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20Y%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'changeStretch'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'change%20stretch%20by%20x%3A%20%5BDX%5D%20y%3A%20%5BDY%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20DX%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20DY%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setStretchX'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20stretch%20x%20to%20%5BX%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20X%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'setStretchY'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'set%20stretch%20y%20to%20%5BY%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20Y%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%20100%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'changeStretchX'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'change%20stretch%20x%20by%20%5BDX%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20DX%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2010%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'changeStretchY'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.COMMAND%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'change%20stretch%20y%20by%20%5BDY%5D'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20arguments%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20DY%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20Scratch.ArgumentType.NUMBER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20defaultValue%3A%2010%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%0A%20%20%20%20%20%20%20%20%20%20'---'%2C%0A%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'getX'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'x%20stretch'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20disableMonitor%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20opcode%3A%20'getY'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20blockType%3A%20Scratch.BlockType.REPORTER%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20text%3A%20'y%20stretch'%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20filter%3A%20%5BScratch.TargetType.SPRITE%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20disableMonitor%3A%20true%2C%0A%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%5D%2C%0A%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%7D%0A%20%20%20%20setStretch(args%2C%20util)%20%7B%0A%20%20%20%20%20%20util.target%5BSTRETCH_X%5D%20%3D%20Scratch.Cast.toNumber(args.X)%3B%0A%20%20%20%20%20%20util.target%5BSTRETCH_Y%5D%20%3D%20Scratch.Cast.toNumber(args.Y)%3B%0A%20%20%20%20%20%20forceUpdateDirectionAndScale(util.target)%3B%0A%20%20%20%20%7D%0A%20%20%20%20changeStretch(args%2C%20util)%20%7B%0A%20%20%20%20%20%20util.target%5BSTRETCH_X%5D%20%2B%3D%20Scratch.Cast.toNumber(args.DX)%3B%0A%20%20%20%20%20%20util.target%5BSTRETCH_Y%5D%20%2B%3D%20Scratch.Cast.toNumber(args.DY)%3B%0A%20%20%20%20%20%20forceUpdateDirectionAndScale(util.target)%3B%0A%20%20%20%20%7D%0A%20%20%20%20setStretchX(args%2C%20util)%20%7B%0A%20%20%20%20%20%20util.target%5BSTRETCH_X%5D%20%3D%20Scratch.Cast.toNumber(args.X)%3B%0A%20%20%20%20%20%20forceUpdateDirectionAndScale(util.target)%3B%0A%20%20%20%20%7D%0A%20%20%20%20setStretchY(args%2C%20util)%20%7B%0A%20%20%20%20%20%20util.target%5BSTRETCH_Y%5D%20%3D%20Scratch.Cast.toNumber(args.Y)%3B%0A%20%20%20%20%20%20forceUpdateDirectionAndScale(util.target)%3B%0A%20%20%20%20%7D%0A%20%20%20%20changeStretchX(args%2C%20util)%20%7B%0A%20%20%20%20%20%20util.target%5BSTRETCH_X%5D%20%2B%3D%20Scratch.Cast.toNumber(args.DX)%3B%0A%20%20%20%20%20%20forceUpdateDirectionAndScale(util.target)%3B%0A%20%20%20%20%7D%0A%20%20%20%20changeStretchY(args%2C%20util)%20%7B%0A%20%20%20%20%20%20util.target%5BSTRETCH_Y%5D%20%2B%3D%20Scratch.Cast.toNumber(args.DY)%3B%0A%20%20%20%20%20%20forceUpdateDirectionAndScale(util.target)%3B%0A%20%20%20%20%7D%0A%20%20%20%20getX(args%2C%20util)%20%7B%0A%20%20%20%20%20%20return%20util.target%5BSTRETCH_X%5D%3B%0A%20%20%20%20%7D%0A%20%20%20%20getY(args%2C%20util)%20%7B%0A%20%20%20%20%20%20return%20util.target%5BSTRETCH_Y%5D%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20Scratch.extensions.register(new%20Stretch())%3B%0A%7D)(Scratch)%3B%0A%20%7D)(Scratch)%3B"]) {
vm.extensionManager.loadExtensionURL(extension);
}
} catch (e) {
handleError(e);
}
</script>
<script>
const getProjectData = (function() {
const storage = scaffolding.storage;
storage.onprogress = (total, loaded) => {
setProgress(interpolate(0.2, 0.98, loaded / total));
};
storage.addWebStore(
[storage.AssetType.ImageVector, storage.AssetType.ImageBitmap, storage.AssetType.Sound],
(asset) => new URL('./assets/' + asset.assetId + '.' + asset.dataFormat, location).href
);
return () => new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.onload = () => {
resolve(xhr.response);
};
xhr.onerror = () => {
if (location.protocol === 'file:') {
reject(new Error('Zip environment must be used from a website, not from a file URL.'));
} else {
reject(new Error('Request to load project data failed.'));
}
};
xhr.onprogress = (e) => {
if (e.lengthComputable) {
setProgress(interpolate(0.1, 0.2, e.loaded / e.total));
}
};
xhr.responseType = 'arraybuffer';
xhr.open('GET', "./assets/project.json");
xhr.send();
});
})();
</script>
<script>
const run = async () => {
const projectData = await getProjectData();
await scaffolding.loadProject(projectData);
setProgress(1);
loadingScreen.hidden = true;
if (true) {
scaffolding.start();
} else {
launchScreen.hidden = false;
launchScreen.addEventListener('click', () => {
launchScreen.hidden = true;
scaffolding.start();
});
launchScreen.focus();
}
};
run().catch(handleError);
</script>
</body>
</html>