@needle-tools/engine 4.4.0-beta → 4.4.0-beta.10

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 (155) hide show
  1. package/CHANGELOG.md +65 -2
  2. package/dist/assets/generateMeshBVH.worker-b7788939.js +25 -0
  3. package/dist/needle-engine.bundle.js +6808 -6645
  4. package/dist/needle-engine.bundle.light.js +7071 -6908
  5. package/dist/needle-engine.bundle.light.min.js +169 -139
  6. package/dist/needle-engine.bundle.light.umd.cjs +173 -143
  7. package/dist/needle-engine.bundle.min.js +169 -139
  8. package/dist/needle-engine.bundle.umd.cjs +172 -142
  9. package/dist/needle-engine.d.ts +0 -9
  10. package/dist/needle-engine.js +468 -467
  11. package/dist/needle-engine.light.d.ts +0 -9
  12. package/dist/needle-engine.light.js +468 -467
  13. package/dist/needle-engine.light.min.js +1 -1
  14. package/dist/needle-engine.light.umd.cjs +1 -1
  15. package/dist/needle-engine.min.js +1 -1
  16. package/dist/needle-engine.umd.cjs +1 -1
  17. package/dist/postprocessing.js +1673 -1527
  18. package/dist/postprocessing.light.js +1673 -1527
  19. package/dist/postprocessing.light.min.js +80 -66
  20. package/dist/postprocessing.light.umd.cjs +83 -69
  21. package/dist/postprocessing.min.js +80 -66
  22. package/dist/postprocessing.umd.cjs +83 -69
  23. package/dist/vendor.js +5109 -5123
  24. package/dist/vendor.light.js +5109 -5123
  25. package/dist/vendor.light.min.js +84 -84
  26. package/dist/vendor.light.umd.cjs +78 -78
  27. package/dist/vendor.min.js +84 -84
  28. package/dist/vendor.umd.cjs +78 -78
  29. package/lib/engine/codegen/register_types.js +2 -0
  30. package/lib/engine/codegen/register_types.js.map +1 -1
  31. package/lib/engine/engine_addressables.js.map +1 -1
  32. package/lib/engine/engine_components.js +3 -1
  33. package/lib/engine/engine_components.js.map +1 -1
  34. package/lib/engine/engine_context.d.ts +10 -1
  35. package/lib/engine/engine_context.js +33 -12
  36. package/lib/engine/engine_context.js.map +1 -1
  37. package/lib/engine/engine_element.js +12 -10
  38. package/lib/engine/engine_element.js.map +1 -1
  39. package/lib/engine/engine_gameobject.js +5 -0
  40. package/lib/engine/engine_gameobject.js.map +1 -1
  41. package/lib/engine/engine_license.d.ts +2 -0
  42. package/lib/engine/engine_license.js +103 -62
  43. package/lib/engine/engine_license.js.map +1 -1
  44. package/lib/engine/engine_networking_blob.js +40 -24
  45. package/lib/engine/engine_networking_blob.js.map +1 -1
  46. package/lib/engine/engine_physics_rapier.js +10 -9
  47. package/lib/engine/engine_physics_rapier.js.map +1 -1
  48. package/lib/engine/engine_serialization_core.js +6 -2
  49. package/lib/engine/engine_serialization_core.js.map +1 -1
  50. package/lib/engine/engine_utils_screenshot.js +1 -1
  51. package/lib/engine/engine_utils_screenshot.js.map +1 -1
  52. package/lib/engine/js-extensions/RGBAColor.d.ts +1 -0
  53. package/lib/engine/js-extensions/RGBAColor.js +48 -0
  54. package/lib/engine/js-extensions/RGBAColor.js.map +1 -1
  55. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +4 -3
  56. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js.map +1 -1
  57. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +6 -6
  58. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  59. package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +4 -0
  60. package/lib/engine/webcomponents/needle menu/needle-menu.js +13 -2
  61. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  62. package/lib/engine/xr/NeedleXRController.js +2 -3
  63. package/lib/engine/xr/NeedleXRController.js.map +1 -1
  64. package/lib/engine/xr/NeedleXRSession.js +12 -12
  65. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  66. package/lib/engine-components/AudioSource.js +7 -0
  67. package/lib/engine-components/AudioSource.js.map +1 -1
  68. package/lib/engine-components/Camera.js +18 -12
  69. package/lib/engine-components/Camera.js.map +1 -1
  70. package/lib/engine-components/CameraUtils.js +8 -14
  71. package/lib/engine-components/CameraUtils.js.map +1 -1
  72. package/lib/engine-components/GroundProjection.js +1 -1
  73. package/lib/engine-components/GroundProjection.js.map +1 -1
  74. package/lib/engine-components/NeedleMenu.js +1 -1
  75. package/lib/engine-components/NeedleMenu.js.map +1 -1
  76. package/lib/engine-components/OrbitControls.js +3 -1
  77. package/lib/engine-components/OrbitControls.js.map +1 -1
  78. package/lib/engine-components/ReflectionProbe.d.ts +1 -0
  79. package/lib/engine-components/ReflectionProbe.js +16 -9
  80. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  81. package/lib/engine-components/SceneSwitcher.js +28 -7
  82. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  83. package/lib/engine-components/SyncedTransform.d.ts +6 -0
  84. package/lib/engine-components/SyncedTransform.js +10 -5
  85. package/lib/engine-components/SyncedTransform.js.map +1 -1
  86. package/lib/engine-components/codegen/components.d.ts +1 -0
  87. package/lib/engine-components/codegen/components.js +1 -0
  88. package/lib/engine-components/codegen/components.js.map +1 -1
  89. package/lib/engine-components/export/usdz/extensions/USDZUI.js +2 -1
  90. package/lib/engine-components/export/usdz/extensions/USDZUI.js.map +1 -1
  91. package/lib/engine-components/ui/BaseUIComponent.d.ts +0 -1
  92. package/lib/engine-components/ui/BaseUIComponent.js +1 -1
  93. package/lib/engine-components/ui/BaseUIComponent.js.map +1 -1
  94. package/lib/engine-components/ui/EventSystem.js +1 -1
  95. package/lib/engine-components/ui/EventSystem.js.map +1 -1
  96. package/lib/engine-components/ui/Graphic.js +1 -0
  97. package/lib/engine-components/ui/Graphic.js.map +1 -1
  98. package/lib/engine-components/ui/RaycastUtils.js +1 -1
  99. package/lib/engine-components/ui/RaycastUtils.js.map +1 -1
  100. package/lib/engine-components/ui/RectTransform.d.ts +2 -2
  101. package/lib/engine-components/ui/RectTransform.js +9 -6
  102. package/lib/engine-components/ui/RectTransform.js.map +1 -1
  103. package/lib/engine-components/ui/Symbols.d.ts +1 -0
  104. package/lib/engine-components/ui/Symbols.js +2 -0
  105. package/lib/engine-components/ui/Symbols.js.map +1 -0
  106. package/lib/engine-components/ui/Utils.js +1 -1
  107. package/lib/engine-components/ui/Utils.js.map +1 -1
  108. package/lib/engine-components/utils/EnvironmentScene.d.ts +1 -1
  109. package/lib/engine-components/utils/EnvironmentScene.js +1 -1
  110. package/lib/engine-components/utils/EnvironmentScene.js.map +1 -1
  111. package/package.json +3 -3
  112. package/plugins/common/buildinfo.js +1 -0
  113. package/plugins/common/cloud.js +2 -0
  114. package/plugins/common/license.js +174 -33
  115. package/plugins/types/userconfig.d.ts +5 -0
  116. package/plugins/vite/build-pipeline.js +4 -3
  117. package/plugins/vite/dependencies.js +17 -7
  118. package/plugins/vite/facebook-instant-games.js +7 -4
  119. package/plugins/vite/index.js +1 -1
  120. package/src/engine/codegen/register_types.ts +2 -0
  121. package/src/engine/engine_addressables.ts +3 -2
  122. package/src/engine/engine_components.ts +2 -1
  123. package/src/engine/engine_context.ts +36 -12
  124. package/src/engine/engine_element.ts +10 -9
  125. package/src/engine/engine_gameobject.ts +7 -0
  126. package/src/engine/engine_license.ts +116 -67
  127. package/src/engine/engine_networking_blob.ts +47 -26
  128. package/src/engine/engine_physics_rapier.ts +10 -12
  129. package/src/engine/engine_serialization_core.ts +6 -1
  130. package/src/engine/engine_utils_screenshot.ts +1 -1
  131. package/src/engine/js-extensions/RGBAColor.ts +50 -0
  132. package/src/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +6 -6
  133. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +6 -6
  134. package/src/engine/webcomponents/needle menu/needle-menu.ts +13 -2
  135. package/src/engine/xr/NeedleXRController.ts +2 -3
  136. package/src/engine/xr/NeedleXRSession.ts +12 -12
  137. package/src/engine-components/AudioSource.ts +8 -3
  138. package/src/engine-components/Camera.ts +34 -22
  139. package/src/engine-components/CameraUtils.ts +8 -16
  140. package/src/engine-components/GroundProjection.ts +1 -1
  141. package/src/engine-components/NeedleMenu.ts +1 -1
  142. package/src/engine-components/OrbitControls.ts +2 -1
  143. package/src/engine-components/ReflectionProbe.ts +15 -8
  144. package/src/engine-components/SceneSwitcher.ts +28 -11
  145. package/src/engine-components/SyncedTransform.ts +11 -6
  146. package/src/engine-components/codegen/components.ts +1 -0
  147. package/src/engine-components/export/usdz/extensions/USDZUI.ts +2 -2
  148. package/src/engine-components/ui/BaseUIComponent.ts +1 -1
  149. package/src/engine-components/ui/EventSystem.ts +1 -1
  150. package/src/engine-components/ui/Graphic.ts +1 -1
  151. package/src/engine-components/ui/RaycastUtils.ts +1 -1
  152. package/src/engine-components/ui/RectTransform.ts +10 -7
  153. package/src/engine-components/ui/Symbols.ts +2 -0
  154. package/src/engine-components/ui/Utils.ts +2 -1
  155. package/src/engine-components/utils/EnvironmentScene.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -4,7 +4,10 @@ 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.4.0-beta] - 2025-03-28
