@needle-tools/engine 4.4.0-ci.1 → 4.4.2

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 (147) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/assets/generateMeshBVH.worker-b7788939.js +25 -0
  3. package/dist/needle-engine.bundle.js +7043 -6766
  4. package/dist/needle-engine.bundle.light.js +7205 -6928
  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.js +468 -467
  10. package/dist/needle-engine.light.js +468 -467
  11. package/dist/needle-engine.light.min.js +1 -1
  12. package/dist/needle-engine.light.umd.cjs +1 -1
  13. package/dist/needle-engine.min.js +1 -1
  14. package/dist/needle-engine.umd.cjs +1 -1
  15. package/dist/vendor.js +5108 -5122
  16. package/dist/vendor.light.js +5108 -5122
  17. package/dist/vendor.light.min.js +84 -84
  18. package/dist/vendor.light.umd.cjs +78 -78
  19. package/dist/vendor.min.js +84 -84
  20. package/dist/vendor.umd.cjs +78 -78
  21. package/lib/engine/codegen/register_types.js +2 -0
  22. package/lib/engine/codegen/register_types.js.map +1 -1
  23. package/lib/engine/engine_addressables.js.map +1 -1
  24. package/lib/engine/engine_components.js +3 -1
  25. package/lib/engine/engine_components.js.map +1 -1
  26. package/lib/engine/engine_context.d.ts +141 -14
  27. package/lib/engine/engine_context.js +164 -26
  28. package/lib/engine/engine_context.js.map +1 -1
  29. package/lib/engine/engine_element.js +12 -10
  30. package/lib/engine/engine_element.js.map +1 -1
  31. package/lib/engine/engine_gameobject.js +5 -0
  32. package/lib/engine/engine_gameobject.js.map +1 -1
  33. package/lib/engine/engine_license.d.ts +2 -0
  34. package/lib/engine/engine_license.js +103 -62
  35. package/lib/engine/engine_license.js.map +1 -1
  36. package/lib/engine/engine_networking_blob.js +40 -24
  37. package/lib/engine/engine_networking_blob.js.map +1 -1
  38. package/lib/engine/engine_physics_rapier.js +10 -9
  39. package/lib/engine/engine_physics_rapier.js.map +1 -1
  40. package/lib/engine/engine_serialization_core.js +6 -2
  41. package/lib/engine/engine_serialization_core.js.map +1 -1
  42. package/lib/engine/engine_utils_screenshot.js +1 -1
  43. package/lib/engine/engine_utils_screenshot.js.map +1 -1
  44. package/lib/engine/js-extensions/RGBAColor.d.ts +1 -0
  45. package/lib/engine/js-extensions/RGBAColor.js +56 -7
  46. package/lib/engine/js-extensions/RGBAColor.js.map +1 -1
  47. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +4 -3
  48. package/lib/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js.map +1 -1
  49. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +6 -6
  50. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  51. package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +4 -0
  52. package/lib/engine/webcomponents/needle menu/needle-menu.js +13 -2
  53. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  54. package/lib/engine/xr/NeedleXRController.js +2 -3
  55. package/lib/engine/xr/NeedleXRController.js.map +1 -1
  56. package/lib/engine/xr/NeedleXRSession.js +12 -12
  57. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  58. package/lib/engine-components/AudioSource.js +7 -0
  59. package/lib/engine-components/AudioSource.js.map +1 -1
  60. package/lib/engine-components/Camera.js +18 -12
  61. package/lib/engine-components/Camera.js.map +1 -1
  62. package/lib/engine-components/CameraUtils.js +8 -14
  63. package/lib/engine-components/CameraUtils.js.map +1 -1
  64. package/lib/engine-components/GroundProjection.js +1 -1
  65. package/lib/engine-components/GroundProjection.js.map +1 -1
  66. package/lib/engine-components/NeedleMenu.js +1 -1
  67. package/lib/engine-components/NeedleMenu.js.map +1 -1
  68. package/lib/engine-components/OrbitControls.js +3 -1
  69. package/lib/engine-components/OrbitControls.js.map +1 -1
  70. package/lib/engine-components/ReflectionProbe.d.ts +1 -0
  71. package/lib/engine-components/ReflectionProbe.js +16 -9
  72. package/lib/engine-components/ReflectionProbe.js.map +1 -1
  73. package/lib/engine-components/SceneSwitcher.js +28 -7
  74. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  75. package/lib/engine-components/SyncedTransform.d.ts +6 -0
  76. package/lib/engine-components/SyncedTransform.js +10 -5
  77. package/lib/engine-components/SyncedTransform.js.map +1 -1
  78. package/lib/engine-components/codegen/components.d.ts +1 -0
  79. package/lib/engine-components/codegen/components.js +1 -0
  80. package/lib/engine-components/codegen/components.js.map +1 -1
  81. package/lib/engine-components/export/usdz/extensions/USDZUI.js +2 -1
  82. package/lib/engine-components/export/usdz/extensions/USDZUI.js.map +1 -1
  83. package/lib/engine-components/ui/BaseUIComponent.d.ts +0 -1
  84. package/lib/engine-components/ui/BaseUIComponent.js +1 -1
  85. package/lib/engine-components/ui/BaseUIComponent.js.map +1 -1
  86. package/lib/engine-components/ui/EventSystem.js +1 -1
  87. package/lib/engine-components/ui/EventSystem.js.map +1 -1
  88. package/lib/engine-components/ui/Graphic.js +1 -0
  89. package/lib/engine-components/ui/Graphic.js.map +1 -1
  90. package/lib/engine-components/ui/RaycastUtils.js +1 -1
  91. package/lib/engine-components/ui/RaycastUtils.js.map +1 -1
  92. package/lib/engine-components/ui/RectTransform.d.ts +2 -2
  93. package/lib/engine-components/ui/RectTransform.js +9 -6
  94. package/lib/engine-components/ui/RectTransform.js.map +1 -1
  95. package/lib/engine-components/ui/Symbols.d.ts +1 -0
  96. package/lib/engine-components/ui/Symbols.js +2 -0
  97. package/lib/engine-components/ui/Symbols.js.map +1 -0
  98. package/lib/engine-components/ui/Utils.js +1 -1
  99. package/lib/engine-components/ui/Utils.js.map +1 -1
  100. package/lib/engine-components/utils/EnvironmentScene.d.ts +1 -1
  101. package/lib/engine-components/utils/EnvironmentScene.js +1 -1
  102. package/lib/engine-components/utils/EnvironmentScene.js.map +1 -1
  103. package/package.json +3 -3
  104. package/plugins/common/license.js +115 -27
  105. package/plugins/types/userconfig.d.ts +8 -0
  106. package/plugins/vite/build-pipeline.js +1 -1
  107. package/plugins/vite/defines.js +3 -1
  108. package/plugins/vite/dependencies.js +23 -4
  109. package/plugins/vite/facebook-instant-games.js +7 -4
  110. package/plugins/vite/index.js +1 -1
  111. package/plugins/vite/license.js +2 -1
  112. package/src/engine/codegen/register_types.ts +2 -0
  113. package/src/engine/engine_addressables.ts +3 -2
  114. package/src/engine/engine_components.ts +2 -1
  115. package/src/engine/engine_context.ts +169 -33
  116. package/src/engine/engine_element.ts +10 -9
  117. package/src/engine/engine_gameobject.ts +7 -0
  118. package/src/engine/engine_license.ts +116 -67
  119. package/src/engine/engine_networking_blob.ts +47 -26
  120. package/src/engine/engine_physics_rapier.ts +10 -12
  121. package/src/engine/engine_serialization_core.ts +6 -1
  122. package/src/engine/engine_utils_screenshot.ts +1 -1
  123. package/src/engine/js-extensions/RGBAColor.ts +59 -8
  124. package/src/engine/physics/workers/mesh-bvh/GenerateMeshBVHWorker.js +6 -6
  125. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +6 -6
  126. package/src/engine/webcomponents/needle menu/needle-menu.ts +13 -2
  127. package/src/engine/xr/NeedleXRController.ts +2 -3
  128. package/src/engine/xr/NeedleXRSession.ts +12 -12
  129. package/src/engine-components/AudioSource.ts +8 -3
  130. package/src/engine-components/Camera.ts +34 -22
  131. package/src/engine-components/CameraUtils.ts +8 -16
  132. package/src/engine-components/GroundProjection.ts +1 -1
  133. package/src/engine-components/NeedleMenu.ts +1 -1
  134. package/src/engine-components/OrbitControls.ts +2 -1
  135. package/src/engine-components/ReflectionProbe.ts +15 -8
  136. package/src/engine-components/SceneSwitcher.ts +28 -11
  137. package/src/engine-components/SyncedTransform.ts +11 -6
  138. package/src/engine-components/codegen/components.ts +1 -0
  139. package/src/engine-components/export/usdz/extensions/USDZUI.ts +2 -2
  140. package/src/engine-components/ui/BaseUIComponent.ts +1 -1
  141. package/src/engine-components/ui/EventSystem.ts +1 -1
  142. package/src/engine-components/ui/Graphic.ts +1 -1
  143. package/src/engine-components/ui/RaycastUtils.ts +1 -1
  144. package/src/engine-components/ui/RectTransform.ts +10 -7
  145. package/src/engine-components/ui/Symbols.ts +2 -0
  146. package/src/engine-components/ui/Utils.ts +2 -1
  147. package/src/engine-components/utils/EnvironmentScene.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,73 @@ 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.2] - 2025-04-24
