quake2ts 0.0.577 → 0.0.579
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 +3 -3
- package/packages/client/dist/browser/index.global.js +16 -16
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +0 -1
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +0 -1
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/browser/index.global.js +11 -11
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +4 -167
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +4 -167
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/assets/md2.d.ts +5 -1
- package/packages/engine/dist/types/assets/md2.d.ts.map +1 -1
- package/packages/engine/dist/types/render/renderer.d.ts +1 -0
- package/packages/engine/dist/types/render/renderer.d.ts.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/tools/dist/browser/index.global.js +212 -2
- package/packages/tools/dist/browser/index.global.js.map +1 -1
- package/packages/tools/dist/cjs/index.cjs +971 -2
- package/packages/tools/dist/cjs/index.cjs.map +1 -1
- package/packages/tools/dist/esm/index.js +969 -1
- package/packages/tools/dist/esm/index.js.map +1 -1
- package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/tools/dist/types/bspTools.d.ts +9 -0
- package/packages/tools/dist/types/bspTools.d.ts.map +1 -0
- package/packages/tools/dist/types/index.d.ts +1 -0
- package/packages/tools/dist/types/index.d.ts.map +1 -1
|
@@ -3388,171 +3388,7 @@ function createFaceLightmap(face, lightMaps, info) {
|
|
|
3388
3388
|
// src/assets/md2.ts
|
|
3389
3389
|
var MD2_MAGIC = 844121161;
|
|
3390
3390
|
var MD2_VERSION = 8;
|
|
3391
|
-
var HEADER_SIZE5 =
|
|
3392
|
-
var MD2_NORMALS = [
|
|
3393
|
-
{ x: -0.525731, y: 0, z: 0.850651 },
|
|
3394
|
-
{ x: -0.442863, y: 0.238856, z: 0.864188 },
|
|
3395
|
-
{ x: -0.295242, y: 0, z: 0.955423 },
|
|
3396
|
-
{ x: -0.309017, y: 0.5, z: 0.809017 },
|
|
3397
|
-
{ x: -0.16246, y: 0.262866, z: 0.951056 },
|
|
3398
|
-
{ x: 0, y: 0, z: 1 },
|
|
3399
|
-
{ x: 0, y: 0.850651, z: 0.525731 },
|
|
3400
|
-
{ x: -0.147621, y: 0.716567, z: 0.681718 },
|
|
3401
|
-
{ x: 0.147621, y: 0.716567, z: 0.681718 },
|
|
3402
|
-
{ x: 0, y: 0.525731, z: 0.850651 },
|
|
3403
|
-
{ x: 0.309017, y: 0.5, z: 0.809017 },
|
|
3404
|
-
{ x: 0.525731, y: 0, z: 0.850651 },
|
|
3405
|
-
{ x: 0.295242, y: 0, z: 0.955423 },
|
|
3406
|
-
{ x: 0.442863, y: 0.238856, z: 0.864188 },
|
|
3407
|
-
{ x: 0.16246, y: 0.262866, z: 0.951056 },
|
|
3408
|
-
{ x: -0.681718, y: 0.147621, z: 0.716567 },
|
|
3409
|
-
{ x: -0.809017, y: 0.309017, z: 0.5 },
|
|
3410
|
-
{ x: -0.587785, y: 0.425325, z: 0.688191 },
|
|
3411
|
-
{ x: -0.850651, y: 0.525731, z: 0 },
|
|
3412
|
-
{ x: -0.864188, y: 0.442863, z: 0.238856 },
|
|
3413
|
-
{ x: -0.716567, y: 0.681718, z: 0.147621 },
|
|
3414
|
-
{ x: -0.688191, y: 0.587785, z: 0.425325 },
|
|
3415
|
-
{ x: -0.5, y: 0.809017, z: 0.309017 },
|
|
3416
|
-
{ x: -0.238856, y: 0.864188, z: 0.442863 },
|
|
3417
|
-
{ x: -0.425325, y: 0.688191, z: 0.587785 },
|
|
3418
|
-
{ x: -0.716567, y: 0.681718, z: -0.147621 },
|
|
3419
|
-
{ x: -0.5, y: 0.809017, z: -0.309017 },
|
|
3420
|
-
{ x: -0.525731, y: 0.850651, z: 0 },
|
|
3421
|
-
{ x: 0, y: 0.850651, z: -0.525731 },
|
|
3422
|
-
{ x: -0.238856, y: 0.864188, z: -0.442863 },
|
|
3423
|
-
{ x: 0, y: 0.955423, z: -0.295242 },
|
|
3424
|
-
{ x: -0.262866, y: 0.951056, z: -0.16246 },
|
|
3425
|
-
{ x: 0, y: 1, z: 0 },
|
|
3426
|
-
{ x: 0, y: 0.955423, z: 0.295242 },
|
|
3427
|
-
{ x: -0.262866, y: 0.951056, z: 0.16246 },
|
|
3428
|
-
{ x: 0.238856, y: 0.864188, z: 0.442863 },
|
|
3429
|
-
{ x: 0.262866, y: 0.951056, z: 0.16246 },
|
|
3430
|
-
{ x: 0.5, y: 0.809017, z: 0.309017 },
|
|
3431
|
-
{ x: 0.238856, y: 0.864188, z: -0.442863 },
|
|
3432
|
-
{ x: 0.262866, y: 0.951056, z: -0.16246 },
|
|
3433
|
-
{ x: 0.5, y: 0.809017, z: -0.309017 },
|
|
3434
|
-
{ x: 0.850651, y: 0.525731, z: 0 },
|
|
3435
|
-
{ x: 0.716567, y: 0.681718, z: 0.147621 },
|
|
3436
|
-
{ x: 0.716567, y: 0.681718, z: -0.147621 },
|
|
3437
|
-
{ x: 0.525731, y: 0.850651, z: 0 },
|
|
3438
|
-
{ x: 0.425325, y: 0.688191, z: 0.587785 },
|
|
3439
|
-
{ x: 0.864188, y: 0.442863, z: 0.238856 },
|
|
3440
|
-
{ x: 0.688191, y: 0.587785, z: 0.425325 },
|
|
3441
|
-
{ x: 0.809017, y: 0.309017, z: 0.5 },
|
|
3442
|
-
{ x: 0.681718, y: 0.147621, z: 0.716567 },
|
|
3443
|
-
{ x: 0.587785, y: 0.425325, z: 0.688191 },
|
|
3444
|
-
{ x: 0.955423, y: 0.295242, z: 0 },
|
|
3445
|
-
{ x: 1, y: 0, z: 0 },
|
|
3446
|
-
{ x: 0.951056, y: 0.16246, z: 0.262866 },
|
|
3447
|
-
{ x: 0.850651, y: -0.525731, z: 0 },
|
|
3448
|
-
{ x: 0.955423, y: -0.295242, z: 0 },
|
|
3449
|
-
{ x: 0.864188, y: -0.442863, z: 0.238856 },
|
|
3450
|
-
{ x: 0.951056, y: -0.16246, z: 0.262866 },
|
|
3451
|
-
{ x: 0.809017, y: -0.309017, z: 0.5 },
|
|
3452
|
-
{ x: 0.681718, y: -0.147621, z: 0.716567 },
|
|
3453
|
-
{ x: 0.850651, y: 0, z: 0.525731 },
|
|
3454
|
-
{ x: 0.864188, y: 0.442863, z: -0.238856 },
|
|
3455
|
-
{ x: 0.809017, y: 0.309017, z: -0.5 },
|
|
3456
|
-
{ x: 0.951056, y: 0.16246, z: -0.262866 },
|
|
3457
|
-
{ x: 0.525731, y: 0, z: -0.850651 },
|
|
3458
|
-
{ x: 0.681718, y: 0.147621, z: -0.716567 },
|
|
3459
|
-
{ x: 0.681718, y: -0.147621, z: -0.716567 },
|
|
3460
|
-
{ x: 0.850651, y: 0, z: -0.525731 },
|
|
3461
|
-
{ x: 0.809017, y: -0.309017, z: -0.5 },
|
|
3462
|
-
{ x: 0.864188, y: -0.442863, z: -0.238856 },
|
|
3463
|
-
{ x: 0.951056, y: -0.16246, z: -0.262866 },
|
|
3464
|
-
{ x: 0.147621, y: 0.716567, z: -0.681718 },
|
|
3465
|
-
{ x: 0.309017, y: 0.5, z: -0.809017 },
|
|
3466
|
-
{ x: 0.425325, y: 0.688191, z: -0.587785 },
|
|
3467
|
-
{ x: 0.442863, y: 0.238856, z: -0.864188 },
|
|
3468
|
-
{ x: 0.587785, y: 0.425325, z: -0.688191 },
|
|
3469
|
-
{ x: 0.688191, y: 0.587785, z: -0.425325 },
|
|
3470
|
-
{ x: -0.147621, y: 0.716567, z: -0.681718 },
|
|
3471
|
-
{ x: -0.309017, y: 0.5, z: -0.809017 },
|
|
3472
|
-
{ x: 0, y: 0.525731, z: -0.850651 },
|
|
3473
|
-
{ x: -0.525731, y: 0, z: -0.850651 },
|
|
3474
|
-
{ x: -0.442863, y: 0.238856, z: -0.864188 },
|
|
3475
|
-
{ x: -0.295242, y: 0, z: -0.955423 },
|
|
3476
|
-
{ x: -0.16246, y: 0.262866, z: -0.951056 },
|
|
3477
|
-
{ x: 0, y: 0, z: -1 },
|
|
3478
|
-
{ x: 0.295242, y: 0, z: -0.955423 },
|
|
3479
|
-
{ x: 0.16246, y: 0.262866, z: -0.951056 },
|
|
3480
|
-
{ x: -0.442863, y: -0.238856, z: -0.864188 },
|
|
3481
|
-
{ x: -0.309017, y: -0.5, z: -0.809017 },
|
|
3482
|
-
{ x: -0.16246, y: -0.262866, z: -0.951056 },
|
|
3483
|
-
{ x: 0, y: -0.850651, z: -0.525731 },
|
|
3484
|
-
{ x: -0.147621, y: -0.716567, z: -0.681718 },
|
|
3485
|
-
{ x: 0.147621, y: -0.716567, z: -0.681718 },
|
|
3486
|
-
{ x: 0, y: -0.525731, z: -0.850651 },
|
|
3487
|
-
{ x: 0.309017, y: -0.5, z: -0.809017 },
|
|
3488
|
-
{ x: 0.442863, y: -0.238856, z: -0.864188 },
|
|
3489
|
-
{ x: 0.16246, y: -0.262866, z: -0.951056 },
|
|
3490
|
-
{ x: 0.238856, y: -0.864188, z: -0.442863 },
|
|
3491
|
-
{ x: 0.5, y: -0.809017, z: -0.309017 },
|
|
3492
|
-
{ x: 0.425325, y: -0.688191, z: -0.587785 },
|
|
3493
|
-
{ x: 0.716567, y: -0.681718, z: -0.147621 },
|
|
3494
|
-
{ x: 0.688191, y: -0.587785, z: -0.425325 },
|
|
3495
|
-
{ x: 0.587785, y: -0.425325, z: -0.688191 },
|
|
3496
|
-
{ x: 0, y: -0.955423, z: -0.295242 },
|
|
3497
|
-
{ x: 0, y: -1, z: 0 },
|
|
3498
|
-
{ x: 0.262866, y: -0.951056, z: -0.16246 },
|
|
3499
|
-
{ x: 0, y: -0.850651, z: 0.525731 },
|
|
3500
|
-
{ x: 0, y: -0.955423, z: 0.295242 },
|
|
3501
|
-
{ x: 0.238856, y: -0.864188, z: 0.442863 },
|
|
3502
|
-
{ x: 0.262866, y: -0.951056, z: 0.16246 },
|
|
3503
|
-
{ x: 0.5, y: -0.809017, z: 0.309017 },
|
|
3504
|
-
{ x: 0.716567, y: -0.681718, z: 0.147621 },
|
|
3505
|
-
{ x: 0.525731, y: -0.850651, z: 0 },
|
|
3506
|
-
{ x: -0.238856, y: -0.864188, z: -0.442863 },
|
|
3507
|
-
{ x: -0.5, y: -0.809017, z: -0.309017 },
|
|
3508
|
-
{ x: -0.262866, y: -0.951056, z: -0.16246 },
|
|
3509
|
-
{ x: -0.850651, y: -0.525731, z: 0 },
|
|
3510
|
-
{ x: -0.716567, y: -0.681718, z: -0.147621 },
|
|
3511
|
-
{ x: -0.716567, y: -0.681718, z: 0.147621 },
|
|
3512
|
-
{ x: -0.525731, y: -0.850651, z: 0 },
|
|
3513
|
-
{ x: -0.5, y: -0.809017, z: 0.309017 },
|
|
3514
|
-
{ x: -0.238856, y: -0.864188, z: 0.442863 },
|
|
3515
|
-
{ x: -0.262866, y: -0.951056, z: 0.16246 },
|
|
3516
|
-
{ x: -0.864188, y: -0.442863, z: 0.238856 },
|
|
3517
|
-
{ x: -0.809017, y: -0.309017, z: 0.5 },
|
|
3518
|
-
{ x: -0.688191, y: -0.587785, z: 0.425325 },
|
|
3519
|
-
{ x: -0.681718, y: -0.147621, z: 0.716567 },
|
|
3520
|
-
{ x: -0.442863, y: -0.238856, z: 0.864188 },
|
|
3521
|
-
{ x: -0.587785, y: -0.425325, z: 0.688191 },
|
|
3522
|
-
{ x: -0.309017, y: -0.5, z: 0.809017 },
|
|
3523
|
-
{ x: -0.147621, y: -0.716567, z: 0.681718 },
|
|
3524
|
-
{ x: -0.425325, y: -0.688191, z: 0.587785 },
|
|
3525
|
-
{ x: -0.16246, y: -0.262866, z: 0.951056 },
|
|
3526
|
-
{ x: 0.442863, y: -0.238856, z: 0.864188 },
|
|
3527
|
-
{ x: 0.16246, y: -0.262866, z: 0.951056 },
|
|
3528
|
-
{ x: 0.309017, y: -0.5, z: 0.809017 },
|
|
3529
|
-
{ x: 0.147621, y: -0.716567, z: 0.681718 },
|
|
3530
|
-
{ x: 0, y: -0.525731, z: 0.850651 },
|
|
3531
|
-
{ x: 0.425325, y: -0.688191, z: 0.587785 },
|
|
3532
|
-
{ x: 0.587785, y: -0.425325, z: 0.688191 },
|
|
3533
|
-
{ x: 0.688191, y: -0.587785, z: 0.425325 },
|
|
3534
|
-
{ x: -0.955423, y: 0.295242, z: 0 },
|
|
3535
|
-
{ x: -0.951056, y: 0.16246, z: 0.262866 },
|
|
3536
|
-
{ x: -1, y: 0, z: 0 },
|
|
3537
|
-
{ x: -0.850651, y: 0, z: 0.525731 },
|
|
3538
|
-
{ x: -0.955423, y: -0.295242, z: 0 },
|
|
3539
|
-
{ x: -0.951056, y: -0.16246, z: 0.262866 },
|
|
3540
|
-
{ x: -0.864188, y: 0.442863, z: -0.238856 },
|
|
3541
|
-
{ x: -0.951056, y: 0.16246, z: -0.262866 },
|
|
3542
|
-
{ x: -0.809017, y: 0.309017, z: -0.5 },
|
|
3543
|
-
{ x: -0.864188, y: -0.442863, z: -0.238856 },
|
|
3544
|
-
{ x: -0.951056, y: -0.16246, z: -0.262866 },
|
|
3545
|
-
{ x: -0.809017, y: -0.309017, z: -0.5 },
|
|
3546
|
-
{ x: -0.681718, y: 0.147621, z: -0.716567 },
|
|
3547
|
-
{ x: -0.681718, y: -0.147621, z: -0.716567 },
|
|
3548
|
-
{ x: -0.850651, y: 0, z: -0.525731 },
|
|
3549
|
-
{ x: -0.688191, y: 0.587785, z: -0.425325 },
|
|
3550
|
-
{ x: -0.587785, y: 0.425325, z: -0.688191 },
|
|
3551
|
-
{ x: -0.425325, y: 0.688191, z: -0.587785 },
|
|
3552
|
-
{ x: -0.425325, y: -0.688191, z: -0.587785 },
|
|
3553
|
-
{ x: -0.587785, y: -0.425325, z: -0.688191 },
|
|
3554
|
-
{ x: -0.688191, y: -0.587785, z: -0.425325 }
|
|
3555
|
-
];
|
|
3391
|
+
var HEADER_SIZE5 = 68;
|
|
3556
3392
|
var Md2ParseError = class extends Error {
|
|
3557
3393
|
};
|
|
3558
3394
|
var Md2Loader = class {
|
|
@@ -3707,10 +3543,11 @@ function parseFrames(buffer, header) {
|
|
|
3707
3543
|
if (z > maxZ) maxZ = z;
|
|
3708
3544
|
const position = { x, y, z };
|
|
3709
3545
|
const normalIndex = view.getUint8(offset + 3);
|
|
3710
|
-
const
|
|
3711
|
-
if (!
|
|
3546
|
+
const normalArr = ANORMS[normalIndex];
|
|
3547
|
+
if (!normalArr) {
|
|
3712
3548
|
throw new Md2ParseError(`Invalid normal index ${normalIndex} in frame ${name}`);
|
|
3713
3549
|
}
|
|
3550
|
+
const normal = { x: normalArr[0], y: normalArr[1], z: normalArr[2] };
|
|
3714
3551
|
vertices.push({ position, normalIndex, normal });
|
|
3715
3552
|
}
|
|
3716
3553
|
frames.push({
|