minerender 2.1.0-alpha.17 → 2.1.0-alpha.2

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.
@@ -1,11 +1,14 @@
1
1
  import * as three from 'three';
2
- import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, BufferGeometry, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Object3DEventMap, Texture, Camera, MOUSE, TOUCH, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points } from 'three';
2
+ import { Vector3, PixelFormat, BoxGeometry, Material, Mesh, Euler, Vector2, BufferAttribute, Float32BufferAttribute, Object3D, Box3, InstancedMesh, PerspectiveCamera, OrthographicCamera, Matrix4, Scene, Texture, Camera, WebGLRenderer, EventDispatcher, Raycaster, Intersection, CanvasTexture, BufferGeometry as BufferGeometry$1, InterleavedBufferAttribute, TrianglesDrawModes, Line, Points, MOUSE, TOUCH } from 'three';
3
3
  import * as nodeCanvas from 'canvas';
4
4
  import { ImageData as ImageData$1, CanvasRenderingContext2D } from 'canvas';
5
+ import { AxiosResponse, AxiosRequestConfig } from 'axios';
5
6
  import { Buffer as Buffer$1 } from 'buffer';
6
7
  import { NBT } from 'prismarine-nbt';
7
8
  import { ZipReader } from '@zip.js/zip.js';
8
9
  import { AsyncLoadingCache, SimpleCache } from '@inventivetalent/loading-cache';
10
+ import { BufferGeometry } from 'three/src/core/BufferGeometry';
11
+ import { Material as Material$1 } from 'three/src/materials/Material';
9
12
  import Stats from 'stats.js';
10
13
  import { EffectComposer } from 'postprocessing';
11
14
  import { LocalStorage } from 'node-persist';
@@ -15,7 +18,7 @@ interface AnimatorFunction {
15
18
  }
16
19
 
17
20
  declare enum Axis {
18
- X = "x",
21
+ X = "X",
19
22
  Y = "y",
20
23
  Z = "z"
21
24
  }