8
+ - Fix: Vite license server timeout
9
+ - Fix: Vite `manualChunks` should not be declared if `rollupOutput.inlineDynamicImports` is set to true
10
+
11
+ ## [4.4.0] - 2025-04-17
12
+ **Added**
13
+ - 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.
14
+ - 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)" />`
15
+ - Add: `ObjectUtils.createPrimitive()` now supports scale as array
16
+ e.g. `ObjectUtils.createPrimitive("Cube", { scale: [1, .25, 1] } );`
17
+ - Add: Input `getGamepad(<index>)` function to query a connected gamepad. Example: `this.context.input.getGamepad()`
18
+ - Add: `lookAtScreenPoint()` function which allows 3D object to look at points in 2D screen coordinates (e.g. your mouse position).
19
+ **Example Component that makes the object look at the mouse**
20
+ ```ts
21
+ import { Behaviour, lookAtScreenPoint } from "@needle-tools/engine";
22
+
23
+ export class LookAtMouse extends Behaviour {
24
+ update() {
25
+ lookAtScreenPoint(this.gameObject, this.context.input.mousePosition, this.context.mainCamera);
26
+ }
27
+ }
28
+ ```
29
+ - 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.
30
+ - Add: SyncedTransform does now also sync scale changes
31
+ - Add: SyncedTransform `freeOwnership()` method
32
+ - Add: ReflectionProbe bounding box intersection check to automatically apply reflections to object's in a specific area (handled by the Renderer component)
33
+ - 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.
34
+
35
+ **Fixed**
36
+ - Fix: Implicit camera did not automatically set to skybox when using `background-image`. E.g. `<needle-engine background-image="<url>">
37
+ - Fix: Tonemapping falsely set tonemappingEsposure to undefined causing a black screen
38
+ - Fix: `background-color` attribute was not always applied. E.g. `<needle-engine background-color="#ff3333">`
39
+ - Fix: `screenshot()` checks if XR is presenting
40
+ - Fix: Issue where MeshBVH worker import breaks for projects where the needle-engine vite plugins are not added to the plugins list
41
+ - Fix: SceneSwitcher regression with `Object3D` objects in scenes array
42
+ - Fix: SceneSwitcher preload was not using three.js FileLoader to re-use three's caching system
43
+ - Fix: GroundProjection regression where background blurriness was hardcoded
44
+ - Fix: RenderTexture regression where deserialization was not properly handled anymore
45
+ - Fix: OrbitControls regression where forward direction in `setCameraAndLookTarget` was inverted
46
+ - Fix: Physics bug where negative box collider scales were not correctly handled in all cases causing Rapier to break
47
+ - 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.
48
+ - Fix: Vite license plugin not waiting for the CLI process to start
49
+ - Fix: Vite improve license checks in CI environments (e.g. when running via a Github Action).
50
+ - Fix: Vite plugins for running in CI environment
51
+ - Fix: Vite `manualChunks` are not defined when `preserveModules` is set to true
52
+
53
+ **Changed**
54
+ - Change: License check aborts now faster instead of retrying when connection is actively refused
55
+ - 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)
56
+ - 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.
57
+ - Change: Scene background color or image set on `<needle-engine>` are not overridden anymore by the camera component.
58
+ - Change: Hide Needle logo automatically when using Needle Engine with a license
59
+
60
+ ## [4.4.0-beta.9] - 2025-04-07
61
+ - Add: `<needle-engine background-color="#ffdddd55">` does now support transparency. For example: `rgba(255, 255, 100, .5)` or `#ffdddd99` or `transparent` are valid values.
62
+ - Add: SyncedTransform `freeOwnership()` method
63
+ - Add: ReflectionProbe does now check boundingbox intersection
64
+ - 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.
65
+ - Change: Scene background color or image set on `<needle-engine>` are not overridden anymore by the camera component.
66
+ - Change: Hide Needle logo automatically when using Needle Engine with a license
67
+ - Fix: Improve license checks in CI environments (e.g. when running via a Github Action).
68
+ - Fix: Vite plugins for running in CI environment
69
+ - Fix: Vite `manualChunks` are not defined when `preserveModules` is set to true
70
+ - Fix: `screenshot()` checks if XR is presenting
71
+ - Fix: Issue where MeshBVH worker import breaks for projects where the needle-engine vite plugins are not added to the plugins list
72
+ - Fix: Vite license plugin not waiting for the CLI process to start
73
+
7
74
  ## [4.4.0-beta] - 2025-03-28
8
75
  - Add: `ObjectUtils.createPrimitive()` now supports scale as array
9
76
  e.g. `ObjectUtils.createPrimitive("Cube", { scale: [1, .25, 1] } );`