@needle-tools/engine 4.5.0-alpha.2 → 4.5.0-alpha.4

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/dist/{needle-engine.bundle-a52706c5.umd.cjs → needle-engine.bundle-1ea82d1b.umd.cjs} +74 -73
  3. package/dist/{needle-engine.bundle-f3c8cffc.light.umd.cjs → needle-engine.bundle-5799046c.light.umd.cjs} +74 -73
  4. package/dist/{needle-engine.bundle-53f80c62.js → needle-engine.bundle-613ac05e.js} +757 -750
  5. package/dist/{needle-engine.bundle-1526f05b.light.js → needle-engine.bundle-82027067.light.js} +944 -937
  6. package/dist/{needle-engine.bundle-15b19b2c.light.min.js → needle-engine.bundle-cb8d3ee9.light.min.js} +74 -73
  7. package/dist/{needle-engine.bundle-2024e2b3.min.js → needle-engine.bundle-e8936122.min.js} +74 -73
  8. package/dist/needle-engine.js +24 -24
  9. package/dist/needle-engine.light.js +24 -24
  10. package/dist/needle-engine.light.min.js +1 -1
  11. package/dist/needle-engine.light.umd.cjs +1 -1
  12. package/dist/needle-engine.min.js +1 -1
  13. package/dist/needle-engine.umd.cjs +1 -1
  14. package/lib/engine/engine_components.js +6 -14
  15. package/lib/engine/engine_components.js.map +1 -1
  16. package/lib/engine/engine_context_registry.d.ts +2 -2
  17. package/lib/engine/engine_context_registry.js +2 -2
  18. package/lib/engine/engine_context_registry.js.map +1 -1
  19. package/lib/engine/engine_loaders.callbacks.d.ts +43 -9
  20. package/lib/engine/engine_loaders.callbacks.js +42 -12
  21. package/lib/engine/engine_loaders.callbacks.js.map +1 -1
  22. package/lib/engine/engine_loaders.js +18 -15
  23. package/lib/engine/engine_loaders.js.map +1 -1
  24. package/lib/engine/engine_utils_format.d.ts +5 -5
  25. package/lib/engine/engine_utils_format.js +31 -31
  26. package/lib/engine/engine_utils_format.js.map +1 -1
  27. package/lib/engine-components/ContactShadows.d.ts +12 -0
  28. package/lib/engine-components/ContactShadows.js +23 -0
  29. package/lib/engine-components/ContactShadows.js.map +1 -1
  30. package/lib/engine-components/webxr/controllers/XRControllerModel.js.map +1 -1
  31. package/package.json +1 -1
  32. package/plugins/vite/dependencies.js +1 -1
  33. package/src/engine/engine_components.ts +4 -12
  34. package/src/engine/engine_context_registry.ts +2 -2
  35. package/src/engine/engine_loaders.callbacks.ts +63 -17
  36. package/src/engine/engine_loaders.ts +17 -15
  37. package/src/engine/engine_utils_format.ts +45 -34
  38. package/src/engine-components/ContactShadows.ts +24 -0
  39. package/src/engine-components/webxr/controllers/XRControllerModel.ts +0 -2
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.2] - 2025-05-09
7
+ ## [4.5.0-alpha.4] - 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.filetype === "stl") {
32
+ if (args.mimetype === "model/stl") {
14
33
  const stlLoader = new STLLoader();
15
34
  return stlLoader;
16
35
  }
@@ -18,10 +37,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
18
37
  ```
19
38
  - Add: Experimental attribute to autostart **AR**: `<needle-engine autostart="ar">`
20
39
  - Add: Modify the QR code button URL via `ButtonsFactory.instance.qrButtonUrl = https://yourwebsite.de`
40
+ - Add: ContactShadows `manualUpdate` boolean. When enabled the ContactShadows component will not automatically re-render every frame. When enabled then set `needsUpdate=true` to manually schedule contact shadows re-render
21
41
  - Change: Needle Engine loading view is now transparent by default. The `loading-background` attribute can be used to add custom styling like `<needle-engine loading-background="#000" />`. Alternatively the `<needle-engine>` web component or background can be styled.
22
42
  - Removed: Web component attributes: `loading-background-color`, `loading-style`, `loading-text-color`
23
43
  - Fix: Vite HMR (Hot Module Replacement) working nicely with browser breakpoints and debugging
24
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
25
46
 
26
47
  ## [4.4.6] - 2025-05-05
27
48
  - Change: Networking disconnect() should reset state + leaveRoom does now reset allowEditing to true