@needle-tools/engine 4.5.0-alpha.3 → 4.5.0-alpha.5
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 +22 -2
- package/dist/{needle-engine.bundle-56f095f1.light.min.js → needle-engine.bundle-3a87a331.light.min.js} +89 -88
- package/dist/{needle-engine.bundle-ef2b8438.umd.cjs → needle-engine.bundle-6f1f506d.umd.cjs} +83 -82
- package/dist/{needle-engine.bundle-1b8f44f4.js → needle-engine.bundle-716cf6ce.js} +2245 -2248
- package/dist/{needle-engine.bundle-d710d96f.light.js → needle-engine.bundle-946378ce.light.js} +1681 -1684
- package/dist/{needle-engine.bundle-baacde19.min.js → needle-engine.bundle-d2825f28.min.js} +89 -88
- package/dist/{needle-engine.bundle-9fe9a394.light.umd.cjs → needle-engine.bundle-ee9f7e66.light.umd.cjs} +88 -87
- package/dist/needle-engine.js +24 -24
- package/dist/needle-engine.light.js +24 -24
- package/dist/needle-engine.light.min.js +1 -1
- package/dist/needle-engine.light.umd.cjs +1 -1
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_components.js +6 -14
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_loaders.callbacks.d.ts +43 -9
- package/lib/engine/engine_loaders.callbacks.js +42 -12
- package/lib/engine/engine_loaders.callbacks.js.map +1 -1
- package/lib/engine/engine_loaders.js +35 -19
- package/lib/engine/engine_loaders.js.map +1 -1
- package/lib/engine/engine_utils_format.d.ts +5 -5
- package/lib/engine/engine_utils_format.js +37 -34
- package/lib/engine/engine_utils_format.js.map +1 -1
- package/package.json +11 -3
- package/plugins/types/next.d.ts +3 -0
- package/plugins/types/vite.d.ts +4 -0
- package/plugins/vite/dependencies.js +1 -1
- package/src/engine/engine_components.ts +4 -12
- package/src/engine/engine_loaders.callbacks.ts +63 -17
- package/src/engine/engine_loaders.ts +34 -19
- package/src/engine/engine_utils_format.ts +51 -37
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,32 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
## [4.5.0-alpha.
|
|
7
|
+
## [4.5.0-alpha.5] - 2025-05-09
|
|
8
8
|
- Add: `NeedleEngineModelLoader` namespace with methods to provide custom file loaders to load unsupported 3D model formats. For example to load STL files:
|
|
9
9
|
```ts
|
|
10
10
|
import { NeedleEngineModelLoader } from "@needle-tools/engine";
|
|
11
11
|
|
|
12
|
+
// Register a callback for determining our custom loader mimetype
|
|
13
|
+
NeedleEngineModelLoader.onDetermineModelMimetype(args => {
|
|
14
|
+
// check if the mimetype is already provided by the server
|
|
15
|
+
if (args.contentType === "model/stl") {
|
|
16
|
+
return "model/stl";
|
|
17
|
+
}
|
|
18
|
+
// use URL extension if available
|
|
19
|
+
if (args.url.endsWith(".stl")) {
|
|
20
|
+
return "model/stl";
|
|
21
|
+
}
|
|
22
|
+
// check if first few bytes start with "solid"
|
|
23
|
+
// this is a very naive check, but it works for most cases
|
|
24
|
+
if(args.bytes[0] === 0x73 && args.bytes[1] === 0x74 && args.bytes[2] === 0x6c) {
|
|
25
|
+
return "model/stl";
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Register a callback for creating our custom loader
|
|
12
31
|
NeedleEngineModelLoader.onCreateCustomModelLoader(args => {
|
|
13
|
-
if (args.
|
|
32
|
+
if (args.mimetype === "model/stl") {
|
|
14
33
|
const stlLoader = new STLLoader();
|
|
15
34
|
return stlLoader;
|
|
16
35
|
}
|
|
@@ -23,6 +42,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
23
42
|
- Removed: Web component attributes: `loading-background-color`, `loading-style`, `loading-text-color`
|
|
24
43
|
- Fix: Vite HMR (Hot Module Replacement) working nicely with browser breakpoints and debugging
|
|
25
44
|
- Fix: Debug stats (`?stats`) showing correct draw calls when using postprocessing
|
|
45
|
+
- Fix: `findObjectOfType` does now also search components on the root scene object
|
|
26
46
|
|
|
27
47
|
## [4.4.6] - 2025-05-05
|
|
28
48
|
- Change: Networking disconnect() should reset state + leaveRoom does now reset allowEditing to true
|