@@ -60,11 +63,10 @@ declare function createCanvas(width: number, height: number): CompatCanvas;
60
63
  declare abstract class PersistentCache<B = unknown> {
61
64
  readonly backing: B;
62
65
  /** Bump to invalidate every persisted entry. */
63
- static readonly VERSION = 2;
66
+ static readonly VERSION = 1;
64
67
  static open(name: string): PersistentCache;
65
68
  protected constructor(backing: B);
66
69
  abstract get<T>(key: string): Promise<T>;
67
- /** Loads a missing entry and stores only non-nullish results. */
68
70
  getOrLoad<T>(key: string, loader: (key: string) => Promise<T>): Promise<T>;
69
71
  abstract put<T>(key: string, value: T): Promise<T>;
70
72
  abstract delete<T>(key: string): Promise<void>;
@@ -255,46 +257,6 @@ declare enum GuiLight {
255
257
  SIDE = "side"
256
258
  }
257
259
 
258
- interface RequestConfig extends RequestInit {
259
- url: string;
260
- /** Prepended to relative URLs, preserving any path in the base URL. */
261
- baseURL?: string;
262
- /** Timeout per attempt in milliseconds, including body reading. Defaults to 5000; 0 disables it. */
263
- timeout?: number;
264
- responseType?: "json" | "arraybuffer";
265
- }
266
- interface RequestResponse<T = any> {
267
- data: T;
268
- status: number;
269
- statusText: string;
270
- headers: Headers;
271
- /** Final URL after redirects. */
272
- url: string;
273
- }
274
- declare class RequestError extends Error {
275
- readonly response?: RequestResponse<undefined> | undefined;
276
- readonly cause?: unknown;
277
- constructor(message: string, response?: RequestResponse<undefined> | undefined, cause?: unknown);
278
- }
279
- declare class Requests {
280
- private static genericQueue;
281
- private static mcAssetRequestQueue;
282
- static genericRequest(request: RequestConfig): Promise<RequestResponse>;
283
- static mcAssetRequest(request: RequestConfig): Promise<RequestResponse>;
284
- static setMcAssetRoot(root: string): void;
285
- /** Counts unsettled calls, including retry delays and requests still running after shutdown. */
286
- static get queueSizes(): {
287
- generic: number;
288
- mcAsset: number;
289
- };
290
- /**
291
- * Permanently stops both queues and rejects waiting, retrying, and future requests.
292
- * Requests already running can finish. Idle queues hold no timer, so Node can exit without
293
- * this cleanup. See {@link shutdown}.
294
- */
295
- static end(): void;
296
- }
297
-
298
260
  declare class WrappedImage {
299
261
  readonly dta: ExtractableImageData;
300
262
  constructor(dta: ExtractableImageData);
@@ -330,7 +292,7 @@ declare class ImageLoader {
330
292
  static infoToData(info: ImageInfo): Promise<ImageData>;
331
293
  static getData(src: string): Promise<ImageData>;
332
294
  static getCanvasData(src: string): Promise<ExtractableImageData>;
333
- static processResponse(response: Pick<RequestResponse<ArrayBuffer>, "data" | "url">): Promise<ImageInfo>;
295
+ static processResponse(response: Partial<AxiosResponse>): Promise<ImageInfo>;
334
296
  static loadInfo(src: string): Promise<ImageInfo>;
335
297
  static getInfo(src: string): Promise<ImageInfo>;
336
298
  static loadWrapped(src: string): Promise<WrappedImage>;
@@ -470,7 +432,7 @@ interface Transformable {
470
432
  declare function isTransformable(obj: any): obj is Transformable;
471
433
 
472
434
  declare const changeEvent: {
473
- type: "change";
435
+ type: string;
474
436
  };
475
437
  type Maybe<T> = T | undefined;
476
438
  declare function md5(str: string): string;
@@ -575,13 +537,14 @@ declare class MinecraftFaceUV {
575
537
  }
576
538
 
577
539
  /**
578
- * Stops the shared Ticker and request queues, and clears the in-memory caches.
540
+ * Releases every long-lived timer MineRender holds, so a Node process can exit.
579
541
  *
580
- * Idle Node processes can exit without calling this: cache and Ticker timers are unref'd,
581
- * and idle request queues hold no timer. Pending requests keep their normal timer references.
542
+ * Both `@inventivetalent/loading-cache` (cache expiry) and `jobqu` (request queue draining) use
543
+ * self-rescheduling timers that are not unref'd, which keeps the event loop alive for as long as
544
+ * the library is loaded. Browsers don't care, but anything headless - a render server, a CLI, a
545
+ * test run - has to call this when it's done.
582
546
  *
583
- * Call this only when finished with MineRender. Queued, retrying, and future requests reject;
584
- * HTTP requests already running can finish. Queue shutdown is permanent, and cache expiry timers do not restart.
547
+ * The library stays usable afterwards; the caches and queues simply start over.
585
548
  */
586
549
  declare function shutdown(): void;
587
550
 
@@ -654,14 +617,6 @@ declare abstract class AssetSource {
654
617
  protected constructor();
655
618
  abstract get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
656
619
  }
657
- /** A source failed to load or parse an asset; cause retains the original failure. */
658
- declare class AssetLoadError extends Error {
659
- readonly source: AssetSource;
660
- readonly key: AssetKey;
661
- readonly path: string;
662
- readonly cause: unknown;
663
- constructor(source: AssetSource, key: AssetKey, path: string, cause: unknown);
664
- }
665
620
 
666
621
  declare class AssetLoader {
667
622
  static ROOT: string;
@@ -669,13 +624,7 @@ declare class AssetLoader {
669
624
  static addSource(key: string, source: AssetSource, override?: boolean): void;
670
625
  static removeSource(key: string): Maybe<AssetSource>;
671
626
  static getAll<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<T[]>;
672
- /** Returns the first defined result in source-priority order, without merging assets. */
673
627
  static get<T extends MinecraftAsset>(key: AssetKey, parser: AssetParser | string): Promise<Maybe<T>>;
674
- /** Tries each path within a source before considering lower-priority sources. */
675
- static getFirst<T extends MinecraftAsset>(keys: readonly AssetKey[], parser: AssetParser | string): Promise<Maybe<{
676
- key: AssetKey;
677
- asset: T;
678
- }>>;
679
628
  }
680
629
 
681
630
  interface BlockState extends MinecraftAsset {
@@ -690,19 +639,18 @@ interface BlockStateVariant {
690
639
  y?: number;
691
640
  x?: number;
692
641
  uvlock?: boolean;
693
- weight?: number;
694
642
  }
695
643
  interface BlockStateMultipart {
696
- when?: MultipartCondition;
697
- apply?: BlockStateVariant | BlockStateVariant[];
644
+ when?: MultipartCondition | {
645
+ OR: MultipartCondition[];
646
+ };
647
+ apply?: BlockStateVariant;
648
+ }
649
+ interface MultipartCondition {
650
+ [key: string]: string;
698
651
  }
699
- type MultipartCondition = Record<string, string> | {
700
- OR: MultipartCondition[];
701
- } | {
702
- AND: MultipartCondition[];
703
- };
704
652
 
705
- declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.21.11";
653
+ declare const DEFAULT_ROOT = "https://assets.mcasset.cloud/1.17.1";
706
654
  declare const DEFAULT_NAMESPACE = "minecraft";
707
655
  declare class Assets {
708
656
  /**
@@ -767,8 +715,6 @@ declare class Models {
767
715
  private static get PERSISTENT_CACHE();
768
716
  static getItemList(): Promise<string[]>;
769
717
  static loadAndMerge(key: AssetKey): Promise<Maybe<Model>>;
770
- private static getItemModel;
771
- private static defaultItemModel;
772
718
  static getRaw(key: AssetKey): Promise<Maybe<Model>>;
773
719
  static getMerged(key: AssetKey): Promise<Maybe<Model>>;
774
720
  static get(key: AssetKey): Promise<Maybe<Model>>;
@@ -909,7 +855,6 @@ declare class EntityObject extends SceneObject {
909
855
  constructor(entity: EntityModel, options?: Partial<EntityObjectOptions>);
910
856
  init(): Promise<void>;
911
857
  dispose(): void;
912
- private get textureKey();
913
858
  protected loadTextures(): Promise<void>;
914
859
  protected createMeshes(force?: boolean): void;
915
860
  protected applyTextures(): Promise<void>;
@@ -942,9 +887,7 @@ interface MineRenderSceneOptions {
942
887
  }
943
888
  declare function isMineRenderScene(obj: any): obj is MineRenderScene;
944
889
 
945
- declare class SceneObject extends Object3D<Object3DEventMap & {
946
- change: {};
947
- }> implements Disposable, Instanceable, Transformable {
890
+ declare class SceneObject extends Object3D implements Disposable, Instanceable, Transformable {
948
891
  readonly isSceneObject: true;
949
892
  static readonly DEFAULT_OPTIONS: SceneObjectOptions;
950
893
  readonly options: SceneObjectOptions;
@@ -970,9 +913,9 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
970
913
  */
971
914
  toggleGroupVisibility(name: string, visible?: boolean): boolean;
972
915
  protected addOrReplaceMesh(mesh: Mesh, parent: Object3D, name?: string): void;
973
- protected createAndAddMesh(name?: string, group?: Object3D, geometry?: BufferGeometry, material?: Material | Material[], offsetAxis?: Axis, offset?: number): Mesh;
974
- protected createMesh(name?: string, geometry?: BufferGeometry, material?: Material | Material[], offsetAxis?: Axis, offset?: number): Mesh;
975
- protected createInstancedMesh(name: Maybe<string>, geometry: BufferGeometry, material: Material | Material[], count: number): InstancedMesh;
916
+ protected createAndAddMesh(name?: string, group?: Object3D, geometry?: BufferGeometry, material?: Material$1 | Material$1[], offsetAxis?: Axis, offset?: number): Mesh;
917
+ protected createMesh(name?: string, geometry?: BufferGeometry, material?: Material$1 | Material$1[], offsetAxis?: Axis, offset?: number): Mesh;
918
+ protected createInstancedMesh(name: Maybe<string>, geometry: BufferGeometry, material: Material$1 | Material$1[], count: number): InstancedMesh;
976
919
  /**
977
920
  * Get a mesh by its name
978
921
  */
@@ -1141,8 +1084,8 @@ interface NBTAsset extends MinecraftAsset, NBT {
1141
1084
  }
1142
1085
 
1143
1086
  interface ResponseParser<T extends MinecraftAsset> {
1144
- config(request: RequestConfig): any;
1145
- parse(response: RequestResponse): Maybe<T> | Promise<Maybe<T>>;
1087
+ config(request: AxiosRequestConfig): any;
1088
+ parse(response: AxiosResponse): Maybe<T> | Promise<Maybe<T>>;
1146
1089
  }
1147
1090
 
1148
1091
  declare class HostedAssetSource extends AssetSource {
@@ -1270,18 +1213,14 @@ declare class Caching {
1270
1213
  static readonly mergedModelCache: AsyncLoadingCache<CacheKey, Model>;
1271
1214
  static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
1272
1215
  static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
1273
- static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
1274
- static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
1275
- static readonly entityModelsCache: AsyncLoadingCache<CacheKey, EntityModels>;
1276
- private static createAssetCache;
1277
1216
  /** Every cache above, so clear()/end() can never fall out of sync with the field list again. */
1278
1217
  private static get all();
1279
1218
  static clear(): void;
1280
1219
  /**
1281
1220
  * Clears every cache and stops its expiry timer.
1282
1221
  *
1283
- * Expiry timers are unref'd in Node, so idle processes can exit without this cleanup.
1284
- * Use {@link shutdown} to also stop requests and the shared Ticker.
1222
+ * loading-cache reschedules that timer indefinitely, so a Node process will not exit until
1223
+ * this is called - see {@link shutdown}.
1285
1224
  */
1286
1225
  static end(): void;
1287
1226
  static get cacheSizes(): {};
@@ -1297,83 +1236,6 @@ declare class GuiObject extends SceneObject {
1297
1236
  interface GuiObjectOptions extends SceneObjectOptions {
1298
1237
  }
1299
1238
 
1300
- declare class OrbitControls {
1301
- constructor(object: Camera, domElement?: HTMLElement);
1302
-
1303
- object: Camera;
1304
- domElement: HTMLElement | HTMLDocument;
1305
-
1306
- // API
1307
- enabled: boolean;
1308
- target: Vector3;
1309
-
1310
- // deprecated
1311
- center: Vector3;
1312
-
1313
- minDistance: number;
1314
- maxDistance: number;
1315
-
1316
- minZoom: number;
1317
- maxZoom: number;
1318
-
1319
- minPolarAngle: number;
1320
- maxPolarAngle: number;
1321
-
1322
- minAzimuthAngle: number;
1323
- maxAzimuthAngle: number;
1324
-
1325
- enableDamping: boolean;
1326
- dampingFactor: number;
1327
-
1328
- enableZoom: boolean;
1329
- zoomSpeed: number;
1330
-
1331
- enableRotate: boolean;
1332
- rotateSpeed: number;
1333
-
1334
- enablePan: boolean;
1335
- panSpeed: number;
1336
- screenSpacePanning: boolean;
1337
- keyPanSpeed: number;
1338
-
1339
- autoRotate: boolean;
1340
- autoRotateSpeed: number;
1341
-
1342
- enableKeys: boolean;
1343
- keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
1344
- mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE };
1345
- touches: { ONE: TOUCH; TWO: TOUCH };
1346
-
1347
- update(): boolean;
1348
-
1349
- listenToKeyEvents(domElement: HTMLElement): void;
1350
-
1351
- saveState(): void;
1352
-
1353
- reset(): void;
1354
-
1355
- dispose(): void;
1356
-
1357
- getPolarAngle(): number;
1358
-
1359
- getAzimuthalAngle(): number;
1360
-
1361
- getDistance(): number;
1362
-
1363
- // EventDispatcher mixins
1364
- addEventListener(type: string, listener: (event: any) => void): void;
1365
-
1366
- hasEventListener(type: string, listener: (event: any) => void): boolean;
1367
-
1368
- removeEventListener(type: string, listener: (event: any) => void): void;
1369
-
1370
- dispatchEvent(event: { type: string; target: any }): void;
1371
- }
1372
-
1373
- declare class MapControls extends OrbitControls {
1374
- constructor(object: Camera, domElement?: HTMLElement);
1375
- }
1376
-
1377
1239
  declare class Renderer implements Disposable {
1378
1240
  static readonly DEFAULT_OPTIONS: RendererOptions;
1379
1241
  readonly options: RendererOptions;
@@ -1381,14 +1243,14 @@ declare class Renderer implements Disposable {
1381
1243
  protected _scene: MineRenderScene;
1382
1244
  protected _camera: Camera;
1383
1245
  protected _renderer: WebGLRenderer;
1384
- protected _composer?: EffectComposer;
1385
- protected _controls?: OrbitControls;
1246
+ protected _composer: EffectComposer;
1386
1247
  protected _stats?: Stats;
1387
1248
  protected _dirty: boolean;
1388
1249
  protected _animationLoop: any;
1389
- protected _frameInterval?: number;
1250
+ protected _fpsTimer: any;
1251
+ protected _animationTimer?: NodeJS.Timeout;
1252
+ protected _animationFrame?: number;
1390
1253
  protected _resizeListener?: () => void;
1391
- private _nextFrameTime?;
1392
1254
  private _disposed;
1393
1255
  private readonly _debugHelpers;
1394
1256
  private readonly _eventDispatchers;
@@ -1397,8 +1259,7 @@ declare class Renderer implements Disposable {
1397
1259
  protected createScene(): MineRenderScene;
1398
1260
  protected createCamera(): Camera;
1399
1261
  protected createRenderer(): WebGLRenderer;
1400
- protected createComposer(): Maybe<EffectComposer>;
1401
- protected createControls(): Maybe<OrbitControls>;
1262
+ protected createComposer(): EffectComposer;
1402
1263
  init(): void;
1403
1264
  get element(): Maybe<HTMLElement>;
1404
1265
  appendTo(element: HTMLElement): void;
@@ -1406,7 +1267,7 @@ declare class Renderer implements Disposable {
1406
1267
  * Redraws when the dispatcher emits the selected event. Registering the same pair twice has no effect.
1407
1268
  * The renderer removes its listener on disposal; the caller retains ownership of the dispatcher.
1408
1269
  */
1409
- registerEventDispatcher(dispatcher: EventDispatcher<any>, changeEvent?: string): void;
1270
+ registerEventDispatcher(dispatcher: EventDispatcher, changeEvent?: string): void;
1410
1271
  resize(width: number, height: number): void;
1411
1272
  get dirty(): boolean;
1412
1273
  set dirty(dirty: boolean);
@@ -1426,15 +1287,12 @@ declare class Renderer implements Disposable {
1426
1287
  get scene(): MineRenderScene;
1427
1288
  get camera(): Camera;
1428
1289
  get renderer(): WebGLRenderer;
1429
- get composer(): Maybe<EffectComposer>;
1430
- /** Renderer-owned controls, or undefined when disabled at construction or after disposal. */
1431
- get controls(): Maybe<OrbitControls>;
1290
+ get composer(): EffectComposer;
1432
1291
  }
1433
1292
  interface RendererOptions {
1434
1293
  camera: CameraOptions;
1435
1294
  render: RenderOptions;
1436
1295
  composer: ComposerOptions;
1437
- controls?: ControlsOptions;
1438
1296
  debug: DebugOptions;
1439
1297
  }
1440
1298
  interface CameraOptions {
@@ -1455,7 +1313,6 @@ interface CameraOptions {
1455
1313
  lookingAt: Vector3 | TripleArray;
1456
1314
  }
1457
1315
  interface RenderOptions {
1458
- /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1459
1316
  fpsLimit: number;
1460
1317
  stats: boolean;
1461
1318
  antialias: boolean;
@@ -1466,9 +1323,6 @@ interface RenderOptions {
1466
1323
  interface ComposerOptions {
1467
1324
  enabled: boolean;
1468
1325
  }
1469
- interface ControlsOptions {
1470
- enabled: boolean;
1471
- }
1472
1326
  interface DebugOptions {
1473
1327
  grid: boolean;
1474
1328
  axes: boolean;
@@ -1483,7 +1337,7 @@ declare class SceneInspector {
1483
1337
  private selectedObject?;
1484
1338
  constructor(renderer: Renderer);
1485
1339
  protected init(): void;
1486
- findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes>, three.Material | three.Material[], three.Object3DEventMap>[];
1340
+ findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry, three.Material | three.Material[]>[];
1487
1341
  onClick(event: any): void;
1488
1342
  appendTo(el: HTMLElement): void;
1489
1343
  protected handleRaycasterObjects(intersections: Intersection[]): void;
@@ -1520,6 +1374,26 @@ declare class StatLine {
1520
1374
  update(): void;
1521
1375
  }
1522
1376
 
1377
+ declare class Requests {
1378
+ private static axiosInstance;
1379
+ private static mcAssetInstance;
1380
+ private static genericQueue;
1381
+ private static mcAssetRequestQueue;
1382
+ static genericRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1383
+ static mcAssetRequest(request: AxiosRequestConfig): Promise<AxiosResponse>;
1384
+ private static shouldRetry;
1385
+ static setMcAssetRoot(root: string): void;
1386
+ static get queueSizes(): {
1387
+ generic: number;
1388
+ mcAsset: number;
1389
+ };
1390
+ /**
1391
+ * Stops both queue timers. jobqu reschedules itself indefinitely, so a Node process will not
1392
+ * exit until this is called - see {@link shutdown}.
1393
+ */
1394
+ static end(): void;
1395
+ }
1396
+
1523
1397
  type SkinGeometries = Record<SkinPart, TripleArray>;
1524
1398
  declare const classicSkinGeometries: SkinGeometries;
1525
1399
  declare const slimSkinGeometries: SkinGeometries;
@@ -1552,9 +1426,6 @@ declare class Skins {
1552
1426
  }
1553
1427
 
1554
1428
  declare class TextureLoader {
1555
- private static readonly failedTextures;
1556
- /** Reports whether image loading failed, so cached textures can be retried. */
1557
- static hasFailed(texture: Texture): boolean;
1558
1429
  protected static createTexture(): Texture;
1559
1430
  static loadInBackground(src: string, format?: PixelFormat, rotation?: number): Texture;
1560
1431
  static load(src: string, format?: PixelFormat, rotation?: number): Texture;
@@ -1568,14 +1439,91 @@ declare class Textures {
1568
1439
  static getImage(key: TextureKey): Texture;
1569
1440
  }
1570
1441
 
1571
- declare function mergeBufferGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
1442
+ declare function mergeBufferGeometries(geometries: BufferGeometry$1[], useGroups?: boolean): BufferGeometry$1;
1572
1443
  declare function mergeBufferAttributes(attributes: BufferAttribute[]): BufferAttribute;
1573
1444
  declare function interleaveAttributes(attributes: BufferAttribute[]): InterleavedBufferAttribute;
1574
- declare function estimateBytesUsed(geometry: BufferGeometry): number;
1575
- declare function mergeVertices(geometry: BufferGeometry, tolerance?: number): BufferGeometry;
1576
- declare function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
1445
+ declare function estimateBytesUsed(geometry: BufferGeometry$1): number;
1446
+ declare function mergeVertices(geometry: BufferGeometry$1, tolerance?: number): BufferGeometry$1;
1447
+ declare function toTrianglesDrawMode(geometry: BufferGeometry$1, drawMode: TrianglesDrawModes): BufferGeometry$1;
1577
1448
  declare function computeMorphedAttributes(object: Mesh | Line | Points): object;
1578
1449
 
1450
+ declare class OrbitControls {
1451
+ constructor(object: Camera, domElement?: HTMLElement);
1452
+
1453
+ object: Camera;
1454
+ domElement: HTMLElement | HTMLDocument;
1455
+
1456
+ // API
1457
+ enabled: boolean;
1458
+ target: Vector3;
1459
+
1460
+ // deprecated
1461
+ center: Vector3;
1462
+
1463
+ minDistance: number;
1464
+ maxDistance: number;
1465
+
1466
+ minZoom: number;
1467
+ maxZoom: number;
1468
+
1469
+ minPolarAngle: number;
1470
+ maxPolarAngle: number;
1471
+
1472
+ minAzimuthAngle: number;
1473
+ maxAzimuthAngle: number;
1474
+
1475
+ enableDamping: boolean;
1476
+ dampingFactor: number;
1477
+
1478
+ enableZoom: boolean;
1479
+ zoomSpeed: number;
1480
+
1481
+ enableRotate: boolean;
1482
+ rotateSpeed: number;
1483
+
1484
+ enablePan: boolean;
1485
+ panSpeed: number;
1486
+ screenSpacePanning: boolean;
1487
+ keyPanSpeed: number;
1488
+
1489
+ autoRotate: boolean;
1490
+ autoRotateSpeed: number;
1491
+
1492
+ enableKeys: boolean;
1493
+ keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
1494
+ mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE };
1495
+ touches: { ONE: TOUCH; TWO: TOUCH };
1496
+
1497
+ update(): boolean;
1498
+
1499
+ listenToKeyEvents(domElement: HTMLElement): void;
1500
+
1501
+ saveState(): void;
1502
+
1503
+ reset(): void;
1504
+
1505
+ dispose(): void;
1506
+
1507
+ getPolarAngle(): number;
1508
+
1509
+ getAzimuthalAngle(): number;
1510
+
1511
+ getDistance(): number;
1512
+
1513
+ // EventDispatcher mixins
1514
+ addEventListener(type: string, listener: (event: any) => void): void;
1515
+
1516
+ hasEventListener(type: string, listener: (event: any) => void): boolean;
1517
+
1518
+ removeEventListener(type: string, listener: (event: any) => void): void;
1519
+
1520
+ dispatchEvent(event: { type: string; target: any }): void;
1521
+ }
1522
+
1523
+ declare class MapControls extends OrbitControls {
1524
+ constructor(object: Camera, domElement?: HTMLElement);
1525
+ }
1526
+
1579
1527
  interface BlockInfo {
1580
1528
  block: Block;
1581
1529
  object: BlockObject;
@@ -1670,4 +1618,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
1670
1618
  forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
1671
1619
  }
1672
1620
 
1673
- export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntityModels, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, type Cube, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityModel, EntityModels, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, type ModelPart, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, applyModelPartRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
1621
+ export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, ArchiveAssetSource, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type Block, BlockEntityModels, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, type BlockStateVariant, type BlockStateVariants, BlockStates, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, type CacheKey, Caching, type CameraOptions, CanvasImage, Chunk, type CompatCanvas, type CompatImage, type ComposerOptions, type Cube, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityModel, EntityModels, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FromTo, Geometries, GuiLight, GuiObject, type GuiObjectOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelTextures, type ListAsset, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, type ModelPart, ModelTextures, Models, type MultiBlockBlock, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, PersistentCache, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererOptions, Requests, type ResponseParser, SKIN_PARTS, SceneInspector, SceneObject, type SceneObjectOptions, SceneStats, SceneStatsDisplay, SchematicParser, type Serializable, type SkinGeometries, SkinObject, type SkinObjectOptions, SkinPart, type SkinTextureCoordinates, Skins, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, applyModelPartRotation, axisToVec3, base64decode, base64encode, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createImage, estimateBytesUsed, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, prefix, registerNodeEnv, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };