quake2ts 0.0.575 → 0.0.577
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/packages/test-utils/dist/index.cjs +672 -87
- package/packages/test-utils/dist/index.cjs.map +1 -1
- package/packages/test-utils/dist/index.d.cts +139 -17
- package/packages/test-utils/dist/index.d.ts +139 -17
- package/packages/test-utils/dist/index.js +667 -87
- package/packages/test-utils/dist/index.js.map +1 -1
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
// src/shared/mocks.ts
|
|
2
8
|
import { vi } from "vitest";
|
|
3
9
|
var createBinaryWriterMock = () => ({
|
|
@@ -74,7 +80,7 @@ var createBinaryStreamMock = () => ({
|
|
|
74
80
|
readCoord: vi.fn(() => 0),
|
|
75
81
|
readAngle: vi.fn(() => 0),
|
|
76
82
|
readAngle16: vi.fn(() => 0),
|
|
77
|
-
readData: vi.fn((
|
|
83
|
+
readData: vi.fn((length2) => new Uint8Array(length2)),
|
|
78
84
|
readPos: vi.fn(),
|
|
79
85
|
readDir: vi.fn()
|
|
80
86
|
});
|
|
@@ -84,10 +90,10 @@ import {
|
|
|
84
90
|
computePlaneSignBits,
|
|
85
91
|
CONTENTS_SOLID
|
|
86
92
|
} from "@quake2ts/shared";
|
|
87
|
-
function makePlane(normal,
|
|
93
|
+
function makePlane(normal, dist2) {
|
|
88
94
|
return {
|
|
89
95
|
normal,
|
|
90
|
-
dist,
|
|
96
|
+
dist: dist2,
|
|
91
97
|
type: Math.abs(normal.x) === 1 ? 0 : Math.abs(normal.y) === 1 ? 1 : Math.abs(normal.z) === 1 ? 2 : 3,
|
|
92
98
|
signbits: computePlaneSignBits(normal)
|
|
93
99
|
};
|
|
@@ -1123,6 +1129,24 @@ async function simulateServerRegistration(server, master) {
|
|
|
1123
1129
|
return master.registerServer(info);
|
|
1124
1130
|
}
|
|
1125
1131
|
|
|
1132
|
+
// src/server/mocks/physics.ts
|
|
1133
|
+
import { vi as vi9 } from "vitest";
|
|
1134
|
+
function createMockCollisionEntityIndex(overrides) {
|
|
1135
|
+
return {
|
|
1136
|
+
trace: vi9.fn().mockReturnValue({
|
|
1137
|
+
fraction: 1,
|
|
1138
|
+
allsolid: false,
|
|
1139
|
+
startsolid: false,
|
|
1140
|
+
endpos: { x: 0, y: 0, z: 0 },
|
|
1141
|
+
entityId: null
|
|
1142
|
+
}),
|
|
1143
|
+
link: vi9.fn(),
|
|
1144
|
+
unlink: vi9.fn(),
|
|
1145
|
+
gatherTriggerTouches: vi9.fn().mockReturnValue([]),
|
|
1146
|
+
...overrides
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1126
1150
|
// src/server/helpers/multiplayer.ts
|
|
1127
1151
|
import { ClientState as ClientState3 } from "@quake2ts/server";
|
|
1128
1152
|
function createMultiplayerTestScenario(numPlayers = 2) {
|
|
@@ -1345,10 +1369,54 @@ import { JSDOM } from "jsdom";
|
|
|
1345
1369
|
import { Canvas, Image, ImageData } from "@napi-rs/canvas";
|
|
1346
1370
|
import "fake-indexeddb/auto";
|
|
1347
1371
|
|
|
1348
|
-
// src/
|
|
1372
|
+
// src/client/mocks/input.ts
|
|
1373
|
+
function createMockKeyboardEvent(key, type = "keydown", modifiers = {}) {
|
|
1374
|
+
return new KeyboardEvent(type, {
|
|
1375
|
+
key,
|
|
1376
|
+
code: key,
|
|
1377
|
+
// Default code to key if not specified (caller can override property if needed)
|
|
1378
|
+
ctrlKey: modifiers.ctrl,
|
|
1379
|
+
altKey: modifiers.alt,
|
|
1380
|
+
shiftKey: modifiers.shift,
|
|
1381
|
+
metaKey: modifiers.meta,
|
|
1382
|
+
bubbles: true,
|
|
1383
|
+
cancelable: true,
|
|
1384
|
+
view: window
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
function createMockMouseEvent(type, options = {}) {
|
|
1388
|
+
const event = new MouseEvent(type, {
|
|
1389
|
+
bubbles: true,
|
|
1390
|
+
cancelable: true,
|
|
1391
|
+
view: window,
|
|
1392
|
+
...options
|
|
1393
|
+
});
|
|
1394
|
+
if (options.movementX !== void 0) {
|
|
1395
|
+
Object.defineProperty(event, "movementX", { value: options.movementX });
|
|
1396
|
+
}
|
|
1397
|
+
if (options.movementY !== void 0) {
|
|
1398
|
+
Object.defineProperty(event, "movementY", { value: options.movementY });
|
|
1399
|
+
}
|
|
1400
|
+
return event;
|
|
1401
|
+
}
|
|
1402
|
+
function createMockWheelEvent(deltaX = 0, deltaY = 0) {
|
|
1403
|
+
return new WheelEvent("wheel", {
|
|
1404
|
+
deltaX,
|
|
1405
|
+
deltaY,
|
|
1406
|
+
bubbles: true,
|
|
1407
|
+
cancelable: true,
|
|
1408
|
+
view: window
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1349
1411
|
var MockPointerLock = class {
|
|
1350
|
-
|
|
1412
|
+
constructor(doc = document) {
|
|
1413
|
+
this._doc = doc;
|
|
1414
|
+
this.setup();
|
|
1415
|
+
}
|
|
1416
|
+
setup() {
|
|
1417
|
+
if (this._doc.__mockPointerLockInstalled) return;
|
|
1351
1418
|
let _pointerLockElement = null;
|
|
1419
|
+
const doc = this._doc;
|
|
1352
1420
|
Object.defineProperty(doc, "pointerLockElement", {
|
|
1353
1421
|
get: () => _pointerLockElement,
|
|
1354
1422
|
configurable: true
|
|
@@ -1359,84 +1427,99 @@ var MockPointerLock = class {
|
|
|
1359
1427
|
doc.dispatchEvent(new Event("pointerlockchange"));
|
|
1360
1428
|
}
|
|
1361
1429
|
};
|
|
1430
|
+
if (!global.HTMLElement.prototype.__originalRequestPointerLock) {
|
|
1431
|
+
global.HTMLElement.prototype.__originalRequestPointerLock = global.HTMLElement.prototype.requestPointerLock;
|
|
1432
|
+
}
|
|
1362
1433
|
global.HTMLElement.prototype.requestPointerLock = function() {
|
|
1363
1434
|
_pointerLockElement = this;
|
|
1364
1435
|
doc.dispatchEvent(new Event("pointerlockchange"));
|
|
1365
1436
|
};
|
|
1437
|
+
doc.__mockPointerLockInstalled = true;
|
|
1438
|
+
}
|
|
1439
|
+
get element() {
|
|
1440
|
+
return this._doc.pointerLockElement;
|
|
1441
|
+
}
|
|
1442
|
+
get locked() {
|
|
1443
|
+
return !!this.element;
|
|
1444
|
+
}
|
|
1445
|
+
request(element) {
|
|
1446
|
+
element.requestPointerLock();
|
|
1447
|
+
}
|
|
1448
|
+
exit() {
|
|
1449
|
+
this._doc.exitPointerLock();
|
|
1450
|
+
}
|
|
1451
|
+
isLocked() {
|
|
1452
|
+
return this.locked;
|
|
1366
1453
|
}
|
|
1367
1454
|
};
|
|
1368
1455
|
var InputInjector = class {
|
|
1369
|
-
constructor(doc, win) {
|
|
1456
|
+
constructor(doc = document, win = window) {
|
|
1370
1457
|
this.doc = doc;
|
|
1371
1458
|
this.win = win;
|
|
1372
1459
|
}
|
|
1373
|
-
keyDown(key, code) {
|
|
1374
|
-
const event =
|
|
1375
|
-
|
|
1376
|
-
code: code
|
|
1377
|
-
|
|
1378
|
-
cancelable: true,
|
|
1379
|
-
view: this.win
|
|
1380
|
-
});
|
|
1460
|
+
keyDown(key, code, modifiers) {
|
|
1461
|
+
const event = createMockKeyboardEvent(key, "keydown", modifiers);
|
|
1462
|
+
if (code) {
|
|
1463
|
+
Object.defineProperty(event, "code", { value: code });
|
|
1464
|
+
}
|
|
1381
1465
|
this.doc.dispatchEvent(event);
|
|
1382
1466
|
}
|
|
1383
|
-
keyUp(key, code) {
|
|
1384
|
-
const event =
|
|
1385
|
-
|
|
1386
|
-
code: code
|
|
1387
|
-
|
|
1388
|
-
cancelable: true,
|
|
1389
|
-
view: this.win
|
|
1390
|
-
});
|
|
1467
|
+
keyUp(key, code, modifiers) {
|
|
1468
|
+
const event = createMockKeyboardEvent(key, "keyup", modifiers);
|
|
1469
|
+
if (code) {
|
|
1470
|
+
Object.defineProperty(event, "code", { value: code });
|
|
1471
|
+
}
|
|
1391
1472
|
this.doc.dispatchEvent(event);
|
|
1392
1473
|
}
|
|
1393
1474
|
mouseMove(movementX, movementY, clientX = 0, clientY = 0) {
|
|
1394
|
-
const event =
|
|
1395
|
-
bubbles: true,
|
|
1396
|
-
cancelable: true,
|
|
1397
|
-
view: this.win,
|
|
1475
|
+
const event = createMockMouseEvent("mousemove", {
|
|
1398
1476
|
clientX,
|
|
1399
1477
|
clientY,
|
|
1400
1478
|
movementX,
|
|
1401
|
-
// Note: JSDOM might not support this standard property fully on event init
|
|
1402
1479
|
movementY
|
|
1403
1480
|
});
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1481
|
+
this.dispatchToTarget(event);
|
|
1482
|
+
}
|
|
1483
|
+
mouseButton(button, state = "down") {
|
|
1484
|
+
if (state === "down") {
|
|
1485
|
+
this.mouseDown(button);
|
|
1486
|
+
} else {
|
|
1487
|
+
this.mouseUp(button);
|
|
1488
|
+
}
|
|
1408
1489
|
}
|
|
1409
1490
|
mouseDown(button = 0) {
|
|
1410
|
-
const event =
|
|
1411
|
-
|
|
1412
|
-
bubbles: true,
|
|
1413
|
-
cancelable: true,
|
|
1414
|
-
view: this.win
|
|
1415
|
-
});
|
|
1416
|
-
const target = this.doc.pointerLockElement || this.doc;
|
|
1417
|
-
target.dispatchEvent(event);
|
|
1491
|
+
const event = createMockMouseEvent("mousedown", { button });
|
|
1492
|
+
this.dispatchToTarget(event);
|
|
1418
1493
|
}
|
|
1419
1494
|
mouseUp(button = 0) {
|
|
1420
|
-
const event =
|
|
1421
|
-
|
|
1422
|
-
bubbles: true,
|
|
1423
|
-
cancelable: true,
|
|
1424
|
-
view: this.win
|
|
1425
|
-
});
|
|
1426
|
-
const target = this.doc.pointerLockElement || this.doc;
|
|
1427
|
-
target.dispatchEvent(event);
|
|
1495
|
+
const event = createMockMouseEvent("mouseup", { button });
|
|
1496
|
+
this.dispatchToTarget(event);
|
|
1428
1497
|
}
|
|
1498
|
+
mouseWheel(deltaY) {
|
|
1499
|
+
const event = createMockWheelEvent(0, deltaY);
|
|
1500
|
+
this.dispatchToTarget(event);
|
|
1501
|
+
}
|
|
1502
|
+
// Alias for backward compatibility/ease of use
|
|
1429
1503
|
wheel(deltaY) {
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
cancelable: true,
|
|
1434
|
-
view: this.win
|
|
1435
|
-
});
|
|
1504
|
+
this.mouseWheel(deltaY);
|
|
1505
|
+
}
|
|
1506
|
+
dispatchToTarget(event) {
|
|
1436
1507
|
const target = this.doc.pointerLockElement || this.doc;
|
|
1437
1508
|
target.dispatchEvent(event);
|
|
1438
1509
|
}
|
|
1439
1510
|
};
|
|
1511
|
+
function createMockPointerLock(element) {
|
|
1512
|
+
const mock = new MockPointerLock();
|
|
1513
|
+
if (element) {
|
|
1514
|
+
mock.request(element);
|
|
1515
|
+
}
|
|
1516
|
+
return mock;
|
|
1517
|
+
}
|
|
1518
|
+
function createInputInjector(target) {
|
|
1519
|
+
const doc = target instanceof Document ? target : document;
|
|
1520
|
+
const win = doc.defaultView ? doc.defaultView : window;
|
|
1521
|
+
return new InputInjector(doc, win);
|
|
1522
|
+
}
|
|
1440
1523
|
|
|
1441
1524
|
// src/setup/webgl.ts
|
|
1442
1525
|
function createMockWebGL2Context(canvas) {
|
|
@@ -1685,17 +1768,17 @@ function setupBrowserEnvironment(options = {}) {
|
|
|
1685
1768
|
};
|
|
1686
1769
|
}
|
|
1687
1770
|
if (typeof global.btoa === "undefined") {
|
|
1688
|
-
global.btoa = function(
|
|
1689
|
-
return Buffer.from(
|
|
1771
|
+
global.btoa = function(str2) {
|
|
1772
|
+
return Buffer.from(str2, "binary").toString("base64");
|
|
1690
1773
|
};
|
|
1691
1774
|
}
|
|
1692
1775
|
if (typeof global.atob === "undefined") {
|
|
1693
|
-
global.atob = function(
|
|
1694
|
-
return Buffer.from(
|
|
1776
|
+
global.atob = function(str2) {
|
|
1777
|
+
return Buffer.from(str2, "base64").toString("binary");
|
|
1695
1778
|
};
|
|
1696
1779
|
}
|
|
1697
1780
|
if (enablePointerLock) {
|
|
1698
|
-
MockPointerLock
|
|
1781
|
+
new MockPointerLock(global.document);
|
|
1699
1782
|
}
|
|
1700
1783
|
if (typeof global.requestAnimationFrame === "undefined") {
|
|
1701
1784
|
let lastTime = 0;
|
|
@@ -1817,10 +1900,10 @@ function createMockImage(width, height, src) {
|
|
|
1817
1900
|
}
|
|
1818
1901
|
|
|
1819
1902
|
// src/engine/mocks/webgpu.ts
|
|
1820
|
-
import { vi as
|
|
1903
|
+
import { vi as vi10 } from "vitest";
|
|
1821
1904
|
function createMockGPUAdapter() {
|
|
1822
1905
|
return {
|
|
1823
|
-
requestDevice:
|
|
1906
|
+
requestDevice: vi10.fn().mockResolvedValue(createMockGPUDevice()),
|
|
1824
1907
|
features: /* @__PURE__ */ new Set(),
|
|
1825
1908
|
limits: {}
|
|
1826
1909
|
};
|
|
@@ -1830,40 +1913,40 @@ function createMockGPUDevice() {
|
|
|
1830
1913
|
features: /* @__PURE__ */ new Set(),
|
|
1831
1914
|
limits: {},
|
|
1832
1915
|
queue: {
|
|
1833
|
-
submit:
|
|
1834
|
-
writeBuffer:
|
|
1835
|
-
writeTexture:
|
|
1836
|
-
copyExternalImageToTexture:
|
|
1837
|
-
},
|
|
1838
|
-
createCommandEncoder:
|
|
1839
|
-
beginRenderPass:
|
|
1840
|
-
setPipeline:
|
|
1841
|
-
draw:
|
|
1842
|
-
end:
|
|
1916
|
+
submit: vi10.fn(),
|
|
1917
|
+
writeBuffer: vi10.fn(),
|
|
1918
|
+
writeTexture: vi10.fn(),
|
|
1919
|
+
copyExternalImageToTexture: vi10.fn()
|
|
1920
|
+
},
|
|
1921
|
+
createCommandEncoder: vi10.fn().mockReturnValue({
|
|
1922
|
+
beginRenderPass: vi10.fn().mockReturnValue({
|
|
1923
|
+
setPipeline: vi10.fn(),
|
|
1924
|
+
draw: vi10.fn(),
|
|
1925
|
+
end: vi10.fn()
|
|
1843
1926
|
}),
|
|
1844
|
-
finish:
|
|
1927
|
+
finish: vi10.fn()
|
|
1845
1928
|
}),
|
|
1846
|
-
createRenderPipeline:
|
|
1847
|
-
createShaderModule:
|
|
1848
|
-
createBindGroup:
|
|
1849
|
-
createBindGroupLayout:
|
|
1850
|
-
createBuffer:
|
|
1851
|
-
createTexture:
|
|
1852
|
-
createSampler:
|
|
1929
|
+
createRenderPipeline: vi10.fn(),
|
|
1930
|
+
createShaderModule: vi10.fn(),
|
|
1931
|
+
createBindGroup: vi10.fn(),
|
|
1932
|
+
createBindGroupLayout: vi10.fn(),
|
|
1933
|
+
createBuffer: vi10.fn(),
|
|
1934
|
+
createTexture: vi10.fn(),
|
|
1935
|
+
createSampler: vi10.fn()
|
|
1853
1936
|
};
|
|
1854
1937
|
}
|
|
1855
1938
|
function createMockGPUCanvasContext() {
|
|
1856
1939
|
return {
|
|
1857
|
-
configure:
|
|
1858
|
-
unconfigure:
|
|
1859
|
-
getCurrentTexture:
|
|
1940
|
+
configure: vi10.fn(),
|
|
1941
|
+
unconfigure: vi10.fn(),
|
|
1942
|
+
getCurrentTexture: vi10.fn()
|
|
1860
1943
|
};
|
|
1861
1944
|
}
|
|
1862
1945
|
function setupWebGPUMocks() {
|
|
1863
1946
|
const mockAdapter = createMockGPUAdapter();
|
|
1864
1947
|
const mockGpu = {
|
|
1865
|
-
requestAdapter:
|
|
1866
|
-
getPreferredCanvasFormat:
|
|
1948
|
+
requestAdapter: vi10.fn().mockResolvedValue(mockAdapter),
|
|
1949
|
+
getPreferredCanvasFormat: vi10.fn().mockReturnValue("bgra8unorm")
|
|
1867
1950
|
};
|
|
1868
1951
|
Object.defineProperty(global.navigator, "gpu", {
|
|
1869
1952
|
value: mockGpu,
|
|
@@ -2206,12 +2289,12 @@ function createMockAudioContext() {
|
|
|
2206
2289
|
numberOfChannels: 2,
|
|
2207
2290
|
getChannelData: () => new Float32Array(44100)
|
|
2208
2291
|
}),
|
|
2209
|
-
createBuffer: (channels,
|
|
2210
|
-
duration:
|
|
2211
|
-
length,
|
|
2292
|
+
createBuffer: (channels, length2, sampleRate) => ({
|
|
2293
|
+
duration: length2 / sampleRate,
|
|
2294
|
+
length: length2,
|
|
2212
2295
|
sampleRate,
|
|
2213
2296
|
numberOfChannels: channels,
|
|
2214
|
-
getChannelData: () => new Float32Array(
|
|
2297
|
+
getChannelData: () => new Float32Array(length2)
|
|
2215
2298
|
}),
|
|
2216
2299
|
// Helper to track events if needed
|
|
2217
2300
|
_events: []
|
|
@@ -2252,6 +2335,492 @@ function captureAudioEvents(context) {
|
|
|
2252
2335
|
return context._events || [];
|
|
2253
2336
|
}
|
|
2254
2337
|
|
|
2338
|
+
// ../../node_modules/.pnpm/gl-matrix@3.4.4/node_modules/gl-matrix/esm/common.js
|
|
2339
|
+
var EPSILON = 1e-6;
|
|
2340
|
+
var ARRAY_TYPE = typeof Float32Array !== "undefined" ? Float32Array : Array;
|
|
2341
|
+
var RANDOM = Math.random;
|
|
2342
|
+
function round(a) {
|
|
2343
|
+
if (a >= 0) return Math.round(a);
|
|
2344
|
+
return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);
|
|
2345
|
+
}
|
|
2346
|
+
var degree = Math.PI / 180;
|
|
2347
|
+
var radian = 180 / Math.PI;
|
|
2348
|
+
|
|
2349
|
+
// ../../node_modules/.pnpm/gl-matrix@3.4.4/node_modules/gl-matrix/esm/vec3.js
|
|
2350
|
+
var vec3_exports = {};
|
|
2351
|
+
__export(vec3_exports, {
|
|
2352
|
+
add: () => add,
|
|
2353
|
+
angle: () => angle,
|
|
2354
|
+
bezier: () => bezier,
|
|
2355
|
+
ceil: () => ceil,
|
|
2356
|
+
clone: () => clone,
|
|
2357
|
+
copy: () => copy,
|
|
2358
|
+
create: () => create,
|
|
2359
|
+
cross: () => cross,
|
|
2360
|
+
dist: () => dist,
|
|
2361
|
+
distance: () => distance,
|
|
2362
|
+
div: () => div,
|
|
2363
|
+
divide: () => divide,
|
|
2364
|
+
dot: () => dot,
|
|
2365
|
+
equals: () => equals,
|
|
2366
|
+
exactEquals: () => exactEquals,
|
|
2367
|
+
floor: () => floor,
|
|
2368
|
+
forEach: () => forEach,
|
|
2369
|
+
fromValues: () => fromValues,
|
|
2370
|
+
hermite: () => hermite,
|
|
2371
|
+
inverse: () => inverse,
|
|
2372
|
+
len: () => len,
|
|
2373
|
+
length: () => length,
|
|
2374
|
+
lerp: () => lerp,
|
|
2375
|
+
max: () => max,
|
|
2376
|
+
min: () => min,
|
|
2377
|
+
mul: () => mul,
|
|
2378
|
+
multiply: () => multiply,
|
|
2379
|
+
negate: () => negate,
|
|
2380
|
+
normalize: () => normalize,
|
|
2381
|
+
random: () => random,
|
|
2382
|
+
rotateX: () => rotateX,
|
|
2383
|
+
rotateY: () => rotateY,
|
|
2384
|
+
rotateZ: () => rotateZ,
|
|
2385
|
+
round: () => round2,
|
|
2386
|
+
scale: () => scale,
|
|
2387
|
+
scaleAndAdd: () => scaleAndAdd,
|
|
2388
|
+
set: () => set,
|
|
2389
|
+
slerp: () => slerp,
|
|
2390
|
+
sqrDist: () => sqrDist,
|
|
2391
|
+
sqrLen: () => sqrLen,
|
|
2392
|
+
squaredDistance: () => squaredDistance,
|
|
2393
|
+
squaredLength: () => squaredLength,
|
|
2394
|
+
str: () => str,
|
|
2395
|
+
sub: () => sub,
|
|
2396
|
+
subtract: () => subtract,
|
|
2397
|
+
transformMat3: () => transformMat3,
|
|
2398
|
+
transformMat4: () => transformMat4,
|
|
2399
|
+
transformQuat: () => transformQuat,
|
|
2400
|
+
zero: () => zero
|
|
2401
|
+
});
|
|
2402
|
+
function create() {
|
|
2403
|
+
var out = new ARRAY_TYPE(3);
|
|
2404
|
+
if (ARRAY_TYPE != Float32Array) {
|
|
2405
|
+
out[0] = 0;
|
|
2406
|
+
out[1] = 0;
|
|
2407
|
+
out[2] = 0;
|
|
2408
|
+
}
|
|
2409
|
+
return out;
|
|
2410
|
+
}
|
|
2411
|
+
function clone(a) {
|
|
2412
|
+
var out = new ARRAY_TYPE(3);
|
|
2413
|
+
out[0] = a[0];
|
|
2414
|
+
out[1] = a[1];
|
|
2415
|
+
out[2] = a[2];
|
|
2416
|
+
return out;
|
|
2417
|
+
}
|
|
2418
|
+
function length(a) {
|
|
2419
|
+
var x = a[0];
|
|
2420
|
+
var y = a[1];
|
|
2421
|
+
var z = a[2];
|
|
2422
|
+
return Math.sqrt(x * x + y * y + z * z);
|
|
2423
|
+
}
|
|
2424
|
+
function fromValues(x, y, z) {
|
|
2425
|
+
var out = new ARRAY_TYPE(3);
|
|
2426
|
+
out[0] = x;
|
|
2427
|
+
out[1] = y;
|
|
2428
|
+
out[2] = z;
|
|
2429
|
+
return out;
|
|
2430
|
+
}
|
|
2431
|
+
function copy(out, a) {
|
|
2432
|
+
out[0] = a[0];
|
|
2433
|
+
out[1] = a[1];
|
|
2434
|
+
out[2] = a[2];
|
|
2435
|
+
return out;
|
|
2436
|
+
}
|
|
2437
|
+
function set(out, x, y, z) {
|
|
2438
|
+
out[0] = x;
|
|
2439
|
+
out[1] = y;
|
|
2440
|
+
out[2] = z;
|
|
2441
|
+
return out;
|
|
2442
|
+
}
|
|
2443
|
+
function add(out, a, b) {
|
|
2444
|
+
out[0] = a[0] + b[0];
|
|
2445
|
+
out[1] = a[1] + b[1];
|
|
2446
|
+
out[2] = a[2] + b[2];
|
|
2447
|
+
return out;
|
|
2448
|
+
}
|
|
2449
|
+
function subtract(out, a, b) {
|
|
2450
|
+
out[0] = a[0] - b[0];
|
|
2451
|
+
out[1] = a[1] - b[1];
|
|
2452
|
+
out[2] = a[2] - b[2];
|
|
2453
|
+
return out;
|
|
2454
|
+
}
|
|
2455
|
+
function multiply(out, a, b) {
|
|
2456
|
+
out[0] = a[0] * b[0];
|
|
2457
|
+
out[1] = a[1] * b[1];
|
|
2458
|
+
out[2] = a[2] * b[2];
|
|
2459
|
+
return out;
|
|
2460
|
+
}
|
|
2461
|
+
function divide(out, a, b) {
|
|
2462
|
+
out[0] = a[0] / b[0];
|
|
2463
|
+
out[1] = a[1] / b[1];
|
|
2464
|
+
out[2] = a[2] / b[2];
|
|
2465
|
+
return out;
|
|
2466
|
+
}
|
|
2467
|
+
function ceil(out, a) {
|
|
2468
|
+
out[0] = Math.ceil(a[0]);
|
|
2469
|
+
out[1] = Math.ceil(a[1]);
|
|
2470
|
+
out[2] = Math.ceil(a[2]);
|
|
2471
|
+
return out;
|
|
2472
|
+
}
|
|
2473
|
+
function floor(out, a) {
|
|
2474
|
+
out[0] = Math.floor(a[0]);
|
|
2475
|
+
out[1] = Math.floor(a[1]);
|
|
2476
|
+
out[2] = Math.floor(a[2]);
|
|
2477
|
+
return out;
|
|
2478
|
+
}
|
|
2479
|
+
function min(out, a, b) {
|
|
2480
|
+
out[0] = Math.min(a[0], b[0]);
|
|
2481
|
+
out[1] = Math.min(a[1], b[1]);
|
|
2482
|
+
out[2] = Math.min(a[2], b[2]);
|
|
2483
|
+
return out;
|
|
2484
|
+
}
|
|
2485
|
+
function max(out, a, b) {
|
|
2486
|
+
out[0] = Math.max(a[0], b[0]);
|
|
2487
|
+
out[1] = Math.max(a[1], b[1]);
|
|
2488
|
+
out[2] = Math.max(a[2], b[2]);
|
|
2489
|
+
return out;
|
|
2490
|
+
}
|
|
2491
|
+
function round2(out, a) {
|
|
2492
|
+
out[0] = round(a[0]);
|
|
2493
|
+
out[1] = round(a[1]);
|
|
2494
|
+
out[2] = round(a[2]);
|
|
2495
|
+
return out;
|
|
2496
|
+
}
|
|
2497
|
+
function scale(out, a, b) {
|
|
2498
|
+
out[0] = a[0] * b;
|
|
2499
|
+
out[1] = a[1] * b;
|
|
2500
|
+
out[2] = a[2] * b;
|
|
2501
|
+
return out;
|
|
2502
|
+
}
|
|
2503
|
+
function scaleAndAdd(out, a, b, scale2) {
|
|
2504
|
+
out[0] = a[0] + b[0] * scale2;
|
|
2505
|
+
out[1] = a[1] + b[1] * scale2;
|
|
2506
|
+
out[2] = a[2] + b[2] * scale2;
|
|
2507
|
+
return out;
|
|
2508
|
+
}
|
|
2509
|
+
function distance(a, b) {
|
|
2510
|
+
var x = b[0] - a[0];
|
|
2511
|
+
var y = b[1] - a[1];
|
|
2512
|
+
var z = b[2] - a[2];
|
|
2513
|
+
return Math.sqrt(x * x + y * y + z * z);
|
|
2514
|
+
}
|
|
2515
|
+
function squaredDistance(a, b) {
|
|
2516
|
+
var x = b[0] - a[0];
|
|
2517
|
+
var y = b[1] - a[1];
|
|
2518
|
+
var z = b[2] - a[2];
|
|
2519
|
+
return x * x + y * y + z * z;
|
|
2520
|
+
}
|
|
2521
|
+
function squaredLength(a) {
|
|
2522
|
+
var x = a[0];
|
|
2523
|
+
var y = a[1];
|
|
2524
|
+
var z = a[2];
|
|
2525
|
+
return x * x + y * y + z * z;
|
|
2526
|
+
}
|
|
2527
|
+
function negate(out, a) {
|
|
2528
|
+
out[0] = -a[0];
|
|
2529
|
+
out[1] = -a[1];
|
|
2530
|
+
out[2] = -a[2];
|
|
2531
|
+
return out;
|
|
2532
|
+
}
|
|
2533
|
+
function inverse(out, a) {
|
|
2534
|
+
out[0] = 1 / a[0];
|
|
2535
|
+
out[1] = 1 / a[1];
|
|
2536
|
+
out[2] = 1 / a[2];
|
|
2537
|
+
return out;
|
|
2538
|
+
}
|
|
2539
|
+
function normalize(out, a) {
|
|
2540
|
+
var x = a[0];
|
|
2541
|
+
var y = a[1];
|
|
2542
|
+
var z = a[2];
|
|
2543
|
+
var len2 = x * x + y * y + z * z;
|
|
2544
|
+
if (len2 > 0) {
|
|
2545
|
+
len2 = 1 / Math.sqrt(len2);
|
|
2546
|
+
}
|
|
2547
|
+
out[0] = a[0] * len2;
|
|
2548
|
+
out[1] = a[1] * len2;
|
|
2549
|
+
out[2] = a[2] * len2;
|
|
2550
|
+
return out;
|
|
2551
|
+
}
|
|
2552
|
+
function dot(a, b) {
|
|
2553
|
+
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
2554
|
+
}
|
|
2555
|
+
function cross(out, a, b) {
|
|
2556
|
+
var ax = a[0], ay = a[1], az = a[2];
|
|
2557
|
+
var bx = b[0], by = b[1], bz = b[2];
|
|
2558
|
+
out[0] = ay * bz - az * by;
|
|
2559
|
+
out[1] = az * bx - ax * bz;
|
|
2560
|
+
out[2] = ax * by - ay * bx;
|
|
2561
|
+
return out;
|
|
2562
|
+
}
|
|
2563
|
+
function lerp(out, a, b, t) {
|
|
2564
|
+
var ax = a[0];
|
|
2565
|
+
var ay = a[1];
|
|
2566
|
+
var az = a[2];
|
|
2567
|
+
out[0] = ax + t * (b[0] - ax);
|
|
2568
|
+
out[1] = ay + t * (b[1] - ay);
|
|
2569
|
+
out[2] = az + t * (b[2] - az);
|
|
2570
|
+
return out;
|
|
2571
|
+
}
|
|
2572
|
+
function slerp(out, a, b, t) {
|
|
2573
|
+
var angle2 = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));
|
|
2574
|
+
var sinTotal = Math.sin(angle2);
|
|
2575
|
+
var ratioA = Math.sin((1 - t) * angle2) / sinTotal;
|
|
2576
|
+
var ratioB = Math.sin(t * angle2) / sinTotal;
|
|
2577
|
+
out[0] = ratioA * a[0] + ratioB * b[0];
|
|
2578
|
+
out[1] = ratioA * a[1] + ratioB * b[1];
|
|
2579
|
+
out[2] = ratioA * a[2] + ratioB * b[2];
|
|
2580
|
+
return out;
|
|
2581
|
+
}
|
|
2582
|
+
function hermite(out, a, b, c, d, t) {
|
|
2583
|
+
var factorTimes2 = t * t;
|
|
2584
|
+
var factor1 = factorTimes2 * (2 * t - 3) + 1;
|
|
2585
|
+
var factor2 = factorTimes2 * (t - 2) + t;
|
|
2586
|
+
var factor3 = factorTimes2 * (t - 1);
|
|
2587
|
+
var factor4 = factorTimes2 * (3 - 2 * t);
|
|
2588
|
+
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
2589
|
+
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
2590
|
+
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
2591
|
+
return out;
|
|
2592
|
+
}
|
|
2593
|
+
function bezier(out, a, b, c, d, t) {
|
|
2594
|
+
var inverseFactor = 1 - t;
|
|
2595
|
+
var inverseFactorTimesTwo = inverseFactor * inverseFactor;
|
|
2596
|
+
var factorTimes2 = t * t;
|
|
2597
|
+
var factor1 = inverseFactorTimesTwo * inverseFactor;
|
|
2598
|
+
var factor2 = 3 * t * inverseFactorTimesTwo;
|
|
2599
|
+
var factor3 = 3 * factorTimes2 * inverseFactor;
|
|
2600
|
+
var factor4 = factorTimes2 * t;
|
|
2601
|
+
out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;
|
|
2602
|
+
out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;
|
|
2603
|
+
out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;
|
|
2604
|
+
return out;
|
|
2605
|
+
}
|
|
2606
|
+
function random(out, scale2) {
|
|
2607
|
+
scale2 = scale2 === void 0 ? 1 : scale2;
|
|
2608
|
+
var r = RANDOM() * 2 * Math.PI;
|
|
2609
|
+
var z = RANDOM() * 2 - 1;
|
|
2610
|
+
var zScale = Math.sqrt(1 - z * z) * scale2;
|
|
2611
|
+
out[0] = Math.cos(r) * zScale;
|
|
2612
|
+
out[1] = Math.sin(r) * zScale;
|
|
2613
|
+
out[2] = z * scale2;
|
|
2614
|
+
return out;
|
|
2615
|
+
}
|
|
2616
|
+
function transformMat4(out, a, m) {
|
|
2617
|
+
var x = a[0], y = a[1], z = a[2];
|
|
2618
|
+
var w = m[3] * x + m[7] * y + m[11] * z + m[15];
|
|
2619
|
+
w = w || 1;
|
|
2620
|
+
out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
|
|
2621
|
+
out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
|
|
2622
|
+
out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
|
|
2623
|
+
return out;
|
|
2624
|
+
}
|
|
2625
|
+
function transformMat3(out, a, m) {
|
|
2626
|
+
var x = a[0], y = a[1], z = a[2];
|
|
2627
|
+
out[0] = x * m[0] + y * m[3] + z * m[6];
|
|
2628
|
+
out[1] = x * m[1] + y * m[4] + z * m[7];
|
|
2629
|
+
out[2] = x * m[2] + y * m[5] + z * m[8];
|
|
2630
|
+
return out;
|
|
2631
|
+
}
|
|
2632
|
+
function transformQuat(out, a, q) {
|
|
2633
|
+
var qx = q[0], qy = q[1], qz = q[2], qw = q[3];
|
|
2634
|
+
var vx = a[0], vy = a[1], vz = a[2];
|
|
2635
|
+
var tx = qy * vz - qz * vy;
|
|
2636
|
+
var ty = qz * vx - qx * vz;
|
|
2637
|
+
var tz = qx * vy - qy * vx;
|
|
2638
|
+
tx = tx + tx;
|
|
2639
|
+
ty = ty + ty;
|
|
2640
|
+
tz = tz + tz;
|
|
2641
|
+
out[0] = vx + qw * tx + qy * tz - qz * ty;
|
|
2642
|
+
out[1] = vy + qw * ty + qz * tx - qx * tz;
|
|
2643
|
+
out[2] = vz + qw * tz + qx * ty - qy * tx;
|
|
2644
|
+
return out;
|
|
2645
|
+
}
|
|
2646
|
+
function rotateX(out, a, b, rad) {
|
|
2647
|
+
var p = [], r = [];
|
|
2648
|
+
p[0] = a[0] - b[0];
|
|
2649
|
+
p[1] = a[1] - b[1];
|
|
2650
|
+
p[2] = a[2] - b[2];
|
|
2651
|
+
r[0] = p[0];
|
|
2652
|
+
r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);
|
|
2653
|
+
r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);
|
|
2654
|
+
out[0] = r[0] + b[0];
|
|
2655
|
+
out[1] = r[1] + b[1];
|
|
2656
|
+
out[2] = r[2] + b[2];
|
|
2657
|
+
return out;
|
|
2658
|
+
}
|
|
2659
|
+
function rotateY(out, a, b, rad) {
|
|
2660
|
+
var p = [], r = [];
|
|
2661
|
+
p[0] = a[0] - b[0];
|
|
2662
|
+
p[1] = a[1] - b[1];
|
|
2663
|
+
p[2] = a[2] - b[2];
|
|
2664
|
+
r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);
|
|
2665
|
+
r[1] = p[1];
|
|
2666
|
+
r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);
|
|
2667
|
+
out[0] = r[0] + b[0];
|
|
2668
|
+
out[1] = r[1] + b[1];
|
|
2669
|
+
out[2] = r[2] + b[2];
|
|
2670
|
+
return out;
|
|
2671
|
+
}
|
|
2672
|
+
function rotateZ(out, a, b, rad) {
|
|
2673
|
+
var p = [], r = [];
|
|
2674
|
+
p[0] = a[0] - b[0];
|
|
2675
|
+
p[1] = a[1] - b[1];
|
|
2676
|
+
p[2] = a[2] - b[2];
|
|
2677
|
+
r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);
|
|
2678
|
+
r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);
|
|
2679
|
+
r[2] = p[2];
|
|
2680
|
+
out[0] = r[0] + b[0];
|
|
2681
|
+
out[1] = r[1] + b[1];
|
|
2682
|
+
out[2] = r[2] + b[2];
|
|
2683
|
+
return out;
|
|
2684
|
+
}
|
|
2685
|
+
function angle(a, b) {
|
|
2686
|
+
var ax = a[0], ay = a[1], az = a[2], bx = b[0], by = b[1], bz = b[2], mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)), cosine = mag && dot(a, b) / mag;
|
|
2687
|
+
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
2688
|
+
}
|
|
2689
|
+
function zero(out) {
|
|
2690
|
+
out[0] = 0;
|
|
2691
|
+
out[1] = 0;
|
|
2692
|
+
out[2] = 0;
|
|
2693
|
+
return out;
|
|
2694
|
+
}
|
|
2695
|
+
function str(a) {
|
|
2696
|
+
return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")";
|
|
2697
|
+
}
|
|
2698
|
+
function exactEquals(a, b) {
|
|
2699
|
+
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
2700
|
+
}
|
|
2701
|
+
function equals(a, b) {
|
|
2702
|
+
var a0 = a[0], a1 = a[1], a2 = a[2];
|
|
2703
|
+
var b0 = b[0], b1 = b[1], b2 = b[2];
|
|
2704
|
+
return Math.abs(a0 - b0) <= EPSILON * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= EPSILON * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= EPSILON * Math.max(1, Math.abs(a2), Math.abs(b2));
|
|
2705
|
+
}
|
|
2706
|
+
var sub = subtract;
|
|
2707
|
+
var mul = multiply;
|
|
2708
|
+
var div = divide;
|
|
2709
|
+
var dist = distance;
|
|
2710
|
+
var sqrDist = squaredDistance;
|
|
2711
|
+
var len = length;
|
|
2712
|
+
var sqrLen = squaredLength;
|
|
2713
|
+
var forEach = (function() {
|
|
2714
|
+
var vec = create();
|
|
2715
|
+
return function(a, stride, offset, count, fn, arg) {
|
|
2716
|
+
var i, l;
|
|
2717
|
+
if (!stride) {
|
|
2718
|
+
stride = 3;
|
|
2719
|
+
}
|
|
2720
|
+
if (!offset) {
|
|
2721
|
+
offset = 0;
|
|
2722
|
+
}
|
|
2723
|
+
if (count) {
|
|
2724
|
+
l = Math.min(count * stride + offset, a.length);
|
|
2725
|
+
} else {
|
|
2726
|
+
l = a.length;
|
|
2727
|
+
}
|
|
2728
|
+
for (i = offset; i < l; i += stride) {
|
|
2729
|
+
vec[0] = a[i];
|
|
2730
|
+
vec[1] = a[i + 1];
|
|
2731
|
+
vec[2] = a[i + 2];
|
|
2732
|
+
fn(vec, vec, arg);
|
|
2733
|
+
a[i] = vec[0];
|
|
2734
|
+
a[i + 1] = vec[1];
|
|
2735
|
+
a[i + 2] = vec[2];
|
|
2736
|
+
}
|
|
2737
|
+
return a;
|
|
2738
|
+
};
|
|
2739
|
+
})();
|
|
2740
|
+
|
|
2741
|
+
// src/client/helpers/view.ts
|
|
2742
|
+
import { Camera } from "@quake2ts/engine";
|
|
2743
|
+
function createMockCamera(overrides = {}) {
|
|
2744
|
+
const camera = new Camera();
|
|
2745
|
+
if (overrides.position) {
|
|
2746
|
+
camera.position = overrides.position;
|
|
2747
|
+
}
|
|
2748
|
+
if (overrides.angles) {
|
|
2749
|
+
camera.angles = overrides.angles;
|
|
2750
|
+
}
|
|
2751
|
+
if (overrides.fov !== void 0) {
|
|
2752
|
+
camera.fov = overrides.fov;
|
|
2753
|
+
}
|
|
2754
|
+
return camera;
|
|
2755
|
+
}
|
|
2756
|
+
function createMockRefDef(overrides = {}) {
|
|
2757
|
+
return {
|
|
2758
|
+
x: 0,
|
|
2759
|
+
y: 0,
|
|
2760
|
+
width: 320,
|
|
2761
|
+
height: 240,
|
|
2762
|
+
fov_x: 90,
|
|
2763
|
+
fov_y: 90,
|
|
2764
|
+
vieworg: vec3_exports.create(),
|
|
2765
|
+
viewangles: vec3_exports.create(),
|
|
2766
|
+
time: 0,
|
|
2767
|
+
rdflags: 0,
|
|
2768
|
+
...overrides
|
|
2769
|
+
};
|
|
2770
|
+
}
|
|
2771
|
+
function createMockViewState(overrides = {}) {
|
|
2772
|
+
return {
|
|
2773
|
+
camera: overrides.camera || createMockCamera(),
|
|
2774
|
+
viewport: overrides.viewport || { x: 0, y: 0, width: 800, height: 600 },
|
|
2775
|
+
refdef: overrides.refdef || createMockRefDef(),
|
|
2776
|
+
...overrides
|
|
2777
|
+
};
|
|
2778
|
+
}
|
|
2779
|
+
function createViewTestScenario(scenarioType) {
|
|
2780
|
+
const camera = createMockCamera();
|
|
2781
|
+
const refdef = createMockRefDef();
|
|
2782
|
+
switch (scenarioType) {
|
|
2783
|
+
case "firstPerson":
|
|
2784
|
+
camera.position = vec3_exports.fromValues(100, 100, 50);
|
|
2785
|
+
camera.angles = vec3_exports.fromValues(0, 45, 0);
|
|
2786
|
+
vec3_exports.copy(refdef.vieworg, camera.position);
|
|
2787
|
+
vec3_exports.copy(refdef.viewangles, camera.angles);
|
|
2788
|
+
break;
|
|
2789
|
+
case "thirdPerson":
|
|
2790
|
+
camera.position = vec3_exports.fromValues(100, 100, 100);
|
|
2791
|
+
camera.angles = vec3_exports.fromValues(30, 45, 0);
|
|
2792
|
+
vec3_exports.set(refdef.vieworg, 100, 100, 50);
|
|
2793
|
+
break;
|
|
2794
|
+
case "spectator":
|
|
2795
|
+
camera.position = vec3_exports.fromValues(0, 0, 100);
|
|
2796
|
+
camera.angles = vec3_exports.fromValues(90, 0, 0);
|
|
2797
|
+
break;
|
|
2798
|
+
}
|
|
2799
|
+
return {
|
|
2800
|
+
viewState: {
|
|
2801
|
+
camera,
|
|
2802
|
+
viewport: { x: 0, y: 0, width: 800, height: 600 },
|
|
2803
|
+
refdef
|
|
2804
|
+
},
|
|
2805
|
+
cleanup: () => {
|
|
2806
|
+
}
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
function simulateCameraMovement(camera, input, deltaTime) {
|
|
2810
|
+
const speed = 100;
|
|
2811
|
+
if (input.pitchDelta) camera.angles[0] += input.pitchDelta;
|
|
2812
|
+
if (input.yawDelta) camera.angles[1] += input.yawDelta;
|
|
2813
|
+
if (input.rollDelta) camera.angles[2] += input.rollDelta;
|
|
2814
|
+
camera.angles = camera.angles;
|
|
2815
|
+
if (input.forward || input.right || input.up) {
|
|
2816
|
+
camera.position[0] += (input.forward || 0) * deltaTime;
|
|
2817
|
+
camera.position[1] += (input.right || 0) * deltaTime;
|
|
2818
|
+
camera.position[2] += (input.up || 0) * deltaTime;
|
|
2819
|
+
camera.position = camera.position;
|
|
2820
|
+
}
|
|
2821
|
+
return camera;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2255
2824
|
// src/e2e/playwright.ts
|
|
2256
2825
|
import { chromium } from "playwright";
|
|
2257
2826
|
import { createServer } from "http";
|
|
@@ -2488,13 +3057,16 @@ export {
|
|
|
2488
3057
|
createEntityFactory,
|
|
2489
3058
|
createEntityStateFactory,
|
|
2490
3059
|
createGameStateSnapshotFactory,
|
|
3060
|
+
createInputInjector,
|
|
2491
3061
|
createItemEntityFactory,
|
|
2492
3062
|
createMockAI,
|
|
2493
3063
|
createMockAmmoItem,
|
|
2494
3064
|
createMockArmorItem,
|
|
2495
3065
|
createMockAudioContext,
|
|
3066
|
+
createMockCamera,
|
|
2496
3067
|
createMockCanvas,
|
|
2497
3068
|
createMockCanvasContext2D,
|
|
3069
|
+
createMockCollisionEntityIndex,
|
|
2498
3070
|
createMockConnection,
|
|
2499
3071
|
createMockDamageInfo,
|
|
2500
3072
|
createMockEngine,
|
|
@@ -2511,17 +3083,21 @@ export {
|
|
|
2511
3083
|
createMockIndexedDB,
|
|
2512
3084
|
createMockInventory,
|
|
2513
3085
|
createMockItem,
|
|
3086
|
+
createMockKeyboardEvent,
|
|
2514
3087
|
createMockLocalStorage,
|
|
2515
3088
|
createMockMasterServer,
|
|
2516
3089
|
createMockMonsterAI,
|
|
2517
3090
|
createMockMonsterMove,
|
|
3091
|
+
createMockMouseEvent,
|
|
2518
3092
|
createMockNetDriver,
|
|
2519
3093
|
createMockNetworkAddress,
|
|
2520
3094
|
createMockPerformance,
|
|
3095
|
+
createMockPointerLock,
|
|
2521
3096
|
createMockPowerupItem,
|
|
2522
3097
|
createMockRAF,
|
|
2523
3098
|
createMockRConClient,
|
|
2524
3099
|
createMockRateLimiter,
|
|
3100
|
+
createMockRefDef,
|
|
2525
3101
|
createMockServer,
|
|
2526
3102
|
createMockServerClient,
|
|
2527
3103
|
createMockServerConsole,
|
|
@@ -2532,9 +3108,11 @@ export {
|
|
|
2532
3108
|
createMockTransport,
|
|
2533
3109
|
createMockUDPSocket,
|
|
2534
3110
|
createMockUserInfo,
|
|
3111
|
+
createMockViewState,
|
|
2535
3112
|
createMockWeapon,
|
|
2536
3113
|
createMockWeaponItem,
|
|
2537
3114
|
createMockWebGL2Context,
|
|
3115
|
+
createMockWheelEvent,
|
|
2538
3116
|
createMonsterEntityFactory,
|
|
2539
3117
|
createMultiplayerTestScenario,
|
|
2540
3118
|
createNetChanMock,
|
|
@@ -2548,6 +3126,7 @@ export {
|
|
|
2548
3126
|
createStorageTestScenario,
|
|
2549
3127
|
createTestContext,
|
|
2550
3128
|
createTriggerEntityFactory,
|
|
3129
|
+
createViewTestScenario,
|
|
2551
3130
|
createVisualTestScenario,
|
|
2552
3131
|
intersects,
|
|
2553
3132
|
ladderTrace,
|
|
@@ -2566,6 +3145,7 @@ export {
|
|
|
2566
3145
|
setupNodeEnvironment,
|
|
2567
3146
|
setupWebGPUMocks,
|
|
2568
3147
|
simulateBandwidthLimit,
|
|
3148
|
+
simulateCameraMovement,
|
|
2569
3149
|
simulateFrames,
|
|
2570
3150
|
simulateFramesWithMock,
|
|
2571
3151
|
simulateHandshake,
|