7
+ ## [4.4.0] - 2025-04-17
8
+ **Added**
9
+ - Add: The needle-engine web-component `contactshadows` attribute now allows you to specify a factor for controlling the darkness/lightness. E.g. `<needle-engine contactshadows="1">` will make the shadows appear darker vs. `<needle-engine contactshadows=".2">` will make the contact shadow appear lighter.
10
+ - Add: The needle-engine web-component does now support transparency for `background-color`. For example: `rgba(255, 255, 100, .5)` or `#ffdddd99` or `transparent` are valid values: `<needle-engine background-color="rgba(255, 255, 100, .5)" />`
8
11
  - Add: `ObjectUtils.createPrimitive()` now supports scale as array
9
12
  e.g. `ObjectUtils.createPrimitive("Cube", { scale: [1, .25, 1] } );`
10
13
  - Add: Input `getGamepad(<index>)` function to query a connected gamepad. Example: `this.context.input.getGamepad()`
@@ -13,6 +16,66 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
13
16
  ```ts
14
17
  import { Behaviour, lookAtScreenPoint } from "@needle-tools/engine";
15
18
 
19
+ export class LookAtMouse extends Behaviour {
20
+ update() {
21
+ lookAtScreenPoint(this.gameObject, this.context.input.mousePosition, this.context.mainCamera);
22
+ }
23
+ }
24
+ ```
25
+ - Add: Default environment lighting. If you don't configure any environment-image needle engine will now create a default scene to light your objects. Previously the scene was just black when the loaded model didn't contain any lighting information.
26
+ - Add: SyncedTransform does now also sync scale changes
27
+ - Add: SyncedTransform `freeOwnership()` method
28
+ - Add: ReflectionProbe bounding box intersection check to automatically apply reflections to object's in a specific area (handled by the Renderer component)
29
+ - Add: `devicePixelRatio` option on Needle Context. This option controls the window.devicePixelRatio set on the renderer by Needle Engine (default `auto`). It can be set to `manual` to disable this behaviour or a custom number which will then be set on the renderer or composer.
30
+
31
+ **Fixed**
32
+ - Fix: Implicit camera did not automatically set to skybox when using `background-image`. E.g. `<needle-engine background-image="<url>">
33
+ - Fix: Tonemapping falsely set tonemappingEsposure to undefined causing a black screen
34
+ - Fix: `background-color` attribute was not always applied. E.g. `<needle-engine background-color="#ff3333">`
35
+ - Fix: `screenshot()` checks if XR is presenting
36
+ - Fix: Issue where MeshBVH worker import breaks for projects where the needle-engine vite plugins are not added to the plugins list
37
+ - Fix: SceneSwitcher regression with `Object3D` objects in scenes array
38
+ - Fix: SceneSwitcher preload was not using three.js FileLoader to re-use three's caching system
39
+ - Fix: GroundProjection regression where background blurriness was hardcoded
40
+ - Fix: RenderTexture regression where deserialization was not properly handled anymore
41
+ - Fix: OrbitControls regression where forward direction in `setCameraAndLookTarget` was inverted
42
+ - Fix: Physics bug where negative box collider scales were not correctly handled in all cases causing Rapier to break
43
+ - Fix: UI instantiate bug where three-mesh-ui `clone` method was not working and UI that was already in the scene could not be duplicated because of that.
44
+ - Fix: Vite license plugin not waiting for the CLI process to start
45
+ - Fix: Vite improve license checks in CI environments (e.g. when running via a Github Action).
46
+ - Fix: Vite plugins for running in CI environment
47
+ - Fix: Vite `manualChunks` are not defined when `preserveModules` is set to true
48
+
49
+ **Changed**
50
+ - Change: License check aborts now faster instead of retrying when connection is actively refused
51
+ - Change: OrbitControls `autoTarget` does now automatically update the look at target after panning and not when rotating the camera (previously the target would be updated after any input but this resultet in undesireable behaviour when rotating around objects)
52
+ - Change: When no background-color is defined by either the loaded scene or by a `background-color` attribute then the default scene background color respects the user's accessibility setting for `prefer-dark` or `prefer-light`. This means that the background color will be set to a default light or dark value.
53
+ - Change: Scene background color or image set on `<needle-engine>` are not overridden anymore by the camera component.
54
+ - Change: Hide Needle logo automatically when using Needle Engine with a license
55
+
56
+ ## [4.4.0-beta.9] - 2025-04-07
57
+ - Add: `<needle-engine background-color="#ffdddd55">` does now support transparency. For example: `rgba(255, 255, 100, .5)` or `#ffdddd99` or `transparent` are valid values.
58
+ - Add: SyncedTransform `freeOwnership()` method
59
+ - Add: ReflectionProbe does now check boundingbox intersection
60
+ - Add: `devicePixelRatio` option on Needle Context. This option controls the window.devicePixelRatio set on the renderer by Needle Engine (default `auto`). It can be set to `manual` to disable this behaviour or a custom number which will then be set on the renderer or composer.
61
+ - Change: Scene background color or image set on `<needle-engine>` are not overridden anymore by the camera component.
62
+ - Change: Hide Needle logo automatically when using Needle Engine with a license
63
+ - Fix: Improve license checks in CI environments (e.g. when running via a Github Action).
64
+ - Fix: Vite plugins for running in CI environment
65
+ - Fix: Vite `manualChunks` are not defined when `preserveModules` is set to true
66
+ - Fix: `screenshot()` checks if XR is presenting
67
+ - Fix: Issue where MeshBVH worker import breaks for projects where the needle-engine vite plugins are not added to the plugins list
68
+ - Fix: Vite license plugin not waiting for the CLI process to start
69
+
70
+ ## [4.4.0-beta] - 2025-03-28
71
+ - Add: `ObjectUtils.createPrimitive()` now supports scale as array
72
+ e.g. `ObjectUtils.createPrimitive("Cube", { scale: [1, .25, 1] } );`
73
+ - Add: Input `getGamepad(index?:number)` function to query a connected gamepad. Example: `this.context.input.getGamepad()`
74
+ - Add: `lookAtScreenPoint()` function which allows 3D object to look at points in 2D screen coordinates (e.g. your mouse position).
75
+ **Example Component that makes the object look at the mouse**
76
+ ```ts
77
+ import { Behaviour, lookAtScreenPoint } from "@needle-tools/engine";
78
+
16
79
  export class LookAtMouse extends Behaviour {
17
80
  update() {
18
81
  lookAtScreenPoint(this.gameObject, this.context.input.mousePosition, this.context.mainCamera);
@@ -22,7 +85,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
22
85
  - Add: SyncedTransform does now also sync scale changes
23
86
  - Add: Default environment lighting. If you don't configure any environment-image needle engine will now create a default scene to light your objects. Previously the scene was just black when the loaded model didn't contain any lighting information.
24
87
  - Add: The `contactshadows` attribute now allows you to specify a factor for controlling the darkness/lightness. E.g. `<needle-engine contactshadows="1">` will make the shadows appear darker vs. `<needle-engine contactshadows=".2">` will make the contact shadow appear lighter.
25
- - Fix: Implicit camera did not automatically set to skybox when using `background-image`. E.g. `<needle-engine background-image="<url>">
88
+ - Fix: Implicit camera did not automatically set to skybox when using `background-image`. E.g. `<needle-engine background-image="<url>">`
26
89
  - Fix: Tonemapping falsely set tonemappingEsposure to undefined causing a black screen
27
90
  - Fix: `background-color` attribute was not always applied. E.g. `<needle-engine background-color="#ff3333">`
28
91
  - Change: License check aborts now faster instead of retrying when connection is actively refused