illutions 0.28.0 → 0.29.0
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/CHANGELOG.md +35 -28
- package/dist/main.d.ts +80 -0
- package/dist/main.min.cjs +1 -1
- package/dist/main.min.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
|
|
7
|
-
- Added `Mesh3D.
|
|
8
|
-
- Added the
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
3
|
+
## 0.29.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added protected `Mesh3D.setTexture()` to assign unused GLTF images by name to the `ColorMap`, `LightMap`, or `AlphaMap` material slot, with optional UV channel and light map intensity settings; registered textures are updated across progressive model levels.
|
|
8
|
+
- Added the exported `TextureSlot` union for the supported material slots.
|
|
9
|
+
|
|
10
|
+
## 0.28.0
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added `Mesh3D.animMaterialColor()`, `Mesh3D.animMaterialNumeric()`, and `Mesh3D.setMaterialProperties()` as object-bound counterparts to the existing `Engine` material methods.
|
|
15
|
+
- Added the optional `needsUpdate` parameter to `Engine.animMaterialNumeric()`, `Engine.setMaterialProperties()`, `Mesh3D.animMaterialNumeric()`, and `Mesh3D.setMaterialProperties()` to request material recompilation.
|
|
16
|
+
- Added degree-based horizontal orbit constraints through `orbitCtrls.minAzimuthAngle` and `orbitCtrls.maxAzimuthAngle`.
|
|
17
|
+
- Added `ModelLoadedEvent` with `Model_Loaded` for a single model and numbered `Model1_Loaded`, `Model2_Loaded`, etc. events for progressive models.
|
|
18
|
+
- Added the `Model_Ready` event after the final progressive model variant has been applied and rendered.
|
|
19
|
+
- Added the exported `Collider` configuration and `Raycast.setColliders()` and `Raycast.clearColliders()` to configure named scene objects or `Obj3D` instances as occluders, pickables, or hidden colliders.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Replaced `Raycast.setOccluders()`, `Raycast.resetOccluders()`, `Raycast.trackPickables()`, and `Raycast.untrackPickables()` with the unified collider API.
|
|
24
|
+
- Renamed `Raycast.enable()` and `Raycast.disable()` to `Raycast.enablePickables()` and `Raycast.disablePickables()`.
|
|
25
|
+
- Renamed `raycast.occlInterval` to `raycast.occludeeInterval` and `raycast.occlMoveFactor` to `raycast.occlusionMoveFactor`.
|
|
26
|
+
- Changed progressive `ModelLoadingEvent` and `SceneRenderedEvent` types to numbered `Model1_Loading`, `Scene1_Rendered`, etc. events; unnumbered events remain available for a single model.
|
|
27
|
+
- Removed the `level` property from `ModelLoadingEvent`; the progressive model level is now identified by the event type.
|
|
28
|
+
- Removed the obsolete `fct` property from `ClipEvent`.
|
|
29
|
+
- Changed pointer raycasts so that registered occluders block pickables behind them.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- Corrected `CanvasPointerEvent` to expose `Canvas_Click`, `Canvas_Pointer_Enter`, and `Canvas_Pointer_Leave`.
|
|
34
|
+
- Added the already emitted `FpvCtrls_Disposed` event to `FpvCtrlsEvent`.
|
|
35
|
+
- Delayed the postprocessing noise check until `Model_Ready` so that postprocessing is not disabled before the final progressive model variant is rendered.
|
|
36
|
+
|
|
30
37
|
## 0.27.0
|
|
31
38
|
|
|
32
39
|
### Added
|
|
@@ -159,4 +166,4 @@
|
|
|
159
166
|
|
|
160
167
|
### Changed
|
|
161
168
|
|
|
162
|
-
- Added `cfg.audio.enable` to the configuration.
|
|
169
|
+
- Added `cfg.audio.enable` to the configuration.
|
package/dist/main.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
|
8
8
|
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
|
|
9
9
|
import { EXRLoader } from 'three/addons/loaders/EXRLoader.js';
|
|
10
10
|
import { FXAAShader } from 'three/addons/shaders/FXAAShader.js';
|
|
11
|
+
import { GLTF } from 'three/addons/loaders/GLTFLoader.js';
|
|
11
12
|
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
12
13
|
import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
|
|
13
14
|
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
|
|
@@ -1660,6 +1661,7 @@ export declare class Mesh3D extends Obj3D {
|
|
|
1660
1661
|
groundReflector: ReflectorForSSRPass | null;
|
|
1661
1662
|
/** Objects that participate in the screen-space reflection (SSR) effect. These objects are used for reflective rendering in the scene. */
|
|
1662
1663
|
reflectivesSSR: THREE_TYPE.Object3D[];
|
|
1664
|
+
private model;
|
|
1663
1665
|
/* Excluded from this release type: lib */
|
|
1664
1666
|
/* Excluded from this release type: __constructor */
|
|
1665
1667
|
/**
|
|
@@ -1700,6 +1702,23 @@ export declare class Mesh3D extends Obj3D {
|
|
|
1700
1702
|
needsUpdate?: boolean;
|
|
1701
1703
|
[key: string]: any;
|
|
1702
1704
|
}): void;
|
|
1705
|
+
/**
|
|
1706
|
+
* Loads an unused texture embedded in the current GLTF and assigns it to a material.
|
|
1707
|
+
* @param options - Unused texture assignment settings.
|
|
1708
|
+
* @param options.name - Name of the GLTF image used by the texture.
|
|
1709
|
+
* @param options.material - Material that receives the unused texture.
|
|
1710
|
+
* @param options.slot - Target material texture slot. See {@link TextureSlot}.
|
|
1711
|
+
* @param options.lightMapIntensity - Light map intensity used for `LightMap`. Default: **1**
|
|
1712
|
+
* @param options.channel - Texture UV channel. Default: **1**
|
|
1713
|
+
* @public
|
|
1714
|
+
*/
|
|
1715
|
+
protected setTexture({ name, material, slot, lightMapIntensity, channel }: {
|
|
1716
|
+
name: string;
|
|
1717
|
+
material: THREE_TYPE.MeshBasicMaterial | THREE_TYPE.MeshStandardMaterial;
|
|
1718
|
+
slot: TextureSlot;
|
|
1719
|
+
lightMapIntensity?: number;
|
|
1720
|
+
channel?: number;
|
|
1721
|
+
}): void;
|
|
1703
1722
|
/**
|
|
1704
1723
|
* Called for each traversed mesh during GLTF parsing. Stores the current `THREE.Mesh` in `this.obj`.
|
|
1705
1724
|
* @param objGltf - The currently traversed mesh.
|
|
@@ -1709,6 +1728,7 @@ export declare class Mesh3D extends Obj3D {
|
|
|
1709
1728
|
* {@includeCode ../../examples/mesh3D-cube.ts}
|
|
1710
1729
|
*/
|
|
1711
1730
|
protected onTraverse(objGltf: THREE_TYPE.Mesh): void;
|
|
1731
|
+
/* Excluded from this release type: setModel */
|
|
1712
1732
|
/* Excluded from this release type: setReflectivesSSR */
|
|
1713
1733
|
/* Excluded from this release type: traverse */
|
|
1714
1734
|
}
|
|
@@ -1735,6 +1755,41 @@ export declare interface MeshCfg {
|
|
|
1735
1755
|
frustumCulled: boolean;
|
|
1736
1756
|
}
|
|
1737
1757
|
|
|
1758
|
+
declare class Model {
|
|
1759
|
+
private readonly canvas;
|
|
1760
|
+
private readonly cfg;
|
|
1761
|
+
private readonly events;
|
|
1762
|
+
private readonly modules;
|
|
1763
|
+
private readonly renderer;
|
|
1764
|
+
private readonly initFirstScene;
|
|
1765
|
+
private readonly reportModelReady;
|
|
1766
|
+
private readonly rendererReady;
|
|
1767
|
+
private readonly waitForRender;
|
|
1768
|
+
/* Excluded from this release type: sceneReady */
|
|
1769
|
+
private resolveSceneReady;
|
|
1770
|
+
private rejectSceneReady;
|
|
1771
|
+
private gltf;
|
|
1772
|
+
private meshes;
|
|
1773
|
+
private scene;
|
|
1774
|
+
private readonly textsUsed;
|
|
1775
|
+
private readonly textsUnused;
|
|
1776
|
+
constructor({ canvas, cfg, events, modules, renderer, rendererReady, initFirstScene: initFirstScene, reportModelReady, waitForRender }: ModelParams);
|
|
1777
|
+
private addMaterials;
|
|
1778
|
+
private addText;
|
|
1779
|
+
private addTextUnused;
|
|
1780
|
+
private loadTextsUnused;
|
|
1781
|
+
private applyTextsUnused;
|
|
1782
|
+
private disposeObsoleteResources;
|
|
1783
|
+
/* Excluded from this release type: load */
|
|
1784
|
+
private loadGltf;
|
|
1785
|
+
private loadTextUnused;
|
|
1786
|
+
private reportError;
|
|
1787
|
+
/* Excluded from this release type: setTextUsed */
|
|
1788
|
+
private updateMaterials;
|
|
1789
|
+
private updateMeshes;
|
|
1790
|
+
private updateTextImages;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1738
1793
|
/**
|
|
1739
1794
|
* Defines the GLTF/GLB model loading settings used to fetch models and configure optional Draco decoding.
|
|
1740
1795
|
* @category Cfg
|
|
@@ -1791,6 +1846,18 @@ export declare interface ModelLoadingEvent {
|
|
|
1791
1846
|
loading: number;
|
|
1792
1847
|
}
|
|
1793
1848
|
|
|
1849
|
+
declare interface ModelParams {
|
|
1850
|
+
canvas: HTMLElement;
|
|
1851
|
+
cfg: Cfg;
|
|
1852
|
+
events: Events;
|
|
1853
|
+
modules: Modules;
|
|
1854
|
+
renderer: Renderer_2;
|
|
1855
|
+
rendererReady: Promise<void> | null;
|
|
1856
|
+
initFirstScene: (gltf: GLTF) => Map<string, THREE_TYPE.Mesh>;
|
|
1857
|
+
reportModelReady: () => void;
|
|
1858
|
+
waitForRender: () => Promise<void>;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1794
1861
|
/** @event Fired after the final progressive model variant has been applied and rendered and triggers the corresponding XState event. */
|
|
1795
1862
|
export declare interface ModelReadyEvent {
|
|
1796
1863
|
/** Identifies this event type. */
|
|
@@ -2471,6 +2538,8 @@ export declare interface RenderCfg {
|
|
|
2471
2538
|
/** Defines the available renderer backends. */
|
|
2472
2539
|
export declare type Renderer = 'webgl' | 'webgpu' | 'auto';
|
|
2473
2540
|
|
|
2541
|
+
declare type Renderer_2 = THREE_TYPE.WebGLRenderer | THREE_WEBGPU_TYPE.WebGPURenderer;
|
|
2542
|
+
|
|
2474
2543
|
/**
|
|
2475
2544
|
* Defines the scene settings used to configure background, environment, model, fog and lights.
|
|
2476
2545
|
* @category Cfg
|
|
@@ -2776,6 +2845,17 @@ export declare interface StateMachineCfg {
|
|
|
2776
2845
|
*/
|
|
2777
2846
|
export declare type StopMode = 'all' | 'last' | 'none';
|
|
2778
2847
|
|
|
2848
|
+
/**
|
|
2849
|
+
* Defines the material texture slots available for unused GLTF images.
|
|
2850
|
+
*
|
|
2851
|
+
* - `ColorMap` assigns the texture to `map`. Use it with a `MeshBasicMaterial` for a fully baked color texture.
|
|
2852
|
+
* - `LightMap` assigns the texture to the `lightMap` slot and requires a `MeshStandardMaterial`.
|
|
2853
|
+
* - `AlphaMap` assigns a separate alpha texture to the `alphaMap` slot, which GLTF does not support natively.
|
|
2854
|
+
*/
|
|
2855
|
+
export declare type TextureSlot = 'ColorMap' | 'LightMap' | 'AlphaMap';
|
|
2856
|
+
|
|
2857
|
+
/* Excluded from this release type: TextUsed */
|
|
2858
|
+
|
|
2779
2859
|
/** Function returned by an event subscription. Calling it removes the associated listener. */
|
|
2780
2860
|
export declare type Unsubscribe = () => void;
|
|
2781
2861
|
|