minerender 2.1.0-alpha.42 → 2.1.0-alpha.44
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/dist/browser/index.d.mts +55 -8
- package/dist/browser/index.d.ts +55 -8
- package/dist/browser/index.js +5405 -4520
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +4994 -4107
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +75465 -74316
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +55 -8
- package/dist/node/index.d.ts +55 -8
- package/dist/node/index.js +5439 -4550
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +5022 -4135
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ import { EffectComposer } from 'postprocessing';
|
|
|
11
11
|
import { LocalStorage } from 'node-persist';
|
|
12
12
|
|
|
13
13
|
interface AnimatorFunction {
|
|
14
|
-
(): void;
|
|
14
|
+
(): boolean | void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
declare enum Axis {
|
|
@@ -525,6 +525,7 @@ declare class TextureAtlas implements Disposable {
|
|
|
525
525
|
};
|
|
526
526
|
readonly hasTransparency: boolean;
|
|
527
527
|
ticker?: number;
|
|
528
|
+
private readonly subscribers;
|
|
528
529
|
constructor(model: Model, image: CanvasImage, sizes: {
|
|
529
530
|
[texture: string]: DoubleArray;
|
|
530
531
|
}, positions: {
|
|
@@ -532,6 +533,8 @@ declare class TextureAtlas implements Disposable {
|
|
|
532
533
|
}, hasAnimation: boolean, animatorFunctions: {
|
|
533
534
|
[p: string]: AnimatorFunction;
|
|
534
535
|
}, hasTransparency: boolean);
|
|
536
|
+
/** Calls subscribers when an animation frame changes; unused atlases do not tick. */
|
|
537
|
+
subscribe(callback: () => void): () => void;
|
|
535
538
|
getData(texture: string): ImageData$1;
|
|
536
539
|
dispose(): void;
|
|
537
540
|
}
|
|
@@ -890,7 +893,10 @@ declare class ModelObject extends SceneObject {
|
|
|
890
893
|
readonly isModelObject: true;
|
|
891
894
|
static readonly DEFAULT_OPTIONS: ModelObjectOptions;
|
|
892
895
|
readonly options: ModelObjectOptions;
|
|
893
|
-
|
|
896
|
+
protected atlas?: TextureAtlas;
|
|
897
|
+
private atlasMaterial?;
|
|
898
|
+
private atlasTexture?;
|
|
899
|
+
private unsubscribeAtlas?;
|
|
894
900
|
blockParent: Maybe<BlockObject>;
|
|
895
901
|
private meshesCreated;
|
|
896
902
|
constructor(originalModel: Model, options?: Partial<ModelObjectOptions>);
|
|
@@ -900,6 +906,10 @@ declare class ModelObject extends SceneObject {
|
|
|
900
906
|
protected loadTextures(): Promise<void>;
|
|
901
907
|
protected createMeshes(force?: boolean): void;
|
|
902
908
|
protected applyTextures(): void;
|
|
909
|
+
private updateAnimationSubscription;
|
|
910
|
+
nextInstance(): InstanceReference<SceneObject>;
|
|
911
|
+
removeInstanceAt(index: number): void;
|
|
912
|
+
disposeAndRemoveAllChildren(): void;
|
|
903
913
|
}
|
|
904
914
|
interface ModelObjectOptions extends SceneObjectOptions {
|
|
905
915
|
/** Minecraft display pose applied around the model center, before scene transforms. */
|
|
@@ -1073,6 +1083,8 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
|
|
|
1073
1083
|
get instanceCounter(): number;
|
|
1074
1084
|
protected constructInstanceReference(i: number): InstanceReference<SceneObject>;
|
|
1075
1085
|
nextInstance(): InstanceReference<SceneObject>;
|
|
1086
|
+
/** Returns the live reference for a raycast hit on this object's instance mesh. */
|
|
1087
|
+
getInstanceReference(mesh: Object3D, index: number): Maybe<InstanceReference<SceneObject>>;
|
|
1076
1088
|
isInstanceActive(index: number, reference: InstanceReference<Instanceable>): boolean;
|
|
1077
1089
|
removeInstanceAt(index: number): void;
|
|
1078
1090
|
private growInstances;
|
|
@@ -1100,6 +1112,17 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
|
|
|
1100
1112
|
}
|
|
1101
1113
|
declare function isSceneObject(obj: any): obj is SceneObject;
|
|
1102
1114
|
|
|
1115
|
+
type FluidKind = "water" | "lava";
|
|
1116
|
+
declare function getFluidKind(key?: AssetKey): FluidKind | undefined;
|
|
1117
|
+
interface FluidSample {
|
|
1118
|
+
fluid?: FluidKind;
|
|
1119
|
+
level?: number;
|
|
1120
|
+
solid?: boolean;
|
|
1121
|
+
}
|
|
1122
|
+
type FluidSampler = (x: number, y: number, z: number) => FluidSample;
|
|
1123
|
+
/** Builds centered fluid faces with material groups 0 (still) and 1 (flowing). */
|
|
1124
|
+
declare function createFluidGeometry(kind: FluidKind, sample: FluidSampler): BufferGeometry;
|
|
1125
|
+
|
|
1103
1126
|
declare class BlockObject extends SceneObject {
|
|
1104
1127
|
readonly blockState: BlockState;
|
|
1105
1128
|
readonly isBlockObject: true;
|
|
@@ -1114,6 +1137,8 @@ declare class BlockObject extends SceneObject {
|
|
|
1114
1137
|
private _variants;
|
|
1115
1138
|
private _models;
|
|
1116
1139
|
private _cullMask;
|
|
1140
|
+
private _fluidKey?;
|
|
1141
|
+
private _fluidSampler?;
|
|
1117
1142
|
constructor(blockState: BlockState, options?: Partial<BlockObjectOptions>);
|
|
1118
1143
|
init(): Promise<void>;
|
|
1119
1144
|
dispose(): void;
|
|
@@ -1127,6 +1152,9 @@ declare class BlockObject extends SceneObject {
|
|
|
1127
1152
|
get state(): {
|
|
1128
1153
|
[key: string]: string;
|
|
1129
1154
|
};
|
|
1155
|
+
get fluidKind(): FluidKind | undefined;
|
|
1156
|
+
/** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
|
|
1157
|
+
updateFluid(sample?: FluidSampler): Promise<void>;
|
|
1130
1158
|
nextInstance(): InstanceReference<SceneObject>;
|
|
1131
1159
|
protected mapStateToVariant(state: BlockStateProperties): Promise<BlockStateVariant[]>;
|
|
1132
1160
|
recreateModels(): Promise<void>;
|
|
@@ -1150,6 +1178,21 @@ interface BlockObjectOptions extends ModelObjectOptions {
|
|
|
1150
1178
|
}
|
|
1151
1179
|
declare function isBlockObject(obj: any): obj is BlockObject;
|
|
1152
1180
|
|
|
1181
|
+
/** Saved fluid levels and solid neighbors determine the geometry shared by an instance pool. */
|
|
1182
|
+
declare function sampleFluid(kind: FluidKind, sample: FluidSampler): {
|
|
1183
|
+
key: string;
|
|
1184
|
+
sample: FluidSampler;
|
|
1185
|
+
};
|
|
1186
|
+
declare class FluidModelObject extends ModelObject {
|
|
1187
|
+
readonly kind: FluidKind;
|
|
1188
|
+
private readonly sample;
|
|
1189
|
+
private geometry?;
|
|
1190
|
+
constructor(kind: FluidKind, sample: FluidSampler, origin: AssetKey, options?: Partial<ModelObjectOptions>);
|
|
1191
|
+
protected createMeshes(): void;
|
|
1192
|
+
protected applyTextures(): void;
|
|
1193
|
+
disposeAndRemoveAllChildren(): void;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1153
1196
|
interface MultiBlockStructure {
|
|
1154
1197
|
readonly size: TripleArray;
|
|
1155
1198
|
readonly blocks: MultiBlockBlock[];
|
|
@@ -1624,17 +1667,21 @@ declare class SceneInspector {
|
|
|
1624
1667
|
protected readonly raycaster: Raycaster;
|
|
1625
1668
|
private readonly mouse;
|
|
1626
1669
|
private selectedObject?;
|
|
1670
|
+
private pointer?;
|
|
1671
|
+
private readonly listeners;
|
|
1627
1672
|
constructor(renderer: Renderer);
|
|
1628
1673
|
protected init(): void;
|
|
1674
|
+
dispose(): void;
|
|
1629
1675
|
findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes>, three.Material | three.Material[], three.Object3DEventMap>[];
|
|
1630
|
-
onClick(event:
|
|
1676
|
+
onClick(event: MouseEvent): void;
|
|
1631
1677
|
appendTo(el: HTMLElement): void;
|
|
1632
1678
|
protected handleRaycasterObjects(intersections: Intersection[]): void;
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
protected
|
|
1679
|
+
private getIntersectionInstance;
|
|
1680
|
+
selectObject(targetObject: Object3D, targetIntersection?: Intersection, instance?: Maybe<InstanceReference<SceneObject>>): void;
|
|
1681
|
+
protected redraw(targetObject: Object3D, targetIntersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
|
|
1682
|
+
protected addControls(object: Object3D, intersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
|
|
1636
1683
|
protected addInfoLine(name: string, id: string, value: any): HTMLElement;
|
|
1637
|
-
protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement): void;
|
|
1684
|
+
protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement, instance?: InstanceReference<SceneObject>): void;
|
|
1638
1685
|
protected buttonControl(name: string, id: string, click: () => void): HTMLElement;
|
|
1639
1686
|
protected selectControl(name: string, id: string, options: string[], change: (v: string) => void): HTMLElement;
|
|
1640
1687
|
protected toggleControl(name: string, id: string, val: boolean, change: (v: boolean) => void): HTMLElement;
|
|
@@ -1933,4 +1980,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
1933
1980
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
1934
1981
|
}
|
|
1935
1982
|
|
|
1936
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, 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, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, 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 MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, 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, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, 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, axisToVec3, base64decode, base64encode, capeTextureSizes, 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 };
|
|
1983
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, 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, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, 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 MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, 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, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, 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, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createImage, estimateBytesUsed, getFluidKind, 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, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { EffectComposer } from 'postprocessing';
|
|
|
11
11
|
import { LocalStorage } from 'node-persist';
|
|
12
12
|
|
|
13
13
|
interface AnimatorFunction {
|
|
14
|
-
(): void;
|
|
14
|
+
(): boolean | void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
declare enum Axis {
|
|
@@ -525,6 +525,7 @@ declare class TextureAtlas implements Disposable {
|
|
|
525
525
|
};
|
|
526
526
|
readonly hasTransparency: boolean;
|
|
527
527
|
ticker?: number;
|
|
528
|
+
private readonly subscribers;
|
|
528
529
|
constructor(model: Model, image: CanvasImage, sizes: {
|
|
529
530
|
[texture: string]: DoubleArray;
|
|
530
531
|
}, positions: {
|
|
@@ -532,6 +533,8 @@ declare class TextureAtlas implements Disposable {
|
|
|
532
533
|
}, hasAnimation: boolean, animatorFunctions: {
|
|
533
534
|
[p: string]: AnimatorFunction;
|
|
534
535
|
}, hasTransparency: boolean);
|
|
536
|
+
/** Calls subscribers when an animation frame changes; unused atlases do not tick. */
|
|
537
|
+
subscribe(callback: () => void): () => void;
|
|
535
538
|
getData(texture: string): ImageData$1;
|
|
536
539
|
dispose(): void;
|
|
537
540
|
}
|
|
@@ -890,7 +893,10 @@ declare class ModelObject extends SceneObject {
|
|
|
890
893
|
readonly isModelObject: true;
|
|
891
894
|
static readonly DEFAULT_OPTIONS: ModelObjectOptions;
|
|
892
895
|
readonly options: ModelObjectOptions;
|
|
893
|
-
|
|
896
|
+
protected atlas?: TextureAtlas;
|
|
897
|
+
private atlasMaterial?;
|
|
898
|
+
private atlasTexture?;
|
|
899
|
+
private unsubscribeAtlas?;
|
|
894
900
|
blockParent: Maybe<BlockObject>;
|
|
895
901
|
private meshesCreated;
|
|
896
902
|
constructor(originalModel: Model, options?: Partial<ModelObjectOptions>);
|
|
@@ -900,6 +906,10 @@ declare class ModelObject extends SceneObject {
|
|
|
900
906
|
protected loadTextures(): Promise<void>;
|
|
901
907
|
protected createMeshes(force?: boolean): void;
|
|
902
908
|
protected applyTextures(): void;
|
|
909
|
+
private updateAnimationSubscription;
|
|
910
|
+
nextInstance(): InstanceReference<SceneObject>;
|
|
911
|
+
removeInstanceAt(index: number): void;
|
|
912
|
+
disposeAndRemoveAllChildren(): void;
|
|
903
913
|
}
|
|
904
914
|
interface ModelObjectOptions extends SceneObjectOptions {
|
|
905
915
|
/** Minecraft display pose applied around the model center, before scene transforms. */
|
|
@@ -1073,6 +1083,8 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
|
|
|
1073
1083
|
get instanceCounter(): number;
|
|
1074
1084
|
protected constructInstanceReference(i: number): InstanceReference<SceneObject>;
|
|
1075
1085
|
nextInstance(): InstanceReference<SceneObject>;
|
|
1086
|
+
/** Returns the live reference for a raycast hit on this object's instance mesh. */
|
|
1087
|
+
getInstanceReference(mesh: Object3D, index: number): Maybe<InstanceReference<SceneObject>>;
|
|
1076
1088
|
isInstanceActive(index: number, reference: InstanceReference<Instanceable>): boolean;
|
|
1077
1089
|
removeInstanceAt(index: number): void;
|
|
1078
1090
|
private growInstances;
|
|
@@ -1100,6 +1112,17 @@ declare class SceneObject extends Object3D<Object3DEventMap & {
|
|
|
1100
1112
|
}
|
|
1101
1113
|
declare function isSceneObject(obj: any): obj is SceneObject;
|
|
1102
1114
|
|
|
1115
|
+
type FluidKind = "water" | "lava";
|
|
1116
|
+
declare function getFluidKind(key?: AssetKey): FluidKind | undefined;
|
|
1117
|
+
interface FluidSample {
|
|
1118
|
+
fluid?: FluidKind;
|
|
1119
|
+
level?: number;
|
|
1120
|
+
solid?: boolean;
|
|
1121
|
+
}
|
|
1122
|
+
type FluidSampler = (x: number, y: number, z: number) => FluidSample;
|
|
1123
|
+
/** Builds centered fluid faces with material groups 0 (still) and 1 (flowing). */
|
|
1124
|
+
declare function createFluidGeometry(kind: FluidKind, sample: FluidSampler): BufferGeometry;
|
|
1125
|
+
|
|
1103
1126
|
declare class BlockObject extends SceneObject {
|
|
1104
1127
|
readonly blockState: BlockState;
|
|
1105
1128
|
readonly isBlockObject: true;
|
|
@@ -1114,6 +1137,8 @@ declare class BlockObject extends SceneObject {
|
|
|
1114
1137
|
private _variants;
|
|
1115
1138
|
private _models;
|
|
1116
1139
|
private _cullMask;
|
|
1140
|
+
private _fluidKey?;
|
|
1141
|
+
private _fluidSampler?;
|
|
1117
1142
|
constructor(blockState: BlockState, options?: Partial<BlockObjectOptions>);
|
|
1118
1143
|
init(): Promise<void>;
|
|
1119
1144
|
dispose(): void;
|
|
@@ -1127,6 +1152,9 @@ declare class BlockObject extends SceneObject {
|
|
|
1127
1152
|
get state(): {
|
|
1128
1153
|
[key: string]: string;
|
|
1129
1154
|
};
|
|
1155
|
+
get fluidKind(): FluidKind | undefined;
|
|
1156
|
+
/** Refreshes fluid surfaces from relative neighbors; standalone previews use air around the block. */
|
|
1157
|
+
updateFluid(sample?: FluidSampler): Promise<void>;
|
|
1130
1158
|
nextInstance(): InstanceReference<SceneObject>;
|
|
1131
1159
|
protected mapStateToVariant(state: BlockStateProperties): Promise<BlockStateVariant[]>;
|
|
1132
1160
|
recreateModels(): Promise<void>;
|
|
@@ -1150,6 +1178,21 @@ interface BlockObjectOptions extends ModelObjectOptions {
|
|
|
1150
1178
|
}
|
|
1151
1179
|
declare function isBlockObject(obj: any): obj is BlockObject;
|
|
1152
1180
|
|
|
1181
|
+
/** Saved fluid levels and solid neighbors determine the geometry shared by an instance pool. */
|
|
1182
|
+
declare function sampleFluid(kind: FluidKind, sample: FluidSampler): {
|
|
1183
|
+
key: string;
|
|
1184
|
+
sample: FluidSampler;
|
|
1185
|
+
};
|
|
1186
|
+
declare class FluidModelObject extends ModelObject {
|
|
1187
|
+
readonly kind: FluidKind;
|
|
1188
|
+
private readonly sample;
|
|
1189
|
+
private geometry?;
|
|
1190
|
+
constructor(kind: FluidKind, sample: FluidSampler, origin: AssetKey, options?: Partial<ModelObjectOptions>);
|
|
1191
|
+
protected createMeshes(): void;
|
|
1192
|
+
protected applyTextures(): void;
|
|
1193
|
+
disposeAndRemoveAllChildren(): void;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1153
1196
|
interface MultiBlockStructure {
|
|
1154
1197
|
readonly size: TripleArray;
|
|
1155
1198
|
readonly blocks: MultiBlockBlock[];
|
|
@@ -1624,17 +1667,21 @@ declare class SceneInspector {
|
|
|
1624
1667
|
protected readonly raycaster: Raycaster;
|
|
1625
1668
|
private readonly mouse;
|
|
1626
1669
|
private selectedObject?;
|
|
1670
|
+
private pointer?;
|
|
1671
|
+
private readonly listeners;
|
|
1627
1672
|
constructor(renderer: Renderer);
|
|
1628
1673
|
protected init(): void;
|
|
1674
|
+
dispose(): void;
|
|
1629
1675
|
findMeshChildren(from: Object3D, out?: Mesh[]): Mesh<three.BufferGeometry<three.NormalBufferAttributes>, three.Material | three.Material[], three.Object3DEventMap>[];
|
|
1630
|
-
onClick(event:
|
|
1676
|
+
onClick(event: MouseEvent): void;
|
|
1631
1677
|
appendTo(el: HTMLElement): void;
|
|
1632
1678
|
protected handleRaycasterObjects(intersections: Intersection[]): void;
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
protected
|
|
1679
|
+
private getIntersectionInstance;
|
|
1680
|
+
selectObject(targetObject: Object3D, targetIntersection?: Intersection, instance?: Maybe<InstanceReference<SceneObject>>): void;
|
|
1681
|
+
protected redraw(targetObject: Object3D, targetIntersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
|
|
1682
|
+
protected addControls(object: Object3D, intersection?: Intersection, instance?: InstanceReference<SceneObject>): void;
|
|
1636
1683
|
protected addInfoLine(name: string, id: string, value: any): HTMLElement;
|
|
1637
|
-
protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement): void;
|
|
1684
|
+
protected addObjectControls(target: Object3D, intersection: Maybe<Intersection>, container: HTMLElement, instance?: InstanceReference<SceneObject>): void;
|
|
1638
1685
|
protected buttonControl(name: string, id: string, click: () => void): HTMLElement;
|
|
1639
1686
|
protected selectControl(name: string, id: string, options: string[], change: (v: string) => void): HTMLElement;
|
|
1640
1687
|
protected toggleControl(name: string, id: string, val: boolean, change: (v: boolean) => void): HTMLElement;
|
|
@@ -1933,4 +1980,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
1933
1980
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
1934
1981
|
}
|
|
1935
1982
|
|
|
1936
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, 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, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, 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 MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, 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, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, 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, axisToVec3, base64decode, base64encode, capeTextureSizes, 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 };
|
|
1983
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, 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, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type ElementFace, type ElementRotation, Entities, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, EntityObject, type EntityObjectOptions, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, 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 MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, 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, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, 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, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createImage, estimateBytesUsed, getFluidKind, 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, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode };
|