Needle Engine

Changes between version 3.32.7-alpha and 3.32.8-alpha
Files changed (210) hide show
  1. src/engine-components/export/usdz/extensions/behavior/Actions.ts +3 -2
  2. src/engine-components/AlignmentConstraint.ts +3 -2
  3. src/engine-components/Animation.ts +4 -3
  4. src/engine-components/export/usdz/extensions/Animation.ts +5 -4
  5. src/engine-components/AnimationUtils.ts +4 -3
  6. src/engine-components/export/usdz/utils/animationutils.ts +5 -4
  7. src/engine-components/Animator.ts +6 -5
  8. src/engine-components/AnimatorController.ts +10 -9
  9. src/engine-components/postprocessing/Effects/Antialiasing.ts +1 -0
  10. src/engine-components/api.ts +6 -8
  11. src/engine/api.ts +20 -22
  12. src/engine-components/export/usdz/extensions/behavior/AudioExtension.ts +3 -2
  13. src/engine-components/AudioListener.ts +2 -1
  14. src/engine-components/AudioSource.ts +12 -7
  15. src/engine-components/avatar/Avatar_Brain_LookAt.ts +5 -4
  16. src/engine-components/avatar/Avatar_MouthShapes.ts +4 -3
  17. src/engine-components/webxr/Avatar.ts +7 -6
  18. src/engine-components/avatar/AvatarBlink_Simple.ts +2 -1
  19. src/engine-components/avatar/AvatarEyeLook_Rotation.ts +5 -4
  20. src/engine-components/AvatarLoader.ts +6 -5
  21. src/engine-components/AxesHelper.ts +3 -2
  22. src/engine-components/ui/BaseUIComponent.ts +4 -3
  23. src/engine-components/BasicIKConstraint.ts +3 -2
  24. src/engine-components/export/usdz/extensions/behavior/Behaviour.ts +1 -1
  25. src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +12 -13
  26. src/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.ts +2 -2
  27. src/engine-components/postprocessing/Effects/Bloom.ts +1 -0
  28. src/engine-components/BoxHelperComponent.ts +4 -3
  29. src/engine-components/ui/Button.ts +8 -8
  30. src/engine-components/Camera.ts +10 -10
  31. src/engine-components/CameraUtils.ts +8 -7
  32. src/engine-components/ui/Canvas.ts +11 -10
  33. src/engine-components/ui/CanvasGroup.ts +3 -3
  34. src/engine-components/CharacterController.ts +5 -4
  35. src/engine-components/postprocessing/Effects/ChromaticAberration.ts +1 -0
  36. src/engine-components/Collider.ts +6 -5
  37. src/engine-components/postprocessing/Effects/ColorAdjustments.ts +2 -1
  38. src/engine-components/Component.ts +9 -9
  39. src/engine-components/codegen/components.ts +1 -0
  40. src/engine-components/ContactShadows.ts +3 -3
  41. src/engine/debug/debug_console.ts +2 -2
  42. src/engine/debug/debug_overlay.ts +2 -2
  43. src/engine/debug/debug.ts +2 -2
  44. src/engine-components/DeleteBox.ts +1 -0
  45. src/engine-components/postprocessing/Effects/DepthOfField.ts +3 -2
  46. src/engine-components/DeviceFlag.ts +1 -1
  47. src/engine-components/DragControls.ts +15 -14
  48. src/engine-components/DropListener.ts +5 -4
  49. src/engine-components/Duplicatable.ts +4 -3
  50. src/engine/engine_addressables.ts +7 -6
  51. src/engine/engine_assetdatabase.ts +2 -1
  52. src/engine/engine_camera.ts +2 -1
  53. src/engine/engine_components.ts +7 -6
  54. src/engine/engine_context.ts +20 -26
  55. src/engine/engine_create_objects.ts +2 -1
  56. src/engine/engine_element_loading.ts +2 -2
  57. src/engine/engine_element.ts +7 -7
  58. src/engine/engine_gameobject.ts +9 -8
  59. src/engine/engine_gizmos.ts +5 -4
  60. src/engine/engine_gltf_builtin_components.ts +11 -9
  61. src/engine/engine_gltf.ts +4 -3
  62. src/engine/engine_hot_reload.ts +2 -2
  63. src/engine/engine_input.ts +1 -0
  64. src/engine/engine_license.ts +9 -6
  65. src/engine/engine_lifecycle_api.ts +1 -1
  66. src/engine/engine_lifecycle_functions_internal.ts +2 -2
  67. src/engine/engine_lightdata.ts +4 -3
  68. src/engine/engine_loaders.ts +3 -3
  69. src/engine/engine_mainloop_utils.ts +7 -6
  70. src/engine/engine_networking_auto.ts +1 -1
  71. src/engine/engine_networking_files_default_components.ts +2 -1
  72. src/engine/engine_networking_files.ts +8 -7
  73. src/engine/engine_networking_instantiate.ts +10 -10
  74. src/engine/engine_networking_peer.ts +2 -1
  75. src/engine/engine_networking_streams.ts +5 -4
  76. src/engine/engine_networking.ts +6 -5
  77. src/engine/engine_physics_rapier.ts +44 -38
  78. src/engine/engine_physics.ts +4 -3
  79. src/engine/engine_playerview.ts +2 -1
  80. src/engine/engine_scenelighting.ts +5 -4
  81. src/engine/engine_scenetools.ts +9 -8
  82. src/engine/engine_serialization_builtin_serializer.ts +7 -6
  83. src/engine/engine_serialization_core.ts +7 -6
  84. src/engine/engine_serialization.ts +4 -5
  85. src/engine/engine_shaders.ts +4 -3
  86. src/engine/engine_texture.ts +2 -1
  87. src/engine/engine_three_utils.ts +3 -2
  88. src/engine/engine_time.ts +2 -1
  89. src/engine/engine_types.ts +4 -3
  90. src/engine/engine_util_decorator.ts +3 -2
  91. src/engine/engine_utils_screenshot.ts +2 -1
  92. src/engine/engine_utils.ts +10 -9
  93. src/engine/engine.ts +3 -3
  94. src/engine-components/ui/EventSystem.ts +11 -10
  95. src/engine-components/EventTrigger.ts +2 -2
  96. src/engine/extensions/EXT_texture_exr.ts +3 -2
  97. src/engine/extensions/extension_utils.ts +2 -1
  98. src/engine-components/export/usdz/Extension.ts +2 -1
  99. src/engine/extensions/extensions.ts +12 -11
  100. src/engine-components/js-extensions/ExtensionUtils.ts +1 -0
  101. src/engine-components/FlyControls.ts +2 -1
  102. src/engine-components/Fog.ts +2 -1
  103. src/engine-components/Gizmos.ts +5 -4
  104. src/engine-components/export/gltf/GltfExport.ts +6 -6
  105. src/engine-components/ui/Graphic.ts +7 -6
  106. src/engine-components/GridHelper.ts +4 -3
  107. src/engine-components/GroundProjection.ts +4 -3
  108. src/engine-components/ui/Image.ts +2 -1
  109. src/engine-components/export/usdz/index.ts +3 -3
  110. src/engine-components/postprocessing/index.ts +2 -2
  111. src/engine-components/timeline/index.ts +2 -2
  112. src/engine-components/webxr/index.ts +2 -2
  113. src/engine/extensions/index.ts +2 -2
  114. src/engine/xr/index.ts +2 -2
  115. src/engine-components/ui/InputField.ts +4 -4
  116. src/engine/xr/internal.ts +3 -2
  117. src/engine-components/Joints.ts +1 -0
  118. src/engine-components/ui/Layout.ts +3 -3
  119. src/engine-components/Light.ts +7 -6
  120. src/engine-components/LODGroup.ts +5 -4
  121. src/engine-components/debug/LogStats.ts +1 -1
  122. src/engine-components/utils/LookAt.ts +4 -4
  123. src/engine-components/LookAtConstraint.ts +3 -2
  124. src/engine/extensions/NEEDLE_animator_controller_model.ts +3 -2
  125. src/engine/extensions/NEEDLE_components.ts +7 -6
  126. src/engine/extensions/NEEDLE_gameobject_data.ts +3 -3
  127. src/engine/extensions/NEEDLE_lighting_settings.ts +7 -6
  128. src/engine/extensions/NEEDLE_lightmaps.ts +8 -7
  129. src/engine/extensions/NEEDLE_persistent_assets.ts +3 -2
  130. src/engine/extensions/NEEDLE_progressive.ts +5 -3
  131. src/engine/extensions/NEEDLE_render_objects.ts +18 -18
  132. src/engine/extensions/NEEDLE_techniques_webgl.ts +6 -5
  133. src/engine/xr/NeedleXRController.ts +8 -7
  134. src/engine/xr/NeedleXRSession.ts +16 -15
  135. src/engine/xr/NeedleXRSync.ts +2 -2
  136. src/engine-components/NestedGltf.ts +4 -4
  137. src/engine-components/Networking.ts +1 -1
  138. src/engine-components/js-extensions/Object3D.ts +11 -12
  139. src/engine-components/OffsetConstraint.ts +4 -3
  140. src/engine-components/utils/OpenURL.ts +4 -4
  141. src/engine-components/OrbitControls.ts +13 -13
  142. src/engine-components/ui/Outline.ts +3 -2
  143. src/engine-components/ParticleSystem.ts +14 -15
  144. src/engine-components/ParticleSystemModules.ts +8 -7
  145. src/engine-components/ParticleSystemSubEmitter.ts +4 -3
  146. src/engine-components/postprocessing/Effects/Pixelation.ts +4 -3
  147. src/engine-components/timeline/PlayableDirector.ts +9 -8
  148. src/engine-components/PlayerColor.ts +3 -2
  149. src/engine-components-experimental/networking/PlayerSync.ts +7 -7
  150. src/engine-components/ui/PointerEvents.ts +3 -2
  151. src/engine-components/postprocessing/PostProcessingEffect.ts +5 -4
  152. src/engine-components/postprocessing/PostProcessingHandler.ts +5 -4
  153. src/engine-components-experimental/Presentation.ts +1 -1
  154. src/engine-components/ui/Raycaster.ts +4 -3
  155. src/engine-components/ui/RaycastUtils.ts +2 -1
  156. src/engine-components/ui/RectTransform.ts +6 -5
  157. src/engine-components/ReflectionProbe.ts +3 -2
  158. src/engine/codegen/register_types.ts +2 -1
  159. src/engine-components/Renderer.ts +14 -13
  160. src/engine-components/RendererLightmap.ts +2 -1
  161. src/engine-components/js-extensions/RGBAColor.ts +2 -1
  162. src/engine-components/RigidBody.ts +7 -6
  163. src/engine-components/SceneSwitcher.ts +4 -3
  164. src/engine/xr/SceneTransition.ts +1 -0
  165. src/engine-schemes/schemes.ts +2 -1
  166. src/engine-components/ScreenCapture.ts +9 -8
  167. src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +1 -0
  168. src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts +3 -2
  169. src/engine-components/ShadowCatcher.ts +4 -3
  170. src/engine-components/timeline/SignalAsset.ts +2 -2
  171. src/engine-components/Skybox.ts +10 -9
  172. src/engine-components/SmoothFollow.ts +5 -4
  173. src/engine-components/ui/SpatialHtml.ts +1 -0
  174. src/engine-components/SpatialTrigger.ts +4 -3
  175. src/engine-components/SpectatorCamera.ts +12 -11
  176. src/engine-components/SpriteRenderer.ts +4 -3
  177. src/engine-components/SyncedCamera.ts +12 -11
  178. src/engine-components/SyncedRoom.ts +2 -2
  179. src/engine-components/SyncedTransform.ts +9 -8
  180. src/engine/xr/TempXRContext.ts +2 -1
  181. src/engine/tests/test_utils.ts +1 -1
  182. src/engine-components/TestRunner.ts +6 -5
  183. src/engine-components/ui/Text.ts +5 -4
  184. src/engine-components/export/usdz/ThreeUSDZExporter.ts +33 -32
  185. src/engine-components/postprocessing/Effects/TiltShiftEffect.ts +4 -3
  186. src/engine-components/timeline/TimelineTracks.ts +9 -8
  187. src/engine-components/postprocessing/Effects/Tonemapping.ts +1 -0
  188. src/engine-components/TransformGizmo.ts +6 -5
  189. src/engine/extensions/usage_tracker.ts +2 -1
  190. src/engine-components/export/usdz/USDZExporter.ts +15 -14
  191. src/engine-components/export/usdz/extensions/USDZText.ts +6 -5
  192. src/engine-components/export/usdz/extensions/USDZUI.ts +6 -5
  193. src/engine-components/ui/Utils.ts +3 -2
  194. src/engine/xr/utils.ts +2 -1
  195. src/engine-components/js-extensions/Vector.ts +2 -1
  196. src/engine-components/VideoPlayer.ts +7 -6
  197. src/engine-components/postprocessing/Effects/Vignette.ts +3 -2
  198. src/engine-components/Voip.ts +6 -5
  199. src/engine-components/postprocessing/Volume.ts +7 -6
  200. src/engine-components/webxr/WebARCameraBackground.ts +11 -10
  201. src/engine-components/webxr/WebARSessionRoot.ts +8 -7
  202. src/engine-components/webxr/WebXR.ts +13 -14
  203. src/engine-components/webxr/WebXRAvatar.ts +2 -1
  204. src/engine-components/webxr/WebXRButtons.ts +19 -15
  205. src/engine-components/webxr/WebXRImageTracking.ts +7 -7
  206. src/engine-components/webxr/WebXRPlaneTracking.ts +5 -5
  207. src/engine-components/webxr/WebXRRig.ts +4 -3
  208. src/engine-components/webxr/controllers/XRControllerModel.ts +8 -7
  209. src/engine-components/webxr/controllers/XRControllerMovement.ts +10 -10
  210. src/engine-components/webxr/XRFlag.ts +2 -2
src/engine-components/export/usdz/extensions/behavior/Actions.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Object3D, Matrix4, Material, BufferGeometry } from "three";
1
+ import { BufferGeometry,Material, Matrix4, Object3D } from "three";
2
+
3
+ import { USDDocument,USDObject } from "../../ThreeUSDZExporter.js";
2
4
  import { ActionBuilder, ActionModel } from "./BehavioursBuilder.js";
3
- import { USDObject, USDDocument } from "../../ThreeUSDZExporter.js";
4
5
 
5
6
  export abstract class DocumentAction {
6
7
 
src/engine-components/AlignmentConstraint.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
- import * as utils from "./../engine/engine_three_utils.js";
3
1
  import { Vector3 } from "three";
2
+
4
3
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
+ import * as utils from "./../engine/engine_three_utils.js";
5
+ import { Behaviour, GameObject } from "./Component.js";
5
6
 
6
7
  export class AlignmentConstraint extends Behaviour {
7
8
 
src/engine-components/Animation.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Behaviour } from "./Component.js";
2
1
  import { AnimationAction, AnimationClip, AnimationMixer, LoopOnce, LoopRepeat } from "three";
3
- import { MixerEvent } from "./Animator.js";
2
+
3
+ import { Mathf } from "../engine/engine_math.js";
4
4
  import { serializable } from "../engine/engine_serialization_decorator.js";
5
- import { Mathf } from "../engine/engine_math.js";
6
5
  import type { Vec2 } from "../engine/engine_types.js";
7
6
  import { getParam } from "../engine/engine_utils.js";
7
+ import { MixerEvent } from "./Animator.js";
8
+ import { Behaviour } from "./Component.js";
8
9
 
9
10
  const debug = getParam("debuganimation");
10
11
 
src/engine-components/export/usdz/extensions/Animation.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import { AnimationClip, Bone,Interpolant, KeyframeTrack, Matrix4, Object3D, PropertyBinding, Quaternion, Vector3 } from "three";
2
+
3
+ import { getParam } from "../../../../engine/engine_utils.js";
4
+ import { Animator } from "../../../Animator.js";
1
5
  import { GameObject } from "../../../Component.js";
2
- import { getParam } from "../../../../engine/engine_utils.js";
3
- import { USDObject, buildMatrix, findStructuralNodesInBoneHierarchy, usdNumberFormatting as fn, getPathToSkeleton } from "../ThreeUSDZExporter.js";
4
6
  import type { IUSDExporterExtension } from "../Extension.js";
5
- import { Object3D, Matrix4, Vector3, Quaternion, Interpolant, AnimationClip, KeyframeTrack, PropertyBinding, Bone } from "three";
6
- import { Animator } from "../../../Animator.js";
7
+ import { buildMatrix, findStructuralNodesInBoneHierarchy, getPathToSkeleton,usdNumberFormatting as fn, USDObject } from "../ThreeUSDZExporter.js";
7
8
 
8
9
  const debug = getParam("debugusdzanimation");
9
10
  const debugSerialization = getParam("debugusdzanimationserialization");
src/engine-components/AnimationUtils.ts CHANGED
@@ -1,11 +1,12 @@
1
+ import { Object3D } from "three";
1
2
  import type { GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
3
+
4
+ import { addNewComponent } from "../engine/engine_components.js";
2
5
  import { ContextEvent, ContextRegistry } from "../engine/engine_context_registry.js";
3
- import { addNewComponent } from "../engine/engine_components.js";
6
+ import { Animation } from "./Animation.js";
4
7
  import { Animator } from "./Animator.js";
5
- import { Animation } from "./Animation.js";
6
8
  import { GameObject } from "./Component.js";
7
9
  import { PlayableDirector } from "./timeline/PlayableDirector.js";
8
- import { Object3D } from "three";
9
10
 
10
11
 
11
12
  const $objectAnimationKey = Symbol("objectIsAnimatedData");
src/engine-components/export/usdz/utils/animationutils.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import { AnimationClip,Object3D } from "three";
2
+
3
+ import { getParam } from "../../../../engine/engine_utils.js";
4
+ import { Animation } from "../../../Animation.js";
1
5
  import { Animator } from "../../../Animator.js";
2
- import { Animation } from "../../../Animation.js";
3
- import { Object3D, AnimationClip } from "three";
6
+ import { Behaviour, GameObject } from "../../../Component.js";
4
7
  import { AnimationExtension } from "../extensions/Animation.js";
5
- import { Behaviour, GameObject } from "../../../Component.js";
6
- import { getParam } from "../../../../engine/engine_utils.js";
7
8
  import { PlayAnimationOnClick } from "../extensions/behavior/BehaviourComponents.js";
8
9
 
9
10
  const debug = getParam("debugusdz");
src/engine-components/Animator.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { Behaviour } from "./Component.js";
2
- import type { AnimationActionLoopStyles, AnimationAction, AnimationMixer } from "three";
1
+ import type { AnimationAction, AnimationActionLoopStyles, AnimationMixer } from "three";
2
+
3
+ import { Mathf } from "../engine/engine_math.js";
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
3
5
  import { getParam } from "../engine/engine_utils.js";
4
6
  import type { AnimatorControllerModel } from "../engine/extensions/NEEDLE_animator_controller_model.js";
7
+ import { getObjectAnimated } from "./AnimationUtils.js";
5
8
  import { AnimatorController } from "./AnimatorController.js";
6
- import { serializable } from "../engine/engine_serialization_decorator.js";
7
- import { Mathf } from "../engine/engine_math.js";
8
- import { getObjectAnimated } from "./AnimationUtils.js";
9
+ import { Behaviour } from "./Component.js";
9
10
 
10
11
  const debug = getParam("debuganimator");
11
12
 
src/engine-components/AnimatorController.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { Animator } from "./Animator.js";
2
- import type { AnimatorControllerModel, Condition, State, Transition } from "../engine/extensions/NEEDLE_animator_controller_model.js";
3
- import { AnimatorConditionMode, AnimatorControllerParameterType, AnimatorStateInfo, createMotion, StateMachineBehaviour } from "../engine/extensions/NEEDLE_animator_controller_model.js";
4
1
  import { AnimationAction, AnimationClip, AnimationMixer, AxesHelper, Euler, KeyframeTrack, LoopOnce, Object3D, Quaternion, Vector3 } from "three";
5
- import { deepClone, getParam } from "../engine/engine_utils.js";
2
+
3
+ import { isDevEnvironment } from "../engine/debug/index.js";
4
+ import { Mathf } from "../engine/engine_math.js";
5
+ import { InstantiateIdProvider } from "../engine/engine_networking_instantiate.js";
6
+ import { assign,SerializationContext, TypeSerializer } from "../engine/engine_serialization_core.js";
6
7
  import { Context } from "../engine/engine_setup.js";
8
+ import { isAnimationAction } from "../engine/engine_three_utils.js";
7
9
  import { TypeStore } from "../engine/engine_typestore.js";
8
- import { SerializationContext, TypeSerializer, assign } from "../engine/engine_serialization_core.js";
9
- import { Mathf } from "../engine/engine_math.js";
10
- import { isAnimationAction } from "../engine/engine_three_utils.js";
11
- import { isDevEnvironment } from "../engine/debug/index.js";
12
- import { InstantiateIdProvider } from "../engine/engine_networking_instantiate.js";
10
+ import { deepClone, getParam } from "../engine/engine_utils.js";
11
+ import type { AnimatorControllerModel, Condition, State, Transition } from "../engine/extensions/NEEDLE_animator_controller_model.js";
12
+ import { AnimatorConditionMode, AnimatorControllerParameterType, AnimatorStateInfo, createMotion, StateMachineBehaviour } from "../engine/extensions/NEEDLE_animator_controller_model.js";
13
+ import { Animator } from "./Animator.js";
13
14
 
14
15
  const debug = getParam("debuganimatorcontroller");
15
16
  const debugRootMotion = getParam("debugrootmotion");
src/engine-components/postprocessing/Effects/Antialiasing.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { EdgeDetectionMode, SMAAEffect, SMAAPreset } from "postprocessing";
2
+
2
3
  import { serializable } from "../../../engine/engine_serialization.js";
3
4
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
4
5
  import { VolumeParameter } from "../VolumeParameter.js";
src/engine-components/api.ts CHANGED
@@ -1,20 +1,18 @@
1
+ export * from "./codegen/components.js";
1
2
  export { Behaviour, Component, GameObject } from "./Component.js"
2
- export * from "./codegen/components.js";
3
3
 
4
4
  // We dont want to export everything in the extensions
5
+ export { ClearFlags } from "./Camera.js"
6
+ export * from "./export/index.js"
7
+ export * from "./js-extensions/Object3D.js";
5
8
  export * from "./js-extensions/RGBAColor.js";
6
- export * from "./js-extensions/Object3D.js";
7
- export * from "./webxr/XRFlag.js"
8
-
9
- export * from "./export/index.js"
10
9
  export * from "./postprocessing/index.js"
10
+ export { type ISceneEventListener } from "./SceneSwitcher.js";
11
11
  export * from "./timeline/index.js"
12
12
  export * from "./ui/index.js"
13
13
  export * from "./webxr/index.js"
14
+ export * from "./webxr/XRFlag.js"
14
15
 
15
- export { ClearFlags } from "./Camera.js"
16
- export { type ISceneEventListener } from "./SceneSwitcher.js";
17
-
18
16
  import "./CameraUtils.js"
19
17
  import "./AnimationUtils.js"
20
18
 
src/engine/api.ts CHANGED
@@ -1,42 +1,42 @@
1
1
 
2
- export * from "./extensions/index.js";
2
+ export * from "./debug/index.js";
3
3
  export * from "./engine_addressables.js";
4
4
  export * from "./engine_application.js";
5
5
  export * from "./engine_assetdatabase.js";
6
- export * from "./engine_create_objects.js";
7
- export * from "./engine_components_internal.js";
8
6
  export * from "./engine_components.js";
9
7
  export * from "./engine_components_internal.js";
8
+ export * from "./engine_components_internal.js";
9
+ export * from "./engine_constants.js";
10
+ export * from "./engine_context.js";
10
11
  export * from "./engine_context_registry.js";
11
- export * from "./engine_context.js";
12
12
  export * from "./engine_coroutine.js"
13
- export * from "./engine_constants.js";
14
- export * from "./debug/index.js";
13
+ export * from "./engine_create_objects.js";
15
14
  export * from "./engine_element.js";
15
+ export * from "./engine_element_attributes.js";
16
16
  export * from "./engine_element_loading.js";
17
- export * from "./engine_element_attributes.js";
17
+ export * from "./engine_gameobject.js";
18
18
  export { Gizmos } from "./engine_gizmos.js"
19
19
  export * from "./engine_gltf.js";
20
20
  export * from "./engine_hot_reload.js";
21
- export * from "./engine_gameobject.js";
21
+ export * from "./engine_input.js";
22
+ export { InstancingUtil } from "./engine_instancing.js";
23
+ export { hasIndieLicense,hasProLicense } from "./engine_license.js";
24
+ export * from "./engine_lifecycle_api.js";
25
+ export * from "./engine_math.js";
22
26
  export * from "./engine_networking.js";
23
- export * from "./engine_networking_types.js";
24
27
  export { syncField } from "./engine_networking_auto.js";
25
28
  export * from "./engine_networking_files.js";
26
29
  export * from "./engine_networking_instantiate.js";
30
+ export * from "./engine_networking_peer.js";
27
31
  export * from "./engine_networking_streams.js";
32
+ export * from "./engine_networking_types.js";
28
33
  export * from "./engine_networking_utils.js";
29
- export * from "./engine_networking_peer.js";
30
34
  export * from "./engine_patcher.js";
31
- export * from "./engine_playerview.js";
32
35
  export * from "./engine_physics.js";
33
36
  export * from "./engine_physics.types.js";
34
37
  export * from "./engine_physics_rapier.js";
38
+ export * from "./engine_playerview.js";
35
39
  export * from "./engine_scenelighting.js";
36
- export * from "./engine_input.js";
37
- export * from "./engine_lifecycle_api.js";
38
- export * from "./engine_math.js";
39
- export * from "./js-extensions/index.js";
40
40
  export * from "./engine_scenetools.js";
41
41
  export * from "./engine_serialization.js";
42
42
  export { type ISerializable } from "./engine_serialization_core.js";
@@ -44,13 +44,11 @@
44
44
  export * from "./engine_three_utils.js";
45
45
  export * from "./engine_time.js";
46
46
  export * from "./engine_types.js";
47
+ export { registerType,TypeStore } from "./engine_typestore.js";
48
+ export { prefix,validate } from "./engine_util_decorator.js";
49
+ export * from "./engine_utils.js";
47
50
  export * from "./engine_utils_screenshot.js";
48
51
  export * from "./engine_web_api.js";
49
- export * from "./engine_utils.js";
50
52
  export * from "./engine_xr.js";
51
-
52
- export { TypeStore, registerType } from "./engine_typestore.js";
53
-
54
- export { InstancingUtil } from "./engine_instancing.js";
55
- export { validate, prefix } from "./engine_util_decorator.js";
56
- export { hasProLicense, hasIndieLicense } from "./engine_license.js";
53
+ export * from "./extensions/index.js";
54
+ export * from "./js-extensions/index.js";
src/engine-components/export/usdz/extensions/behavior/AudioExtension.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import { Object3D } from "three";
2
+
3
+ import { AudioSource } from "../../../../AudioSource.js";
1
4
  import { GameObject } from "../../../../Component.js";
2
5
  import type { IUSDExporterExtension } from "../../Extension.js";
3
6
  import { USDObject, USDWriter, USDZExporterContext } from "../../ThreeUSDZExporter.js";
4
- import { Object3D } from "three";
5
- import { AudioSource } from "../../../../AudioSource.js";
6
7
 
7
8
  export class AudioExtension implements IUSDExporterExtension {
8
9
 
src/engine-components/AudioListener.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import { AudioListener as ThreeAudioListener } from "three";
2
+
3
3
  import { AudioSource } from "./AudioSource.js";
4
4
  import { Camera } from "./Camera.js";
5
+ import { Behaviour, GameObject } from "./Component.js";
5
6
 
6
7
 
7
8
  export class AudioListener extends Behaviour {
src/engine-components/AudioSource.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { Behaviour, GameObject } from "./Component.js";
1
+ import { Audio, AudioContext, AudioLoader, PositionalAudio } from "three";
2
2
  import { PositionalAudioHelper } from 'three/examples/jsm/helpers/PositionalAudioHelper.js';
3
+
4
+ import { isDevEnvironment } from "../engine/debug/index.js";
5
+ import { ApplicationEvents } from "../engine/engine_application.js";
6
+ import { serializable } from "../engine/engine_serialization_decorator.js";
7
+ import * as utils from "../engine/engine_utils.js";
3
8
  import { AudioListener } from "./AudioListener.js";
4
- import * as utils from "../engine/engine_utils.js";
5
- import { serializable } from "../engine/engine_serialization_decorator.js";
6
- import { ApplicationEvents } from "../engine/engine_application.js";
7
- import { Audio, AudioContext, AudioLoader, PositionalAudio } from "three";
8
- import { isDevEnvironment } from "../engine/debug/index.js";
9
+ import { Behaviour, GameObject } from "./Component.js";
9
10
 
10
11
 
11
12
  const debug = utils.getParam("debugaudio");
@@ -140,7 +141,7 @@
140
141
  if (!listener && this.context.mainCamera) listener = GameObject.addNewComponent(this.context.mainCamera, AudioListener);
141
142
  if (listener?.listener) {
142
143
  this.sound = new PositionalAudio(listener.listener);
143
- this.gameObject.add(this.sound);
144
+ this.gameObject?.add(this.sound);
144
145
  }
145
146
  else if (debug) console.warn("No audio listener found in scene - can not play audio");
146
147
  }
@@ -157,6 +158,9 @@
157
158
  }
158
159
 
159
160
  onEnable(): void {
161
+ if (this.sound)
162
+ this.gameObject.add(this.sound);
163
+
160
164
  if (!AudioSource.userInteractionRegistered) {
161
165
  AudioSource.registerWaitForAllowAudio(() => {
162
166
  if (this.enabled && !this.destroyed && this.shouldPlay)
@@ -328,6 +332,7 @@
328
332
  if (this.sound && !this.sound.isPlaying) {
329
333
  const muted = this.context.application.muted;
330
334
  if (muted) this.sound.setVolume(0);
335
+ this.gameObject?.add(this.sound);
331
336
 
332
337
  if (this.clip instanceof MediaStream) {
333
338
 
src/engine-components/avatar/Avatar_Brain_LookAt.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import * as THREE from "three";
2
+
3
+ import { OwnershipModel } from "../../engine/engine_networking.js";
4
+ import type { IModel } from "../../engine/engine_networking_types.js";
5
+ import { Context } from "../../engine/engine_setup.js";
6
+ import * as utils from "../../engine/engine_three_utils.js";
2
7
  import { TypeStore } from "../../engine/engine_typestore.js";
3
8
  import { Behaviour, GameObject } from "../Component.js";
4
9
  import { AvatarMarker } from "../webxr/WebXRAvatar.js";
5
- import * as utils from "../../engine/engine_three_utils.js";
6
- import { OwnershipModel } from "../../engine/engine_networking.js";
7
- import { Context } from "../../engine/engine_setup.js";
8
- import type { IModel } from "../../engine/engine_networking_types.js";
9
10
 
10
11
  export class Avatar_POI {
11
12
 
src/engine-components/avatar/Avatar_MouthShapes.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import { Object3D } from "three";
2
+
3
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
4
+ import * as utils from "../../engine/engine_utils.js";
1
5
  import { Behaviour, GameObject } from "../Component.js";
2
6
  import { Voip } from "../Voip.js";
3
7
  import { AvatarMarker } from "../webxr/WebXRAvatar.js";
4
- import * as utils from "../../engine/engine_utils.js";
5
- import { Object3D } from "three";
6
- import { serializable } from "../../engine/engine_serialization_decorator.js";
7
8
 
8
9
  const debug = utils.getParam("debugmouth");
9
10
 
src/engine-components/webxr/Avatar.ts CHANGED
@@ -1,15 +1,16 @@
1
+ import { Object3D, Quaternion, Vector3 } from "three";
2
+
1
3
  import { AssetReference } from "../../engine/engine_addressables.js";
4
+ import { ObjectUtils, PrimitiveType } from "../../engine/engine_create_objects.js";
2
5
  import { serializable } from "../../engine/engine_serialization_decorator.js";
3
- import { PromiseAllWithErrors, getParam } from "../../engine/engine_utils.js";
6
+ import { IGameObject } from "../../engine/engine_types.js";
7
+ import { getParam,PromiseAllWithErrors } from "../../engine/engine_utils.js";
4
8
  import { NeedleXREventArgs, NeedleXRSession, NeedleXRUtils } from "../../engine/xr/index.js";
9
+ import { PlayerState } from "../../engine-components-experimental/networking/PlayerSync.js";
5
10
  import { Behaviour, GameObject } from "../Component.js";
6
- import { Object3D, Quaternion, Vector3 } from "three";
7
- import { ObjectUtils, PrimitiveType } from "../../engine/engine_create_objects.js";
8
11
  import { SyncedTransform } from "../SyncedTransform.js";
9
- import { PlayerState } from "../../engine-components-experimental/networking/PlayerSync.js";
10
- import { IGameObject } from "../../engine/engine_types.js";
12
+ import { AvatarMarker } from "./WebXRAvatar.js";
11
13
  import { XRFlag } from "./XRFlag.js";
12
- import { AvatarMarker } from "./WebXRAvatar.js";
13
14
 
14
15
  const debug = getParam("debugwebxr");
15
16
 
src/engine-components/avatar/AvatarBlink_Simple.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { Object3D } from "three";
2
+
3
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
2
4
  import { Behaviour, GameObject } from "../Component.js";
3
5
  import { XRFlag, XRState } from "../webxr/XRFlag.js";
4
- import { serializable } from "../../engine/engine_serialization_decorator.js";
5
6
 
6
7
 
7
8
  export class AvatarBlink_Simple extends Behaviour {
src/engine-components/avatar/AvatarEyeLook_Rotation.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Behaviour, GameObject } from "../Component.js";
2
- import * as utils from "../../engine/engine_three_utils.js"
3
1
  import * as THREE from "three";
4
- import { Avatar_Brain_LookAt } from "./Avatar_Brain_LookAt.js";
5
- import { serializable } from "../../engine/engine_serialization_decorator.js";
6
2
  import { Object3D } from "three";
7
3
 
4
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
5
+ import * as utils from "../../engine/engine_three_utils.js"
6
+ import { Behaviour, GameObject } from "../Component.js";
7
+ import { Avatar_Brain_LookAt } from "./Avatar_Brain_LookAt.js";
8
+
8
9
  export class AvatarEyeLook_Rotation extends Behaviour {
9
10
 
10
11
  @serializable(Object3D)
src/engine-components/AvatarLoader.ts CHANGED
@@ -1,12 +1,13 @@
1
+ import { Box3, Object3D, Vector3 } from "three";
1
2
  import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
2
- import * as utils from "../engine/engine_utils.js"
3
+
4
+ import { InstantiateOptions } from "../engine/engine_gameobject.js";
5
+ import { getLoader } from "../engine/engine_gltf.js";
3
6
  import * as loaders from "../engine/engine_loaders.js"
4
7
  import { Context } from "../engine/engine_setup.js";
8
+ import * as utils from "../engine/engine_utils.js"
9
+ import { download_file } from "../engine/engine_web_api.js";
5
10
  import { GameObject } from "./Component.js";
6
- import { download_file } from "../engine/engine_web_api.js";
7
- import { getLoader } from "../engine/engine_gltf.js";
8
- import { InstantiateOptions } from "../engine/engine_gameobject.js";
9
- import { Box3, Object3D, Vector3 } from "three";
10
11
 
11
12
  const debug = utils.getParam("debugavatar");
12
13
 
src/engine-components/AxesHelper.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { Behaviour } from "./Component.js";
1
+ import { AxesHelper as _AxesHelper } from "three";
2
+
2
3
  import * as params from "../engine/engine_default_parameters.js";
3
4
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
- import { AxesHelper as _AxesHelper } from "three";
5
+ import { Behaviour } from "./Component.js";
5
6
 
6
7
  export class AxesHelper extends Behaviour {
7
8
  @serializable()
src/engine-components/ui/BaseUIComponent.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  // import { Canvas } from './Canvas.js';
2
+ import { AxesHelper, Object3D } from 'three';
2
3
  import * as ThreeMeshUI from 'three-mesh-ui';
4
+
5
+ import { showGizmos } from '../../engine/engine_default_parameters.js';
6
+ import { getParam } from '../../engine/engine_utils.js';
3
7
  import { Behaviour, GameObject } from "../Component.js";
4
8
  import { EventSystem } from "./EventSystem.js";
5
- import { showGizmos } from '../../engine/engine_default_parameters.js';
6
- import { AxesHelper, Object3D } from 'three';
7
9
  import type { ICanvas } from './Interfaces.js';
8
- import { getParam } from '../../engine/engine_utils.js';
9
10
  export const includesDir = "./include";
10
11
 
11
12
  const debug = getParam("debugshadowcomponents");
src/engine-components/BasicIKConstraint.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
- import * as utils from "./../engine/engine_three_utils.js";
3
1
  import { Vector3 } from "three";
4
2
 
3
+ import * as utils from "./../engine/engine_three_utils.js";
4
+ import { Behaviour, GameObject } from "./Component.js";
5
+
5
6
  export class BasicIKConstraint extends Behaviour {
6
7
 
7
8
  private from!: GameObject;
src/engine-components/export/usdz/extensions/behavior/Behaviour.ts CHANGED
@@ -1,8 +1,8 @@
1
+ import { getParam } from "../../../../../engine/engine_utils.js";
1
2
  import { GameObject } from "../../../../Component.js";
2
3
  import type { IUSDExporterExtension } from "../../Extension.js";
3
4
  import { USDObject, USDWriter, USDZExporterContext } from "../../ThreeUSDZExporter.js";
4
5
  import { BehaviorModel } from "./BehavioursBuilder.js";
5
- import { getParam } from "../../../../../engine/engine_utils.js";
6
6
 
7
7
  const debug = getParam("debugusdz");
8
8
 
src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts CHANGED
@@ -1,21 +1,20 @@
1
+ import { Group,Material, Mesh, Object3D, Quaternion, Vector3 } from "three";
2
+
3
+ import { isDevEnvironment, showBalloonWarning } from "../../../../../engine/debug/index.js";
4
+ import { serializable } from "../../../../../engine/engine_serialization_decorator.js";
5
+ import { getWorldPosition, getWorldQuaternion, getWorldScale, setWorldPosition, setWorldQuaternion, setWorldScale } from "../../../../../engine/engine_three_utils.js";
6
+ import type { State } from "../../../../../engine/extensions/NEEDLE_animator_controller_model.js";
7
+ import { NEEDLE_progressive } from "../../../../../engine/extensions/NEEDLE_progressive.js";
8
+ import { Animator } from "../../../../Animator.js";
9
+ import { AudioSource } from "../../../../AudioSource.js";
1
10
  import { Behaviour, GameObject } from "../../../../Component.js";
2
- import { Animator } from "../../../../Animator.js";
3
11
  import { Renderer } from "../../../../Renderer.js";
4
- import { serializable } from "../../../../../engine/engine_serialization_decorator.js";
5
12
  import type { IPointerClickHandler, PointerEventData } from "../../../../ui/PointerEvents.js";
13
+ import { ObjectRaycaster,Raycaster } from "../../../../ui/Raycaster.js";
14
+ import { USDDocument, USDObject, USDZExporterContext } from "../../ThreeUSDZExporter.js";
6
15
  import { AnimationExtension, RegisteredAnimationInfo, type UsdzAnimation } from "../Animation.js";
7
- import { getWorldPosition, getWorldQuaternion, getWorldScale, setWorldPosition, setWorldQuaternion, setWorldScale } from "../../../../../engine/engine_three_utils.js";
8
-
9
- import { Object3D, Material, Vector3, Quaternion, Mesh, Group } from "three";
10
- import { USDDocument, USDObject, USDZExporterContext } from "../../ThreeUSDZExporter.js";
11
-
12
16
  import type { BehaviorExtension, UsdzBehaviour } from "./Behaviour.js";
13
- import { ActionBuilder, ActionModel, AuralMode, BehaviorModel, type IBehaviorElement, MotionType, PlayAction, Space, TriggerBuilder, GroupActionModel, MultiplePerformOperation } from "./BehavioursBuilder.js";
14
- import { AudioSource } from "../../../../AudioSource.js";
15
- import { NEEDLE_progressive } from "../../../../../engine/extensions/NEEDLE_progressive.js";
16
- import { isDevEnvironment, showBalloonWarning } from "../../../../../engine/debug/index.js";
17
- import { Raycaster, ObjectRaycaster } from "../../../../ui/Raycaster.js";
18
- import type { State } from "../../../../../engine/extensions/NEEDLE_animator_controller_model.js";
17
+ import { ActionBuilder, ActionModel, AuralMode, BehaviorModel, GroupActionModel, type IBehaviorElement, MotionType, MultiplePerformOperation,PlayAction, Space, TriggerBuilder } from "./BehavioursBuilder.js";
19
18
 
20
19
  function ensureRaycaster(obj: GameObject) {
21
20
  if (!obj) return;
src/engine-components/export/usdz/extensions/behavior/BehavioursBuilder.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Object3D } from "three";
2
- import { USDDocument, USDObject, USDWriter, makeNameSafeForUSD } from "../../ThreeUSDZExporter.js";
3
2
 
3
+ import { getParam } from "../../../../../engine/engine_utils.js";
4
+ import { makeNameSafeForUSD,USDDocument, USDObject, USDWriter } from "../../ThreeUSDZExporter.js";
4
5
  import { BehaviorExtension } from "./Behaviour.js";
5
- import { getParam } from "../../../../../engine/engine_utils.js";
6
6
 
7
7
  const debug = getParam("debugusdz");
8
8
 
src/engine-components/postprocessing/Effects/Bloom.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BlendFunction, BloomEffect, SelectiveBloomEffect } from "postprocessing";
2
+
2
3
  import { serializable } from "../../../engine/engine_serialization.js";
3
4
  import { PostProcessingEffect } from "../PostProcessingEffect.js";
4
5
  import { VolumeParameter } from "../VolumeParameter.js";
src/engine-components/BoxHelperComponent.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Behaviour } from "./Component.js";
2
- import { getParam } from "../engine/engine_utils.js";
1
+ import { Box3, Color, type ColorRepresentation, LineSegments, Object3D, Vector3 } from "three";
2
+
3
3
  import { CreateWireCube, Gizmos } from "../engine/engine_gizmos.js";
4
4
  import { getWorldPosition, getWorldScale } from "../engine/engine_three_utils.js";
5
- import { Box3, Color, type ColorRepresentation, LineSegments, Object3D, Vector3 } from "three";
5
+ import { getParam } from "../engine/engine_utils.js";
6
+ import { Behaviour } from "./Component.js";
6
7
 
7
8
  const gizmos = getParam("gizmos");
8
9
  const debug = getParam("debugboxhelper");
src/engine-components/ui/Button.ts CHANGED
@@ -1,15 +1,15 @@
1
+ import { showBalloonMessage } from "../../engine/debug/index.js";
2
+ import { Gizmos } from "../../engine/engine_gizmos.js";
3
+ import { PointerType } from "../../engine/engine_input.js";
4
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
5
+ import { getParam } from "../../engine/engine_utils.js";
6
+ import { Animator } from "../Animator.js";
1
7
  import { Behaviour, GameObject } from "../Component.js";
2
8
  import { EventList } from "../EventList.js";
9
+ import { RGBAColor } from "../js-extensions/RGBAColor.js";
10
+ import { Image } from "./Image.js";
3
11
  import type { IPointerClickHandler, IPointerEnterHandler, IPointerEventHandler, IPointerExitHandler, PointerEventData } from "./PointerEvents.js";
4
- import { Image } from "./Image.js";
5
- import { RGBAColor } from "../js-extensions/RGBAColor.js";
6
- import { serializable } from "../../engine/engine_serialization_decorator.js";
7
- import { Animator } from "../Animator.js";
8
- import { getParam } from "../../engine/engine_utils.js";
9
- import { showBalloonMessage } from "../../engine/debug/index.js";
10
12
  import { GraphicRaycaster, ObjectRaycaster, Raycaster } from "./Raycaster.js";
11
- import { PointerType } from "../../engine/engine_input.js";
12
- import { Gizmos } from "../../engine/engine_gizmos.js";
13
13
 
14
14
  const debug = getParam("debugbutton");
15
15
 
src/engine-components/Camera.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
- import { getParam } from "../engine/engine_utils.js";
1
+ import { EquirectangularReflectionMapping, OrthographicCamera, PerspectiveCamera, Ray, SRGBColorSpace, Vector3 } from "three";
2
+ import { Texture } from "three";
3
+
4
+ import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../engine/debug/index.js";
5
+ import { Gizmos } from "../engine/engine_gizmos.js";
3
6
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
- import { RGBAColor } from "./js-extensions/RGBAColor.js";
5
7
  import { Context } from "../engine/engine_setup.js";
8
+ import { RenderTexture } from "../engine/engine_texture.js";
9
+ import { getWorldPosition } from "../engine/engine_three_utils.js";
6
10
  import type { ICamera } from "../engine/engine_types.js"
7
- import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../engine/debug/index.js";
8
- import { getWorldPosition } from "../engine/engine_three_utils.js";
9
- import { Gizmos } from "../engine/engine_gizmos.js";
10
-
11
- import { EquirectangularReflectionMapping, OrthographicCamera, PerspectiveCamera, Ray, SRGBColorSpace, Vector3 } from "three";
11
+ import { getParam } from "../engine/engine_utils.js";
12
+ import { Behaviour, GameObject } from "./Component.js";
13
+ import { RGBAColor } from "./js-extensions/RGBAColor.js";
12
14
  import { OrbitControls } from "./OrbitControls.js";
13
- import { RenderTexture } from "../engine/engine_texture.js";
14
- import { Texture } from "three";
15
15
 
16
16
  export enum ClearFlags {
17
17
  Skybox = 1,
src/engine-components/CameraUtils.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { OrbitControls } from "./OrbitControls.js";
1
+ import { Object3D } from "three";
2
+
3
+ import { getCameraController } from "../engine/engine_camera.js";
2
4
  import { addNewComponent, getOrAddComponent } from "../engine/engine_components.js";
3
- import { Object3D } from "three";
4
- import type { ICamera, IContext } from "../engine/engine_types.js";
5
- import { RGBAColor } from "./js-extensions/RGBAColor.js";
5
+ import { Context } from "../engine/engine_context.js";
6
6
  import { ContextEvent, ContextRegistry } from "../engine/engine_context_registry.js";
7
- import { getCameraController } from "../engine/engine_camera.js";
8
- import { Camera, ClearFlags } from "./Camera.js";
9
7
  import { NeedleEngineHTMLElement } from "../engine/engine_element.js";
8
+ import type { ICamera, IContext } from "../engine/engine_types.js";
10
9
  import { getParam } from "../engine/engine_utils.js";
11
- import { Context } from "../engine/engine_context.js";
10
+ import { Camera, ClearFlags } from "./Camera.js";
11
+ import { RGBAColor } from "./js-extensions/RGBAColor.js";
12
+ import { OrbitControls } from "./OrbitControls.js";
12
13
 
13
14
  const debug = getParam("debugmissingcamera");
14
15
 
src/engine-components/ui/Canvas.ts CHANGED
@@ -1,18 +1,19 @@
1
- import { updateRenderSettings as updateRenderSettingsRecursive } from "./Utils.js";
1
+ import { Matrix4, Object3D } from "three";
2
+ import * as ThreeMeshUI from 'three-mesh-ui'
3
+
4
+ import { Mathf } from "../../engine/engine_math.js";
2
5
  import { serializable } from "../../engine/engine_serialization_decorator.js";
3
6
  import { FrameEvent } from "../../engine/engine_setup.js";
7
+ import { getParam } from "../../engine/engine_utils.js";
8
+ import { NeedleXREventArgs } from "../../engine/xr/index.js";
9
+ import { Camera } from "../Camera.js";
10
+ import { GameObject } from "../Component.js";
4
11
  import { BaseUIComponent, UIRootComponent } from "./BaseUIComponent.js";
5
- import { GameObject } from "../Component.js";
6
- import { Matrix4, Object3D } from "three";
7
- import { RectTransform } from "./RectTransform.js";
12
+ import { EventSystem } from "./EventSystem.js";
8
13
  import type { ICanvas, ICanvasEventReceiver, ILayoutGroup, IRectTransform } from "./Interfaces.js";
9
- import { Camera } from "../Camera.js";
10
- import { EventSystem } from "./EventSystem.js";
11
- import * as ThreeMeshUI from 'three-mesh-ui'
12
- import { getParam } from "../../engine/engine_utils.js";
13
14
  import { LayoutGroup } from "./Layout.js";
14
- import { Mathf } from "../../engine/engine_math.js";
15
- import { NeedleXREventArgs } from "../../engine/xr/index.js";
15
+ import { RectTransform } from "./RectTransform.js";
16
+ import { updateRenderSettings as updateRenderSettingsRecursive } from "./Utils.js";
16
17
 
17
18
  export enum RenderMode {
18
19
  ScreenSpaceOverlay = 0,
src/engine-components/ui/CanvasGroup.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Graphic } from "./Graphic.js";
1
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
2
2
  import { FrameEvent } from "../../engine/engine_setup.js";
3
3
  import { Behaviour, GameObject } from "../Component.js";
4
+ import { BaseUIComponent } from "./BaseUIComponent.js";
5
+ import { Graphic } from "./Graphic.js";
4
6
  import { type ICanvasGroup, type IHasAlphaFactor } from "./Interfaces.js";
5
- import { serializable } from "../../engine/engine_serialization_decorator.js";
6
- import { BaseUIComponent } from "./BaseUIComponent.js";
7
7
 
8
8
 
9
9
  export class CanvasGroup extends Behaviour implements ICanvasGroup {
src/engine-components/CharacterController.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import { Quaternion, Ray, Vector2, Vector3 } from "three";
2
+
2
3
  import { Mathf } from "../engine/engine_math.js";
4
+ import { RaycastOptions } from "../engine/engine_physics.js";
3
5
  import { serializable } from "../engine/engine_serialization.js";
6
+ import { getWorldPosition } from "../engine/engine_three_utils.js";
4
7
  import { Collision } from "../engine/engine_types.js";
8
+ import { getParam } from "../engine/engine_utils.js";
9
+ import { Animator } from "./Animator.js"
5
10
  import { CapsuleCollider } from "./Collider.js";
6
11
  import { Behaviour, GameObject } from "./Component.js";
7
12
  import { Rigidbody } from "./RigidBody.js";
8
- import { Animator } from "./Animator.js"
9
- import { RaycastOptions } from "../engine/engine_physics.js";
10
- import { getWorldPosition } from "../engine/engine_three_utils.js";
11
- import { getParam } from "../engine/engine_utils.js";
12
13
 
13
14
  const debug = getParam("debugcharactercontroller");
14
15
 
src/engine-components/postprocessing/Effects/ChromaticAberration.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ChromaticAberrationEffect } from "postprocessing";
2
2
  import { Vector2 } from "three";
3
+
3
4
  import { serializable } from "../../../engine/engine_serialization.js";
4
5
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
5
6
  import { VolumeParameter } from "../VolumeParameter.js";
src/engine-components/Collider.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Behaviour } from "./Component.js";
2
- import { Rigidbody } from "./RigidBody.js";
1
+ import { Group, Mesh, Vector3 } from "three"
2
+
3
+ import type { PhysicsMaterial } from "../engine/engine_physics.types.js";
3
4
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
- import { Group, Mesh, Vector3 } from "three"
5
+ import { getWorldScale } from "../engine/engine_three_utils.js";
5
6
  // import { IColliderProvider, registerColliderProvider } from "../engine/engine_physics.js";
6
7
  import type { IBoxCollider, ICollider, ISphereCollider } from "../engine/engine_types.js";
7
- import { getWorldScale } from "../engine/engine_three_utils.js";
8
- import type { PhysicsMaterial } from "../engine/engine_physics.types.js";
9
8
  import { validate } from "../engine/engine_util_decorator.js";
10
9
  import { unwatchWrite, watchWrite } from "../engine/engine_utils.js";
10
+ import { Behaviour } from "./Component.js";
11
+ import { Rigidbody } from "./RigidBody.js";
11
12
 
12
13
 
13
14
  export class Collider extends Behaviour implements ICollider {
src/engine-components/postprocessing/Effects/ColorAdjustments.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { BrightnessContrastEffect, HueSaturationEffect } from "postprocessing";
2
+ import { LinearToneMapping, NoToneMapping } from "three";
3
+
2
4
  import { serializable } from "../../../engine/engine_serialization.js";
3
5
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
4
6
  import { VolumeParameter } from "../VolumeParameter.js";
5
7
  import { registerCustomEffectType } from "../VolumeProfile.js";
6
- import { LinearToneMapping, NoToneMapping } from "three";
7
8
 
8
9
 
9
10
  export class ColorAdjustments extends PostProcessingEffect {
src/engine-components/Component.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { Mathf } from "../engine/engine_math.js";
2
- import * as threeutils from "../engine/engine_three_utils.js";
1
+ import { Euler, Object3D, Quaternion, Scene, Vector3 } from "three";
2
+
3
+ import { isDevEnvironment,showBalloonWarning } from "../engine/debug/index.js";
4
+ import { addNewComponent, destroyComponentInstance, findObjectOfType, findObjectsOfType, getComponent, getComponentInChildren, getComponentInParent, getComponents, getComponentsInChildren, getComponentsInParent, getOrAddComponent, moveComponentInstance, removeComponent } from "../engine/engine_components.js";
3
5
  import { activeInHierarchyFieldName } from "../engine/engine_constants.js";
4
- import { Context, FrameEvent } from "../engine/engine_setup.js";
6
+ import { destroy, findByGuid, foreachComponent, HideFlags, IInstantiateOptions,instantiate, InstantiateOptions, isActiveInHierarchy, isActiveSelf, isDestroyed, isUsingInstancing, markAsInstancedRendered, setActive } from "../engine/engine_gameobject.js";
5
7
  import * as main from "../engine/engine_mainloop_utils.js";
8
+ import { Mathf } from "../engine/engine_math.js";
6
9
  import { syncDestroy, syncInstantiate } from "../engine/engine_networking_instantiate.js";
7
- import type { ConstructorConcrete, SourceIdentifier, IComponent, IGameObject, Constructor, GuidsMap, Collision, ICollider } from "../engine/engine_types.js";
8
- import { addNewComponent, destroyComponentInstance, findObjectOfType, findObjectsOfType, getComponent, getComponentInChildren, getComponentInParent, getComponents, getComponentsInChildren, getComponentsInParent, getOrAddComponent, moveComponentInstance, removeComponent } from "../engine/engine_components.js";
9
- import { findByGuid, destroy, InstantiateOptions, instantiate, HideFlags, foreachComponent, markAsInstancedRendered, isActiveInHierarchy, isActiveSelf, isUsingInstancing, setActive, isDestroyed, IInstantiateOptions } from "../engine/engine_gameobject.js";
10
-
11
- import { Euler, Object3D, Quaternion, Scene, Vector3 } from "three";
12
- import { showBalloonWarning, isDevEnvironment } from "../engine/debug/index.js";
10
+ import { Context, FrameEvent } from "../engine/engine_setup.js";
11
+ import * as threeutils from "../engine/engine_three_utils.js";
12
+ import type { Collision, Constructor, ConstructorConcrete, GuidsMap, ICollider,IComponent, IGameObject, SourceIdentifier } from "../engine/engine_types.js";
13
13
  import { ControllerChangedEvt, INeedleXRSessionEventReceiver, NeedleXRControllerEventArgs, NeedleXREventArgs, NeedleXRSession } from "../engine/engine_xr.js";
14
14
  import { IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js";
15
15
 
src/engine-components/codegen/components.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable */
1
2
  // Export types
2
3
  export class __Ignore {}
3
4
  export { ActionBuilder } from "../export/usdz/extensions/behavior/BehavioursBuilder.js";
src/engine-components/ContactShadows.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { Behaviour } from "./Component.js";
2
- import { serializable } from "../engine/engine_serialization_decorator.js";
3
-
4
1
  import { CustomBlending, DoubleSide, Group, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MinEquation, OrthographicCamera, PlaneGeometry, ShaderMaterial, WebGLRenderTarget } from "three";
5
2
  import { HorizontalBlurShader } from 'three/examples/jsm/shaders/HorizontalBlurShader.js';
6
3
  import { VerticalBlurShader } from 'three/examples/jsm/shaders/VerticalBlurShader.js';
4
+
5
+ import { serializable } from "../engine/engine_serialization_decorator.js";
7
6
  import { getParam } from "../engine/engine_utils.js"
8
7
  import { setCustomVisibility } from "../engine/js-extensions/Layers.js";
8
+ import { Behaviour } from "./Component.js";
9
9
 
10
10
  const debug = getParam("debugcontactshadows");
11
11
 
src/engine/debug/debug_console.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { getErrorCount, makeErrorsVisibleForDevelopment } from "./debug_overlay.js";
1
+ import { isLocalNetwork } from "../engine_networking_utils.js";
2
2
  import { getParam, isMobileDevice, isQuest } from "../engine_utils.js";
3
- import { isLocalNetwork } from "../engine_networking_utils.js";
4
3
  import { isDevEnvironment } from "./debug.js";
4
+ import { getErrorCount, makeErrorsVisibleForDevelopment } from "./debug_overlay.js";
5
5
 
6
6
  let consoleInstance: any = null;
7
7
  let consoleHtmlElement: HTMLElement | null = null;
src/engine/debug/debug_overlay.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import { ContextRegistry } from "../engine_context_registry.js";
2
+ import { isLocalNetwork } from "../engine_networking_utils.js";
1
3
  import { getParam } from "../engine_utils.js";
2
- import { isLocalNetwork } from "../engine_networking_utils.js";
3
- import { ContextRegistry } from "../engine_context_registry.js";
4
4
 
5
5
  const debug = getParam("debugdebug");
6
6
  let hide = false;
src/engine/debug/debug.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import { isLocalNetwork } from "../engine_networking_utils.js";
2
+ import { showDebugConsole } from "./debug_console.js";
1
3
  import { addLog, LogType, setAllowOverlayMessages } from "./debug_overlay.js";
2
- import { showDebugConsole } from "./debug_console.js";
3
- import { isLocalNetwork } from "../engine_networking_utils.js";
4
4
 
5
5
  export { showDebugConsole }
6
6
  export { LogType, setAllowOverlayMessages };
src/engine-components/DeleteBox.ts CHANGED
@@ -1,5 +1,6 @@
1
1
 
2
2
  import * as THREE from "three";
3
+
3
4
  import { syncDestroy } from "../engine/engine_networking_instantiate.js";
4
5
  import { getParam } from "../engine/engine_utils.js";
5
6
  import { BoxHelperComponent } from "./BoxHelperComponent.js";
src/engine-components/postprocessing/Effects/DepthOfField.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { DepthOfFieldEffect } from "postprocessing";
2
+
3
+ import { Mathf } from "../../../engine/engine_math.js";
2
4
  import { serializable } from "../../../engine/engine_serialization.js";
3
- import { Mathf } from "../../../engine/engine_math.js";
5
+ import { isMobileDevice } from "../../../engine/engine_utils.js";
4
6
  import { PostProcessingEffect } from "../PostProcessingEffect.js";
5
7
  import { VolumeParameter } from "../VolumeParameter.js";
6
8
  import { registerCustomEffectType } from "../VolumeProfile.js";
7
- import { isMobileDevice } from "../../../engine/engine_utils.js";
8
9
 
9
10
  export enum DepthOfFieldMode {
10
11
  Off = 0,
src/engine-components/DeviceFlag.ts CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
+ import { serializable } from "../engine/engine_serialization_decorator.js";
2
3
  import { isMobileDevice } from "../engine/engine_utils.js";
3
- import { serializable } from "../engine/engine_serialization_decorator.js";
4
4
  import { Behaviour, GameObject } from "./Component.js";
5
5
 
6
6
 
src/engine-components/DragControls.ts CHANGED
@@ -1,22 +1,23 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
- import { SyncedTransform } from "./SyncedTransform.js";
3
- import type { IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js";
1
+ import { AxesHelper, Box3, BufferGeometry, Camera, Color, Event, Line, LineBasicMaterial, Matrix3, Matrix4, Mesh, MeshBasicMaterial, Object3D, Plane, PlaneHelper, Quaternion, Ray, Raycaster, SphereGeometry, Vector3 } from "three";
2
+
3
+ import { Gizmos } from "../engine/engine_gizmos.js";
4
+ import { InstancingUtil } from "../engine/engine_instancing.js";
5
+ import { Mathf } from "../engine/engine_math.js";
6
+ import { RaycastOptions } from "../engine/engine_physics.js";
7
+ import { serializable } from "../engine/engine_serialization_decorator.js";
4
8
  import { Context } from "../engine/engine_setup.js";
5
- import { UsageMarker } from "./Interactable.js";
6
- import { Rigidbody } from "./RigidBody.js";
7
- import { Avatar_POI } from "./avatar/Avatar_Brain_LookAt.js";
8
- import { RaycastOptions } from "../engine/engine_physics.js";
9
9
  import { getWorldPosition, setWorldPosition } from "../engine/engine_three_utils.js";
10
- import { InstancingUtil } from "../engine/engine_instancing.js";
11
- import { OrbitControls } from "./OrbitControls.js";
12
- import { AxesHelper, Box3, BufferGeometry, Camera, Color, Event, Line, LineBasicMaterial, Matrix3, Matrix4, Mesh, MeshBasicMaterial, Object3D, Plane, PlaneHelper, Quaternion, Ray, Raycaster, SphereGeometry, Vector3 } from "three";
13
- import { ObjectRaycaster } from "./ui/Raycaster.js";
14
- import { serializable } from "../engine/engine_serialization_decorator.js";
15
10
  import { IGameObject } from "../engine/engine_types.js";
16
- import { Mathf } from "../engine/engine_math.js";
17
11
  import { getParam } from "../engine/engine_utils.js";
18
- import { Gizmos } from "../engine/engine_gizmos.js";
19
12
  import { NeedleXRSession } from "../engine/engine_xr.js";
13
+ import { Avatar_POI } from "./avatar/Avatar_Brain_LookAt.js";
14
+ import { Behaviour, GameObject } from "./Component.js";
15
+ import { UsageMarker } from "./Interactable.js";
16
+ import { OrbitControls } from "./OrbitControls.js";
17
+ import { Rigidbody } from "./RigidBody.js";
18
+ import { SyncedTransform } from "./SyncedTransform.js";
19
+ import type { IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js";
20
+ import { ObjectRaycaster } from "./ui/Raycaster.js";
20
21
 
21
22
  const debug = getParam("debugdrag");
22
23
 
src/engine-components/DropListener.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Behaviour, GameObject } from "./Component.js";
1
+ import type { GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
2
+
3
+ import * as files from "../engine/engine_networking_files.js";
2
4
  import { RaycastOptions } from "../engine/engine_physics.js";
3
- import * as files from "../engine/engine_networking_files.js";
4
5
  import { serializable } from "../engine/engine_serialization_decorator.js";
6
+ import { getParam } from "../engine/engine_utils.js";
5
7
  import { Networking } from "../engine-components/Networking.js";
6
- import type { GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
7
- import { getParam } from "../engine/engine_utils.js";
8
+ import { Behaviour, GameObject } from "./Component.js";
8
9
 
9
10
  const debug = getParam("debugdroplistener");
10
11
 
src/engine-components/Duplicatable.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import { Object3D,Quaternion, Vector3 } from "three";
2
+
3
+ import { InstantiateOptions } from "../engine/engine_gameobject.js";
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
1
5
  import { Behaviour, GameObject } from "./Component.js";
2
6
  import { DragControls } from "./DragControls.js";
3
- import { Vector3, Quaternion, Object3D } from "three";
4
- import { serializable } from "../engine/engine_serialization_decorator.js";
5
- import { InstantiateOptions } from "../engine/engine_gameobject.js";
6
7
  import { IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js";
7
8
  import { ObjectRaycaster } from "./ui/Raycaster.js";
8
9
 
src/engine/engine_addressables.ts CHANGED
@@ -1,13 +1,14 @@
1
+ import { Group, Object3D, Texture, TextureLoader } from "three";
2
+
1
3
  import { deepClone, getParam, resolveUrl } from "../engine/engine_utils.js";
2
- import { SerializationContext, TypeSerializer, assign } from "./engine_serialization_core.js";
3
- import { Context } from "./engine_setup.js";
4
- import { Group, Object3D, Texture, TextureLoader } from "three";
4
+ import { destroy, IInstantiateOptions, instantiate, InstantiateOptions, isDestroyed } from "./engine_gameobject.js";
5
+ import { getLoader } from "./engine_gltf.js";
5
6
  import { processNewScripts } from "./engine_mainloop_utils.js";
6
7
  import { registerPrefabProvider, syncInstantiate } from "./engine_networking_instantiate.js";
8
+ import { assign,SerializationContext, TypeSerializer } from "./engine_serialization_core.js";
9
+ import { Context } from "./engine_setup.js";
10
+ import type { IComponent, IGameObject, SourceIdentifier } from "./engine_types.js";
7
11
  import { download } from "./engine_web_api.js";
8
- import { getLoader } from "./engine_gltf.js";
9
- import type { IComponent, IGameObject, SourceIdentifier } from "./engine_types.js";
10
- import { destroy, IInstantiateOptions, instantiate, InstantiateOptions, isDestroyed } from "./engine_gameobject.js";
11
12
 
12
13
  const debug = getParam("debugaddressables");
13
14
 
src/engine/engine_assetdatabase.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { InternalUsageTrackerPlugin } from "./extensions/usage_tracker.js";
2
1
  import { Bone, BufferAttribute, BufferGeometry, InterleavedBuffer, InterleavedBufferAttribute, Material, Mesh, NeverCompare, Object3D, Scene, Skeleton, SkinnedMesh, Source, Texture, Uniform, WebGLRenderer } from "three";
2
+
3
3
  import { addPatch } from "./engine_patcher.js";
4
4
  import { getParam } from "./engine_utils.js";
5
+ import { InternalUsageTrackerPlugin } from "./extensions/usage_tracker.js";
5
6
 
6
7
 
7
8
  export class AssetDatabase {
src/engine/engine_camera.ts CHANGED
@@ -1,7 +1,8 @@
1
- import type { ICameraController } from "./engine_types.js";
2
1
  import { Camera, Object3D } from "three";
3
2
 
3
+ import type { ICameraController } from "./engine_types.js";
4
4
 
5
+
5
6
  const $cameraController = Symbol("cameraController");
6
7
 
7
8
  export function getCameraController(cam: Camera): ICameraController | null {
src/engine/engine_components.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { Object3D, Scene } from "three";
2
+
3
+ import { apply } from "../engine-components/js-extensions/Object3D.js";
4
+ import { ComponentEvents, ComponentLifecycleEvents } from "./engine_components_internal.js";
5
+ import { activeInHierarchyFieldName } from "./engine_constants.js";
6
+ import { removeScriptFromContext, updateActiveInHierarchyWithoutEventCall } from "./engine_mainloop_utils.js";
7
+ import { InstantiateIdProvider } from "./engine_networking_instantiate.js";
8
+ import { Context, registerComponent } from "./engine_setup.js";
2
9
  import type { Constructor, ConstructorConcrete, IComponent, IGameObject } from "./engine_types.js";
3
- import { Context, registerComponent } from "./engine_setup.js";
4
10
  import { getParam } from "./engine_utils.js";
5
- import { removeScriptFromContext, updateActiveInHierarchyWithoutEventCall } from "./engine_mainloop_utils.js";
6
- import { activeInHierarchyFieldName } from "./engine_constants.js";
7
- import { apply } from "../engine-components/js-extensions/Object3D.js";
8
- import { InstantiateIdProvider } from "./engine_networking_instantiate.js";
9
- import { ComponentEvents, ComponentLifecycleEvents } from "./engine_components_internal.js";
10
11
 
11
12
  const debug = getParam("debuggetcomponent");
12
13
 
src/engine/engine_context.ts CHANGED
@@ -1,41 +1,35 @@
1
+ import { EffectComposer, RenderPass } from "postprocessing";
1
2
  import {
2
3
  BufferGeometry, Cache, Camera, Clock, Color, DepthTexture, Group,
3
4
  Material, NearestFilter, NoToneMapping, Object3D, PCFSoftShadowMap,
4
5
  PerspectiveCamera, RGBAFormat, Scene, SRGBColorSpace,
5
6
  Texture, WebGLRenderer, type WebGLRendererParameters, WebGLRenderTarget, type WebXRArrayCamera
6
7
  } from 'three';
8
+ import * as Stats from 'three/examples/jsm/libs/stats.module.js';
7
9
 
10
+ import { isDevEnvironment, LogType, showBalloonError, showBalloonMessage, showBalloonWarning } from './debug/index.js';
11
+ import { Addressables } from './engine_addressables.js';
12
+ import { Application } from './engine_application.js';
13
+ import { AssetDatabase } from './engine_assetdatabase.js';
14
+ import { VERSION } from './engine_constants.js';
15
+ import { ContextEvent, ContextRegistry } from './engine_context_registry.js';
16
+ import { WaitForPromise } from './engine_coroutine.js';
17
+ import { destroy, foreachComponent } from './engine_gameobject.js';
18
+ import { getLoader } from './engine_gltf.js';
8
19
  import { Input } from './engine_input.js';
20
+ import { invokeLifecycleFunctions } from './engine_lifecycle_functions_internal.js';
21
+ import { type ILightDataRegistry,LightDataRegistry } from './engine_lightdata.js';
22
+ import * as looputils from './engine_mainloop_utils.js';
23
+ import { NetworkConnection } from './engine_networking.js';
24
+ import { isLocalNetwork } from './engine_networking_utils.js';
9
25
  import { Physics } from './engine_physics.js';
26
+ import { PlayerViewManager } from './engine_playerview.js';
27
+ import { RendererData as SceneLighting } from './engine_scenelighting.js';
28
+ import { logHierarchy } from './engine_three_utils.js';
10
29
  import { Time } from './engine_time.js';
11
- import { NetworkConnection } from './engine_networking.js';
12
-
13
- import * as looputils from './engine_mainloop_utils.js';
30
+ import { type CoroutineData, type GLTF, type ICamera, type IComponent, type IContext, type ILight, INeedleXRSession, type LoadedGLTF } from "./engine_types.js";
14
31
  import * as utils from "./engine_utils.js";
15
-
16
- import { EffectComposer, RenderPass } from "postprocessing";
17
-
18
- import { AssetDatabase } from './engine_assetdatabase.js';
19
-
20
- import { logHierarchy } from './engine_three_utils.js';
21
-
22
- import * as Stats from 'three/examples/jsm/libs/stats.module.js';
23
- import { RendererData as SceneLighting } from './engine_scenelighting.js';
24
- import { Addressables } from './engine_addressables.js';
25
- import { Application } from './engine_application.js';
26
- import { LightDataRegistry, type ILightDataRegistry } from './engine_lightdata.js';
27
- import { PlayerViewManager } from './engine_playerview.js';
28
-
29
- import { INeedleXRSession, type CoroutineData, type GLTF, type ICamera, type IComponent, type IContext, type ILight, type LoadedGLTF } from "./engine_types.js";
30
- import { destroy, foreachComponent } from './engine_gameobject.js';
31
- import { ContextEvent, ContextRegistry } from './engine_context_registry.js';
32
32
  import { delay, getParam } from './engine_utils.js';
33
- import { VERSION } from './engine_constants.js';
34
- import { isDevEnvironment, LogType, showBalloonError, showBalloonMessage, showBalloonWarning } from './debug/index.js';
35
- import { getLoader } from './engine_gltf.js';
36
- import { isLocalNetwork } from './engine_networking_utils.js';
37
- import { WaitForPromise } from './engine_coroutine.js';
38
- import { invokeLifecycleFunctions } from './engine_lifecycle_functions_internal.js';
39
33
  import type { INeedleXRSessionEventReceiver } from './engine_xr.js';
40
34
 
41
35
 
src/engine/engine_create_objects.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { PlaneGeometry, MeshBasicMaterial, DoubleSide, Mesh, Material, MeshStandardMaterial, BoxGeometry, SphereGeometry, ColorRepresentation } from "three"
1
+ import { BoxGeometry, ColorRepresentation,DoubleSide, Material, Mesh, MeshBasicMaterial, MeshStandardMaterial, PlaneGeometry, SphereGeometry } from "three"
2
+
2
3
  import { Vec3 } from "./engine_types.js";
3
4
 
4
5
  export enum PrimitiveType {
src/engine/engine_element_loading.ts CHANGED
@@ -1,9 +1,9 @@
1
+ import { logoSVG } from "./assets/index.js"
1
2
  import { showBalloonWarning } from "./debug/index.js";
3
+ import { hasCommercialLicense, hasProLicense, runtimeLicenseCheckPromise } from "./engine_license.js";
2
4
  import { Mathf } from "./engine_math.js";
3
5
  import { LoadingProgressArgs } from "./engine_setup.js";
4
6
  import { getParam } from "./engine_utils.js";
5
- import { logoSVG } from "./assets/index.js"
6
- import { hasCommercialLicense, hasProLicense, runtimeLicenseCheckPromise } from "./engine_license.js";
7
7
 
8
8
  const debug = getParam("debugloading");
9
9
  const debugRendering = getParam("debugloadingrendering");
src/engine/engine_element.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { Context, ContextCreateArgs, LoadingProgressArgs } from "./engine_setup.js";
2
- import { AROverlayHandler, arContainerClassName } from "./engine_element_overlay.js";
1
+ import { getLoader, registerLoader } from "../engine/engine_gltf.js";
3
2
  import { GameObject } from "../engine-components/Component.js";
3
+ import { isDevEnvironment, showBalloonWarning } from "./debug/index.js";
4
+ import { VERSION } from "./engine_constants.js";
4
5
  import { calculateProgress01, EngineLoadingView, type ILoadingViewHandler } from "./engine_element_loading.js";
5
- import { getParam } from "./engine_utils.js";
6
+ import { arContainerClassName,AROverlayHandler } from "./engine_element_overlay.js";
7
+ import { hasCommercialLicense } from "./engine_license.js";
6
8
  import { setDracoDecoderPath, setDracoDecoderType, setKtx2TranscoderPath } from "./engine_loaders.js";
7
- import { getLoader, registerLoader } from "../engine/engine_gltf.js";
8
9
  import { NeedleGltfLoader } from "./engine_scenetools.js";
10
+ import { Context, ContextCreateArgs, LoadingProgressArgs } from "./engine_setup.js";
9
11
  import { type INeedleEngineComponent, type LoadedGLTF } from "./engine_types.js";
10
- import { isDevEnvironment, showBalloonWarning } from "./debug/index.js";
11
- import { hasCommercialLicense } from "./engine_license.js";
12
- import { VERSION } from "./engine_constants.js";
12
+ import { getParam } from "./engine_utils.js";
13
13
 
14
14
  //
15
15
  // registering loader here too to make sure it's imported when using engine via vanilla js
src/engine/engine_gameobject.ts CHANGED
@@ -1,17 +1,18 @@
1
1
  import { Bone, Object3D, Quaternion, SkinnedMesh, Vector3 } from "three";
2
+
3
+ import { apply } from "../engine-components/js-extensions/Object3D.js";
4
+ import { __internalNotifyObjectDestroyed as __internalRemoveReferences,disposeObjectResources } from "./engine_assetdatabase.js";
5
+ import { ComponentEvents,ComponentLifecycleEvents } from "./engine_components_internal.js";
6
+ import { activeInHierarchyFieldName } from "./engine_constants.js";
7
+ import { editorGuidKeyName } from "./engine_constants.js";
8
+ import { $isUsingInstancing, InstancingUtil } from "./engine_instancing.js";
2
9
  import { processNewScripts } from "./engine_mainloop_utils.js";
3
10
  import { InstantiateIdProvider } from "./engine_networking_instantiate.js";
11
+ import { assign } from "./engine_serialization_core.js";
4
12
  import { Context, registerComponent } from "./engine_setup.js";
5
13
  import { logHierarchy, setWorldPosition, setWorldQuaternion } from "./engine_three_utils.js";
6
- import { type GuidsMap, type IComponent as Component, type IComponent, type IGameObject as GameObject, type UIDProvider, type Constructor } from "./engine_types.js";
14
+ import { type Constructor,type GuidsMap, type IComponent as Component, type IComponent, type IGameObject as GameObject, type UIDProvider } from "./engine_types.js";
7
15
  import { getParam, tryFindObject } from "./engine_utils.js";
8
- import { apply } from "../engine-components/js-extensions/Object3D.js";
9
- import { $isUsingInstancing, InstancingUtil } from "./engine_instancing.js";
10
- import { activeInHierarchyFieldName } from "./engine_constants.js";
11
- import { assign } from "./engine_serialization_core.js";
12
- import { disposeObjectResources, __internalNotifyObjectDestroyed as __internalRemoveReferences } from "./engine_assetdatabase.js";
13
- import { editorGuidKeyName } from "./engine_constants.js";
14
- import { ComponentLifecycleEvents, ComponentEvents } from "./engine_components_internal.js";
15
16
 
16
17
  const debug = getParam("debuggetcomponent");
17
18
  const debugInstantiate = getParam("debuginstantiate");
src/engine/engine_gizmos.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { BufferAttribute, Line, BoxGeometry, EdgesGeometry, Color, LineSegments, LineBasicMaterial, Object3D, Mesh, SphereGeometry, type ColorRepresentation, Vector3, Box3, Quaternion, CylinderGeometry, AxesHelper } from 'three';
1
+ import { AxesHelper,Box3, BoxGeometry, BufferAttribute, Color, type ColorRepresentation, CylinderGeometry, EdgesGeometry, Line, LineBasicMaterial, LineSegments, Mesh, Object3D, Quaternion, SphereGeometry, Vector3 } from 'three';
2
+ import ThreeMeshUI, { Inline, Text } from "three-mesh-ui"
3
+ import { type Options } from 'three-mesh-ui/build/types/core/elements/MeshUIBaseElement.js';
4
+
5
+ import { isDestroyed } from './engine_gameobject.js';
2
6
  import { Context } from './engine_setup.js';
3
7
  import { getWorldPosition, lookAtObject, setWorldPositionXYZ } from './engine_three_utils.js';
4
8
  import type { Vec3, Vec4 } from './engine_types.js';
5
- import ThreeMeshUI, { Inline, Text } from "three-mesh-ui"
6
9
  import { getParam } from './engine_utils.js';
7
- import { type Options } from 'three-mesh-ui/build/types/core/elements/MeshUIBaseElement.js';
8
- import { isDestroyed } from './engine_gameobject.js';
9
10
  import { NeedleXRSession } from './engine_xr.js';
10
11
 
11
12
  const _tmp = new Vector3();
src/engine/engine_gltf_builtin_components.ts CHANGED
@@ -1,18 +1,20 @@
1
1
  import "./codegen/register_types.js";
2
- import { TypeStore } from "./engine_typestore.js";
2
+
3
+ import { Object3D } from "three";
4
+
5
+ import { LogType, showBalloonMessage } from "./debug/index.js";
6
+ import { addNewComponent } from "./engine_components.js";
7
+ import { builtinComponentKeyName,editorGuidKeyName } from "./engine_constants.js";
8
+ import { debugExtension } from "./engine_default_parameters.js";
3
9
  import { InstantiateIdProvider } from "./engine_networking_instantiate.js"
4
- import { Context } from "./engine_setup.js";
10
+ import { isLocalNetwork } from "./engine_networking_utils.js";
5
11
  import { deserializeObject, serializeObject } from "./engine_serialization.js";
6
12
  import { assign, ImplementationInformation, type ISerializable, SerializationContext } from "./engine_serialization_core.js";
7
- import { NEEDLE_components } from "./extensions/NEEDLE_components.js";
8
- import { debugExtension } from "./engine_default_parameters.js";
9
- import { editorGuidKeyName, builtinComponentKeyName } from "./engine_constants.js";
13
+ import { Context } from "./engine_setup.js";
10
14
  import type { GuidsMap, ICamera, IComponent, IGameObject, SourceIdentifier, UIDProvider } from "./engine_types.js";
11
- import { addNewComponent } from "./engine_components.js";
15
+ import { TypeStore } from "./engine_typestore.js";
12
16
  import { getParam } from "./engine_utils.js";
13
- import { LogType, showBalloonMessage } from "./debug/index.js";
14
- import { isLocalNetwork } from "./engine_networking_utils.js";
15
- import { Object3D } from "three";
17
+ import { NEEDLE_components } from "./extensions/NEEDLE_components.js";
16
18
 
17
19
 
18
20
  const debug = debugExtension;
src/engine/engine_gltf.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js'
2
+
3
+ import { SerializationContext } from "./engine_serialization_core.js";
4
+ import { Context } from "./engine_setup.js";
1
5
  import type { ConstructorConcrete, SourceIdentifier, UIDProvider } from "./engine_types.js";
2
- import { Context } from "./engine_setup.js";
3
6
  import { NEEDLE_components } from "./extensions/NEEDLE_components.js";
4
- import { SerializationContext } from "./engine_serialization_core.js";
5
- import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js'
6
7
 
7
8
 
8
9
  export interface INeedleGltfLoader {
src/engine/engine_hot_reload.ts CHANGED
@@ -1,8 +1,8 @@
1
+ import { addLog, LogType } from "./debug/debug_overlay.js";
2
+ import { addScriptToArrays, removeScriptFromContext } from "./engine_mainloop_utils.js"
1
3
  import type { IComponent } from "./engine_types.js";
2
4
  import { TypeStore } from "./engine_typestore.js";
3
- import { addScriptToArrays, removeScriptFromContext } from "./engine_mainloop_utils.js"
4
5
  import { getParam } from "./engine_utils.js";
5
- import { addLog, LogType } from "./debug/debug_overlay.js";
6
6
 
7
7
  const debug = getParam("debughotreload");
8
8
 
src/engine/engine_input.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Matrix4, Object3D, Ray, Vector2, Vector3 } from 'three';
2
+
2
3
  import { showBalloonMessage, showBalloonWarning } from './debug/debug.js';
3
4
  import { Context } from './engine_setup.js';
4
5
  import type { ButtonName, IGameObject, IInput, MouseButtonName, Vec2 } from './engine_types.js';
src/engine/engine_license.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { getParam, isMobileDevice } from "./engine_utils.js";
1
+ import { logoSVG } from "./assets/index.js";
2
+ import { GENERATOR, VERSION } from "./engine_constants.js";
2
3
  import { ContextEvent, ContextRegistry } from "./engine_context_registry.js";
3
4
  import type { IContext } from "./engine_types.js";
4
- import { logoSVG } from "./assets/index.js";
5
- import { GENERATOR, VERSION } from "./engine_constants.js";
5
+ import { getParam, isMobileDevice } from "./engine_utils.js";
6
6
 
7
7
  const debug = getParam("debuglicense");
8
8
 
@@ -50,18 +50,21 @@
50
50
  const licenseUrl = "https://engine.needle.tools/licensing/check?location=" + encodeURIComponent(window.location.href) + "&version=" + VERSION + "&generator=" + encodeURIComponent(GENERATOR);
51
51
  const res = await fetch(licenseUrl, {
52
52
  method: "GET",
53
- }).catch();
53
+ }).catch(_err => {
54
+ if (debug) console.error("License check failed", _err);
55
+ return undefined;
56
+ });
54
57
  if (res?.status === 200) {
55
58
  applicationIsForbidden = false;
56
59
  if (debug) console.log("License check succeeded");
57
60
  NEEDLE_ENGINE_LICENSE_TYPE = "pro";
58
61
  }
59
- else if (res.status === 403) {
62
+ else if (res?.status === 403) {
60
63
  applicationIsForbidden = true;
61
64
  applicationForbiddenText = await res.text();
62
65
  }
63
66
  else {
64
- if (debug) console.log("License check failed with status " + res.status);
67
+ if (debug) console.log("License check failed with status " + res?.status);
65
68
  }
66
69
  }
67
70
  catch (err) {
src/engine/engine_lifecycle_api.ts CHANGED
@@ -1,5 +1,5 @@
1
+ import { FrameEvent } from "./engine_context.js";
1
2
  import { ContextEvent } from "./engine_context_registry.js";
2
- import { FrameEvent } from "./engine_context.js";
3
3
  import { LifecycleMethod, registerFrameEventCallback } from "./engine_lifecycle_functions_internal.js";
4
4
 
5
5
 
src/engine/engine_lifecycle_functions_internal.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import { type Context,FrameEvent } from "./engine_context.js";
2
+ import type { ContextEvent } from "./engine_context_registry.js";
1
3
  import { safeInvoke } from "./engine_generic_utils.js";
2
- import { FrameEvent, type Context } from "./engine_context.js";
3
- import type { ContextEvent } from "./engine_context_registry.js";
4
4
 
5
5
  export declare type LifecycleMethod = (ctx: Context) => void;
6
6
  export declare type Event = ContextEvent | FrameEvent;
src/engine/engine_lightdata.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { LightmapType } from "./extensions/NEEDLE_lightmaps.js";
2
- import { Texture, ShaderChunk, UniformsLib, Vector4 } from "three";
1
+ import { ShaderChunk, Texture, UniformsLib, Vector4 } from "three";
2
+
3
3
  import { Context } from "./engine_setup.js";
4
+ import type { SourceIdentifier } from "./engine_types.js";
4
5
  import { getParam } from "./engine_utils.js";
5
- import type { SourceIdentifier } from "./engine_types.js";
6
+ import { LightmapType } from "./extensions/NEEDLE_lightmaps.js";
6
7
 
7
8
  const debugLightmap = getParam("debuglightmaps") ? true : false;
8
9
 
src/engine/engine_loaders.ts CHANGED
@@ -1,10 +1,10 @@
1
1
 
2
- import { Context } from "./engine_setup.js"
2
+ import { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js';
3
+ import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
3
4
  import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
4
- import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
5
5
  import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
6
- import { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js';
7
6
 
7
+ import { Context } from "./engine_setup.js"
8
8
  import { getParam } from "./engine_utils.js";
9
9
 
10
10
  const debug = getParam("debugdecoders");
src/engine/engine_mainloop_utils.ts CHANGED
@@ -1,11 +1,12 @@
1
+ import { CubeCamera, Object3D, Scene, WebGLCubeRenderTarget } from 'three';
2
+
3
+ import { isDevEnvironment } from "./debug/index.js";
4
+ import * as constants from "./engine_constants.js";
5
+ import { ContextRegistry } from "./engine_context_registry.js";
6
+ import { isActiveSelf } from './engine_gameobject.js';
1
7
  import { safeInvoke } from "./engine_generic_utils.js";
2
- import * as constants from "./engine_constants.js";
8
+ import type { IComponent, IContext } from './engine_types.js';
3
9
  import { getParam } from './engine_utils.js';
4
- import { CubeCamera, Object3D, Scene, WebGLCubeRenderTarget } from 'three';
5
- import type { IComponent, IContext } from './engine_types.js';
6
- import { isActiveSelf } from './engine_gameobject.js';
7
- import { ContextRegistry } from "./engine_context_registry.js";
8
- import { isDevEnvironment } from "./debug/index.js";
9
10
  import type { INeedleXRSessionEventReceiver } from "./engine_xr.js";
10
11
 
11
12
  const debug = getParam("debugnewscripts");
src/engine/engine_networking_auto.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { getParam } from "./engine_utils.js";
2
1
  import { isDevEnvironment } from "./debug/index.js";
3
2
  import type { IComponent } from "./engine_types.js";
3
+ import { getParam } from "./engine_utils.js";
4
4
 
5
5
  const debug = getParam("debugautosync");
6
6
 
src/engine/engine_networking_files_default_components.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  // import { SyncedTransform } from "../engine-components/SyncedTransform.js";
2
2
  // import { DragControls } from "../engine-components/DragControls.js"
3
3
  // import { ObjectRaycaster } from "../engine-components/ui/Raycaster.js";
4
+ import type { GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
5
+
4
6
  import type { UIDProvider } from "./engine_types.js";
5
- import type { GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
6
7
  // import { Animation } from "../engine-components/Animation.js";
7
8
 
8
9
 
src/engine/engine_networking_files.ts CHANGED
@@ -1,15 +1,16 @@
1
+ import { BoxGeometry, BoxHelper, Mesh, MeshBasicMaterial, Object3D, Vector3 } from "three";
2
+ import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js'
3
+
4
+ import { getLoader } from "../engine/engine_gltf.js";
5
+ import { NetworkConnection } from "../engine/engine_networking.js";
6
+ import { generateSeed, InstantiateIdProvider } from "../engine/engine_networking_instantiate.js";
1
7
  import { Context } from "../engine/engine_setup.js";
2
8
  import * as web from "../engine/engine_web_api.js";
3
- import { NetworkConnection } from "../engine/engine_networking.js";
4
- import { generateSeed, InstantiateIdProvider } from "../engine/engine_networking_instantiate.js";
9
+ import { ContextEvent, ContextRegistry } from "./engine_context_registry.js";
10
+ import { findByGuid } from "./engine_gameobject.js";
5
11
  import * as def from "./engine_networking_files_default_components.js"
6
- import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js'
7
- import { getLoader } from "../engine/engine_gltf.js";
8
12
  import type { IModel } from "./engine_networking_types.js";
9
13
  import type { IGameObject } from "./engine_types.js";
10
- import { findByGuid } from "./engine_gameobject.js";
11
- import { ContextEvent, ContextRegistry } from "./engine_context_registry.js";
12
- import { BoxGeometry, BoxHelper, Mesh, MeshBasicMaterial, Object3D, Vector3 } from "three";
13
14
 
14
15
  export enum File_Event {
15
16
  File_Spawned = "file-spawned",
src/engine/engine_networking_instantiate.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  // import { IModel, NetworkConnection } from "./engine_networking.js"
2
2
  import * as THREE from "three";
3
- import { Context } from "./engine_setup.js"
4
- import * as utils from "./engine_utils.js"
5
- import type { INetworkConnection } from "./engine_networking_types.js";
6
- import type { IGameObject as GameObject, IComponent as Component } from "./engine_types.js"
7
-
3
+ import { Object3D } from "three";
8
4
  // https://github.com/uuidjs/uuid
9
5
  // v5 takes string and namespace
10
6
  import { v5 } from 'uuid';
11
- import type { UIDProvider } from "./engine_types.js";
7
+
8
+ import { ContextEvent, ContextRegistry } from "../engine/engine_context_registry.js";
9
+ import { destroy, findByGuid, IInstantiateOptions, instantiate } from "./engine_gameobject.js";
10
+ import { InstantiateOptions } from "./engine_gameobject.js";
11
+ import type { INetworkConnection } from "./engine_networking_types.js";
12
12
  import type { IModel } from "./engine_networking_types.js";
13
13
  import { SendQueue } from "./engine_networking_types.js";
14
- import { IInstantiateOptions, destroy, findByGuid, instantiate } from "./engine_gameobject.js";
15
- import { Object3D } from "three";
16
- import { InstantiateOptions } from "./engine_gameobject.js";
17
- import { ContextEvent, ContextRegistry } from "../engine/engine_context_registry.js";
14
+ import { Context } from "./engine_setup.js"
15
+ import type { IComponent as Component,IGameObject as GameObject } from "./engine_types.js"
16
+ import type { UIDProvider } from "./engine_types.js";
17
+ import * as utils from "./engine_utils.js"
18
18
 
19
19
 
20
20
 
src/engine/engine_networking_peer.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import type { DataConnection, PeerJSOption } from "peerjs";
1
2
  import Peer, { type PeerConnectOption } from "peerjs";
2
- import type { DataConnection, PeerJSOption } from "peerjs";
3
+
3
4
  import { type ConstructorConcrete } from "./engine_types.js";
4
5
 
5
6
  let peerOptions: PeerJSOption | undefined = undefined;
src/engine/engine_networking_streams.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { type Context } from "./engine_context.js";
2
1
  import Peer, { MediaConnection } from "peerjs"
2
+ import { EventDispatcher } from "three";
3
+
3
4
  import { RoomEvents } from "../engine/engine_networking.js";
4
5
  import { UserJoinedOrLeftRoomModel } from "../engine/engine_networking.js";
6
+ import { getPeerjsInstance } from "../engine/engine_networking_peer.js";
7
+ import { type Context } from "./engine_context.js";
5
8
  import type { IModel } from "./engine_networking_types.js";
6
- import { getPeerjsInstance } from "../engine/engine_networking_peer.js";
7
- import { EventDispatcher } from "three";
9
+ import { type IComponent } from "./engine_types.js";
8
10
  import { getParam } from "./engine_utils.js";
9
- import { type IComponent } from "./engine_types.js";
10
11
 
11
12
 
12
13
 
src/engine/engine_networking.ts CHANGED
@@ -1,16 +1,17 @@
1
1
  const defaultNetworkingBackendUrlProvider = "https://urls.needle.tools/default-networking-backend/index";
2
2
  let serverUrl: string | undefined = "wss://needle-tiny-starter.glitch.me/socket";
3
3
 
4
+ import * as flatbuffers from 'flatbuffers';
4
5
  import { type Websocket } from 'websocket-ts';
5
- // import { Networking } from '../engine-components/Networking.js';
6
- import { Context } from './engine_setup.js';
7
- import * as utils from "./engine_utils.js";
8
- import * as flatbuffers from 'flatbuffers';
6
+
9
7
  import * as schemes from "../engine-schemes/schemes.js";
8
+ import { isDevEnvironment } from './debug/debug.js';
10
9
  import { PeerNetworking } from './engine_networking_peer.js';
11
10
  import { type IModel, type INetworkConnection, SendQueue } from './engine_networking_types.js';
12
11
  import { isHostedOnGlitch } from './engine_networking_utils.js';
13
- import { isDevEnvironment } from './debug/debug.js';
12
+ // import { Networking } from '../engine-components/Networking.js';
13
+ import { Context } from './engine_setup.js';
14
+ import * as utils from "./engine_utils.js";
14
15
 
15
16
  export const debugNet = utils.getParam("debugnet") ? true : false;
16
17
  export const debugOwner = debugNet || utils.getParam("debugowner") ? true : false;
src/engine/engine_physics_rapier.ts CHANGED
@@ -1,29 +1,29 @@
1
+ import { ActiveCollisionTypes, ActiveEvents, Ball, CoefficientCombineRule, Collider, ColliderDesc, Cuboid, EventQueue, JointData, QueryFilterFlags, Ray, RigidBody, RigidBodyType, ShapeColliderTOI, ShapeType, World } from '@dimforge/rapier3d-compat';
1
2
  import { BufferAttribute, BufferGeometry, LineBasicMaterial, LineSegments, Matrix4, Mesh, Object3D, Quaternion, Vector3 } from 'three'
2
3
  import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js'
3
- import { CircularBuffer, getParam } from "./engine_utils.js"
4
+
5
+ import { CollisionDetectionMode, type PhysicsMaterial, PhysicsMaterialCombine } from '../engine/engine_physics.types.js';
6
+ import { isDevEnvironment } from './debug/debug.js';
7
+ import { ContextEvent, ContextRegistry } from './engine_context_registry.js';
8
+ import { foreachComponent } from './engine_gameobject.js';
9
+ import { Gizmos } from './engine_gizmos.js';
10
+ import { Mathf } from './engine_math.js';
4
11
  import { getWorldPosition, getWorldQuaternion, getWorldScale, setWorldPositionXYZ, setWorldQuaternionXYZW } from "./engine_three_utils.js"
5
12
  import type {
13
+ IBoxCollider,
14
+ ICollider,
15
+ IComponent,
16
+ IContext,
17
+ IGameObject,
6
18
  IPhysicsEngine,
7
- IComponent,
8
- ICollider,
9
19
  IRigidbody,
20
+ ISphereCollider,
21
+ Vec2,
10
22
  Vec3,
11
- IGameObject,
12
- Vec2,
13
- IContext,
14
- ISphereCollider,
15
- IBoxCollider,
16
23
  } from './engine_types.js';
17
- import { ContactPoint, Collision } from './engine_types.js';
18
- import { foreachComponent } from './engine_gameobject.js';
19
-
20
- import { ActiveCollisionTypes, ActiveEvents, CoefficientCombineRule, Ball, Collider, ColliderDesc, EventQueue, JointData, QueryFilterFlags, RigidBody, RigidBodyType, ShapeColliderTOI, World, Ray, ShapeType, Cuboid } from '@dimforge/rapier3d-compat';
21
- import { CollisionDetectionMode, type PhysicsMaterial, PhysicsMaterialCombine } from '../engine/engine_physics.types.js';
22
- import { Gizmos } from './engine_gizmos.js';
23
- import { Mathf } from './engine_math.js';
24
+ import { Collision,ContactPoint } from './engine_types.js';
24
25
  import { SphereOverlapResult } from './engine_types.js';
25
- import { ContextEvent, ContextRegistry } from './engine_context_registry.js';
26
- import { isDevEnvironment } from './debug/debug.js';
26
+ import { CircularBuffer, getParam } from "./engine_utils.js"
27
27
 
28
28
  const debugPhysics = getParam("debugphysics");
29
29
  const debugColliderPlacement = getParam("debugcolliderplacement");
@@ -994,6 +994,22 @@
994
994
  }
995
995
  this.world.step(this.eventQueue);
996
996
  this._isUpdatingPhysicsWorld = false;
997
+ }
998
+
999
+ public postStep() {
1000
+ if (!this.world) return;
1001
+ if (!this.enabled) return;
1002
+ this._isUpdatingPhysicsWorld = true;
1003
+ this.syncObjects();
1004
+ this._isUpdatingPhysicsWorld = false;
1005
+
1006
+ if (this.eventQueue && !this.collisionHandler) {
1007
+ this.collisionHandler = new PhysicsCollisionHandler(this.world, this.eventQueue);
1008
+ }
1009
+ if (this.collisionHandler) {
1010
+ this.collisionHandler.handleCollisionEvents();
1011
+ this.collisionHandler.update();
1012
+ }
997
1013
  this.updateDebugRendering(this.world);
998
1014
  }
999
1015
 
@@ -1001,7 +1017,7 @@
1001
1017
  if (debugPhysics || debugColliderPlacement || showColliders || this.debugRenderColliders === true) {
1002
1018
  if (!this.lines) {
1003
1019
  const material = new LineBasicMaterial({
1004
- color: 0x227700,
1020
+ color: 0x77dd77,
1005
1021
  fog: false,
1006
1022
  // vertexColors: THREE.VertexColors
1007
1023
  });
@@ -1023,22 +1039,6 @@
1023
1039
  }
1024
1040
  }
1025
1041
 
1026
- public postStep() {
1027
- if (!this.world) return;
1028
- if (!this.enabled) return;
1029
- this._isUpdatingPhysicsWorld = true;
1030
- this.syncObjects();
1031
- this._isUpdatingPhysicsWorld = false;
1032
-
1033
- if (this.eventQueue && !this.collisionHandler) {
1034
- this.collisionHandler = new PhysicsCollisionHandler(this.world, this.eventQueue);
1035
- }
1036
- if (this.collisionHandler) {
1037
- this.collisionHandler.handleCollisionEvents();
1038
- this.collisionHandler.update();
1039
- }
1040
- }
1041
-
1042
1042
  /** sync rendered objects with physics world (except for colliders without rigidbody) */
1043
1043
  private syncObjects() {
1044
1044
  if (debugColliderPlacement) return;
@@ -1075,8 +1075,8 @@
1075
1075
  if (center && center.isVector3) {
1076
1076
  this._tempQuaternion.set(rot.x, rot.y, rot.z, rot.w);
1077
1077
  const offset = this._tempPosition.copy(center).applyQuaternion(this._tempQuaternion);
1078
- // const scale = getWorldScale(obj.gameObject);
1079
- // offset.multiply(scale);
1078
+ const scale = getWorldScale(obj.gameObject);
1079
+ offset.multiply(scale);
1080
1080
  pos.x -= offset.x;
1081
1081
  pos.y -= offset.y;
1082
1082
  pos.z -= offset.z;
@@ -1173,8 +1173,14 @@
1173
1173
  this._tempCenterPos.z = center.z;
1174
1174
  getWorldScale(collider.gameObject, this._tempCenterVec);
1175
1175
  this._tempCenterPos.multiply(this._tempCenterVec);
1176
- const rot = getWorldQuaternion(collider.gameObject, this._tempCenterQuaternion);
1177
- this._tempCenterPos.applyQuaternion(rot);
1176
+ if (!collider.attachedRigidbody)
1177
+ {
1178
+ getWorldQuaternion(collider.gameObject, this._tempCenterQuaternion);
1179
+ this._tempCenterPos.applyQuaternion(this._tempCenterQuaternion);
1180
+ }
1181
+ else {
1182
+ this._tempCenterPos.applyQuaternion(collider.gameObject.quaternion);
1183
+ }
1178
1184
  targetVector.x += this._tempCenterPos.x;
1179
1185
  targetVector.y += this._tempCenterPos.y;
1180
1186
  targetVector.z += this._tempCenterPos.z;
src/engine/engine_physics.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Box3, Camera, type Intersection, Layers, Mesh, Object3D, Ray, Raycaster, Sphere, Vector2, Vector3, AxesHelper, Line } from 'three'
1
+ import { AxesHelper, Box3, Camera, type Intersection, Layers, Line,Mesh, Object3D, Ray, Raycaster, Sphere, Vector2, Vector3 } from 'three'
2
+
3
+ import { Gizmos } from './engine_gizmos.js';
2
4
  import { Context } from './engine_setup.js';
3
- import { getParam } from "./engine_utils.js"
4
5
  import { getWorldPosition } from "./engine_three_utils.js"
5
6
  import type { Vec2, Vec3, } from './engine_types.js';
6
7
  import type { IPhysicsEngine } from './engine_types.js';
7
- import { Gizmos } from './engine_gizmos.js';
8
+ import { getParam } from "./engine_utils.js"
8
9
 
9
10
  const debugPhysics = getParam("debugphysics");
10
11
  const layerMaskHelper: Layers = new Layers();
src/engine/engine_playerview.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { getParam } from "./engine_utils.js";
2
1
  import { Object3D } from "three";
2
+
3
3
  import { Context } from "./engine_setup.js";
4
+ import { getParam } from "./engine_utils.js";
4
5
 
5
6
  const debug = getParam("debugplayerview");
6
7
 
src/engine/engine_scenelighting.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Vector4, EquirectangularReflectionMapping, WebGLCubeRenderTarget, Texture, LightProbe, SphericalHarmonics3, SRGBColorSpace } from "three";
1
+ import { EquirectangularReflectionMapping, LightProbe, SphericalHarmonics3, SRGBColorSpace,Texture, Vector4, WebGLCubeRenderTarget } from "three";
2
+
3
+ import { AssetReference } from "./engine_addressables.js";
2
4
  import { Context } from "./engine_setup.js";
3
- import { SceneLightSettings } from "./extensions/NEEDLE_lighting_settings.js";
4
5
  import { createFlatTexture, createTrilightTexture } from "./engine_shaders.js";
6
+ import { type SourceIdentifier } from "./engine_types.js";
5
7
  import { getParam } from "./engine_utils.js";
6
- import { type SourceIdentifier } from "./engine_types.js";
7
- import { AssetReference } from "./engine_addressables.js";
8
+ import { SceneLightSettings } from "./extensions/NEEDLE_lighting_settings.js";
8
9
  // import { LightProbeGenerator } from "three/examples/jsm/lights/LightProbeGenerator.js"
9
10
 
10
11
  const debug = getParam("debugenvlight");
src/engine/engine_scenetools.ts CHANGED
@@ -1,17 +1,18 @@
1
- import { Context } from "./engine_setup.js"
1
+ import { Object3D } from "three";
2
2
  import { type GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
3
+
4
+ import { showBalloonMessage } from "./debug/index.js";
5
+ import { getLoader, type INeedleGltfLoader, registerLoader } from "./engine_gltf.js";
6
+ import { createBuiltinComponents, writeBuiltinComponentData } from "./engine_gltf_builtin_components.js";
3
7
  // import * as object from "./engine_gltf_builtin_components.js";
4
8
  import * as loaders from "./engine_loaders.js"
9
+ import { registerPrewarmObject } from "./engine_mainloop_utils.js";
10
+ import { SerializationContext } from "./engine_serialization_core.js";
11
+ import { Context } from "./engine_setup.js"
12
+ import { type SourceIdentifier, type UIDProvider } from "./engine_types.js";
5
13
  import * as utils from "./engine_utils.js";
6
14
  import { registerComponentExtension, registerExtensions } from "./extensions/extensions.js";
7
- import { getLoader, type INeedleGltfLoader, registerLoader } from "./engine_gltf.js";
8
- import { type SourceIdentifier, type UIDProvider } from "./engine_types.js";
9
- import { createBuiltinComponents, writeBuiltinComponentData } from "./engine_gltf_builtin_components.js";
10
- import { SerializationContext } from "./engine_serialization_core.js";
11
15
  import { NEEDLE_components } from "./extensions/NEEDLE_components.js";
12
- import { registerPrewarmObject } from "./engine_mainloop_utils.js";
13
- import { Object3D } from "three";
14
- import { showBalloonMessage } from "./debug/index.js";
15
16
 
16
17
 
17
18
  export class NeedleGltfLoader implements INeedleGltfLoader {
src/engine/engine_serialization_builtin_serializer.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import * as THREE from "three";
2
+ import { Color, CompressedTexture, Object3D, Texture, WebGLRenderTarget } from "three";
3
+
4
+ import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../engine/debug/index.js";
5
+ import { Behaviour, Component, GameObject } from "../engine-components/Component.js";
6
+ import { CallInfo, EventList } from "../engine-components/EventList.js";
2
7
  import { RGBAColor } from "../engine-components/js-extensions/RGBAColor.js";
8
+ import { AssetReference } from "./engine_addressables.js";
9
+ import { debugExtension } from "./engine_default_parameters.js";
3
10
  import { SerializationContext, TypeSerializer } from "./engine_serialization_core.js";
4
- import { Behaviour, Component, GameObject } from "../engine-components/Component.js";
5
- import { debugExtension } from "./engine_default_parameters.js";
6
- import { CallInfo, EventList } from "../engine-components/EventList.js";
7
- import { Color, CompressedTexture, Object3D, Texture, WebGLRenderTarget } from "three";
8
11
  import { RenderTexture } from "./engine_texture.js";
9
- import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../engine/debug/index.js";
10
12
  import { resolveUrl } from "./engine_utils.js";
11
- import { AssetReference } from "./engine_addressables.js";
12
13
 
13
14
  // export class SourcePath {
14
15
  // src?:string
src/engine/engine_serialization_core.ts CHANGED
@@ -1,13 +1,14 @@
1
+ import { AnimationClip, Material, Mesh, Object3D, Texture } from "three";
1
2
  import { type GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
2
- import { getParam } from "./engine_utils.js";
3
- import { AnimationClip, Material, Mesh, Object3D, Texture } from "three";
3
+
4
+ import { debugExtension } from "../engine/engine_default_parameters.js";
5
+ import { addLog,LogType } from "./debug/debug_overlay.js";
6
+ import { isLocalNetwork } from "./engine_networking_utils.js";
4
7
  import { Context } from "./engine_setup.js";
5
- import { isPersistentAsset } from "./extensions/NEEDLE_persistent_assets.js";
6
8
  import { Constructor, type ConstructorConcrete, type SourceIdentifier } from "./engine_types.js";
7
- import { debugExtension } from "../engine/engine_default_parameters.js";
8
- import { LogType, addLog } from "./debug/debug_overlay.js";
9
- import { isLocalNetwork } from "./engine_networking_utils.js";
10
9
  import { $BuiltInTypeFlag } from "./engine_typestore.js";
10
+ import { getParam } from "./engine_utils.js";
11
+ import { isPersistentAsset } from "./extensions/NEEDLE_persistent_assets.js";
11
12
 
12
13
  const debug = getParam("debugserializer");
13
14
 
src/engine/engine_serialization.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { serializeObject, deserializeObject } from "./engine_serialization_core.js";
1
+ import { deserializeObject,serializeObject } from "./engine_serialization_core.js";
2
2
 
3
- export { serializeObject, deserializeObject };
3
+ export { deserializeObject,serializeObject };
4
4
 
5
- export { serializable, serializeable } from "./engine_serialization_decorator.js"
6
-
7
- export * from "./engine_serialization_builtin_serializer.js";
5
+ export * from "./engine_serialization_builtin_serializer.js";
6
+ export { serializable, serializeable } from "./engine_serialization_decorator.js"
src/engine/engine_shaders.ts CHANGED
@@ -1,9 +1,10 @@
1
1
 
2
+ import { Color,DataTexture, FileLoader, RGBAFormat, Vector4 } from "three";
3
+
4
+ import { RGBAColor } from "../engine-components/js-extensions/RGBAColor.js";
2
5
  import * as loader from "./engine_fileloader.js"
6
+ import { Mathf } from "./engine_math.js";
3
7
  import * as SHADERDATA from "./shaders/shaderData.js"
4
- import { Vector4, FileLoader, DataTexture, RGBAFormat, Color } from "three";
5
- import { RGBAColor } from "../engine-components/js-extensions/RGBAColor.js";
6
- import { Mathf } from "./engine_math.js";
7
8
 
8
9
 
9
10
  const white = new Uint8Array(4);
src/engine/engine_texture.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { EffectComposer } from "postprocessing";
1
2
  import { Camera, Mesh, Object3D, Texture, WebGLRenderer, WebGLRenderTarget } from "three";
2
- import { EffectComposer } from "postprocessing";
3
+
3
4
  import { findResourceUsers } from "./engine_assetdatabase.js";
4
5
 
5
6
 
src/engine/engine_three_utils.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import { AnimationAction, Euler, Mesh,Object3D, PerspectiveCamera, PlaneGeometry, Quaternion, Scene, Texture, Uniform, Vector3 } from "three";
2
+ import { ShaderMaterial,WebGLRenderer } from "three";
3
+
1
4
  import { Mathf } from "./engine_math.js"
2
- import { Vector3, Quaternion, Uniform, Texture, AnimationAction, PerspectiveCamera, Object3D, Euler, PlaneGeometry, Scene, Mesh } from "three";
3
- import { WebGLRenderer, ShaderMaterial } from "three";
4
5
  import { CircularBuffer } from "./engine_utils.js";
5
6
 
6
7
 
src/engine/engine_time.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Clock } from 'three'
2
+
3
+ import { type ITime } from './engine_types.js';
2
4
  import { getParam } from './engine_utils.js';
3
- import { type ITime } from './engine_types.js';
4
5
 
5
6
  const timescaleUrl = getParam("timescale");
6
7
  let timeScale = 1;
src/engine/engine_types.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { RenderTexture } from "./engine_texture.js";
2
- import type { Camera, Color, Material, Object3D, Quaternion, Ray, Scene, WebGLRenderer, Mesh } from "three";
1
+ import type { Camera, Color, Material, Mesh,Object3D, Quaternion, Ray, Scene, WebGLRenderer } from "three";
3
2
  import { Vector3 } from "three";
3
+ import { type GLTF as GLTF3 } from "three/examples/jsm/loaders/GLTFLoader.js";
4
+
4
5
  import { RGBAColor } from "../engine-components/js-extensions/RGBAColor.js";
5
6
  import { CollisionDetectionMode, type PhysicsMaterial, RigidbodyConstraints } from "./engine_physics.types.js";
7
+ import { RenderTexture } from "./engine_texture.js";
6
8
  import { CircularBuffer } from "./engine_utils.js";
7
- import { type GLTF as GLTF3 } from "three/examples/jsm/loaders/GLTFLoader.js";
8
9
  import { type INeedleXRSessionEventReceiver } from "./engine_xr.js";
9
10
 
10
11
  export type GLTF = GLTF3 & {
src/engine/engine_util_decorator.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import { Quaternion, Vector2, Vector3, Vector4 } from "three";
2
+
3
+ import { isDevEnvironment, LogType, showBalloonMessage } from "./debug/index.js";
1
4
  import { $isAssigningProperties } from "./engine_serialization_core.js";
2
- import { LogType, isDevEnvironment, showBalloonMessage } from "./debug/index.js";
3
5
  import { type Constructor, type IComponent } from "./engine_types.js";
4
- import { Quaternion, Vector2, Vector3, Vector4 } from "three";
5
6
  import { watchWrite } from "./engine_utils.js";
6
7
 
7
8
 
src/engine/engine_utils_screenshot.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import { Camera,PerspectiveCamera } from "three";
2
+
1
3
  import { ContextRegistry } from "./engine_context_registry.js";
2
4
  import { Context } from "./engine_setup.js";
3
- import { PerspectiveCamera, Camera } from "three";
4
5
 
5
6
  declare type ImageMimeType = "image/webp" | "image/png";
6
7
 
src/engine/engine_utils.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  // use for typesafe interface method calls
2
2
  import { Quaternion, type Vector, Vector2, Vector3, Vector4 } from "three";
3
+
4
+ import { type Context } from "./engine_context.js";
5
+ import { ContextRegistry } from "./engine_context_registry.js";
3
6
  import { type SourceIdentifier } from "./engine_types.js";
4
- import { ContextRegistry } from "./engine_context_registry.js";
5
- import { type Context } from "./engine_context.js";
6
7
 
7
8
  // https://schneidenbach.gitbooks.io/typescript-cookbook/content/nameof-operator.html
8
9
  export const nameofFactory = <T>() => (name: keyof T) => name;
@@ -215,8 +216,8 @@
215
216
  * e.g. `await delay(1000)` will wait for 1 second
216
217
  */
217
218
  export function delay(milliseconds: number): Promise<void> {
218
- return new Promise((res, _) => {
219
- setTimeout(res, milliseconds);
219
+ return new Promise((resolve, _reject) => {
220
+ setTimeout(resolve, milliseconds);
220
221
  });
221
222
  }
222
223
 
@@ -230,12 +231,12 @@
230
231
  if (!context) return Promise.reject("No context");
231
232
 
232
233
  const endFrame = context.time.frameCount + frameCount;
233
- return new Promise((res, rej) => {
234
- if (!context) return rej("No context");
234
+ return new Promise((resolve, reject) => {
235
+ if (!context) return reject("No context");
235
236
  const cb = () => {
236
237
  if (context!.time.frameCount >= endFrame) {
237
238
  context!.pre_update_callbacks.splice(context!.pre_update_callbacks.indexOf(cb), 1);
238
- res();
239
+ resolve();
239
240
  }
240
241
  }
241
242
  context!.pre_update_callbacks.push(cb);
@@ -656,9 +657,9 @@
656
657
  document.head.appendChild(script);
657
658
  }
658
659
 
659
- await new Promise((res, _) => {
660
+ await new Promise((resolve, _reject) => {
660
661
  script.addEventListener("load", () => {
661
- res(true);
662
+ resolve(true);
662
663
  });
663
664
  });
664
665
  }
src/engine/engine.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./engine_hot_reload.js";
2
+ import "./tests/test_utils.js";
2
3
 
4
+ import { RGBAColor } from "../engine-components/js-extensions/RGBAColor.js";
5
+ import * as engine_scenetools from "./engine_scenetools.js";
3
6
  import * as engine_setup from "./engine_setup.js";
4
- import * as engine_scenetools from "./engine_scenetools.js";
5
- import "./tests/test_utils.js";
6
- import { RGBAColor } from "../engine-components/js-extensions/RGBAColor.js";
7
7
 
8
8
  const engine : any = {
9
9
  ...engine_setup,
src/engine-components/ui/EventSystem.ts CHANGED
@@ -1,18 +1,19 @@
1
+ import { Intersection, Object3D } from "three";
2
+
3
+ import { isDevEnvironment, showBalloonMessage } from "../../engine/debug/index.js";
4
+ import { InputEvents, NEPointerEvent, PointerType } from "../../engine/engine_input.js";
5
+ import { Mathf } from "../../engine/engine_math.js";
1
6
  import { RaycastOptions, RaycastTestObjectReturnType } from "../../engine/engine_physics.js";
7
+ import { Context } from "../../engine/engine_setup.js";
8
+ import { IComponent } from "../../engine/engine_types.js";
9
+ import { getParam } from "../../engine/engine_utils.js";
2
10
  import { Behaviour, GameObject } from "../Component.js";
3
- import { Context } from "../../engine/engine_setup.js";
4
- import { type IPointerEventHandler, PointerEventData, hasPointerEventComponent, IPointerUpHandler } from "./PointerEvents.js";
11
+ import { $shadowDomOwner } from "./BaseUIComponent.js";
12
+ import type { ICanvasGroup } from "./Interfaces.js";
13
+ import { hasPointerEventComponent, type IPointerEventHandler, IPointerUpHandler,PointerEventData } from "./PointerEvents.js";
5
14
  import { ObjectRaycaster, Raycaster } from "./Raycaster.js";
6
- import { InputEvents, NEPointerEvent, PointerType } from "../../engine/engine_input.js";
7
- import { Intersection, Object3D } from "three";
8
- import type { ICanvasGroup } from "./Interfaces.js";
9
- import { getParam } from "../../engine/engine_utils.js";
10
15
  import { UIRaycastUtils } from "./RaycastUtils.js";
11
- import { $shadowDomOwner } from "./BaseUIComponent.js";
12
- import { isDevEnvironment, showBalloonMessage } from "../../engine/debug/index.js";
13
- import { Mathf } from "../../engine/engine_math.js";
14
16
  import { isUIObject } from "./Utils.js";
15
- import { IComponent } from "../../engine/engine_types.js";
16
17
 
17
18
  const debug = getParam("debugeventsystem");
18
19
 
src/engine-components/EventTrigger.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { serializable } from "../engine/engine_serialization.js";
2
+ import { Behaviour } from "./Component.js"
2
3
  import { EventList } from "./EventList.js";
4
+ import { EventType } from "./EventType.js"
3
5
  import type { IPointerEventHandler, PointerEventData } from "./ui/PointerEvents.js"
4
- import { Behaviour } from "./Component.js"
5
- import { EventType } from "./EventType.js"
6
6
 
7
7
  class TriggerEvent {
8
8
  @serializable()
src/engine/extensions/EXT_texture_exr.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { getParam } from "../engine_utils.js";
1
+ import { Texture } from "three";
2
2
  import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
3
- import { Texture } from "three";
4
3
  import { type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
5
4
 
5
+ import { getParam } from "../engine_utils.js";
6
6
 
7
+
7
8
  const debug = getParam("debugexr");
8
9
 
9
10
  export class EXT_texture_exr implements GLTFLoaderPlugin {
src/engine/extensions/extension_utils.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { type IExtensionReferenceResolver } from "./extension_resolver.js";
2
1
  import { GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
2
+
3
3
  import { debugExtension } from "../engine_default_parameters.js";
4
4
  import { getParam } from "../engine_utils.js";
5
+ import { type IExtensionReferenceResolver } from "./extension_resolver.js";
5
6
 
6
7
  const debug = getParam("debugresolvedependencies");
7
8
 
src/engine-components/export/usdz/Extension.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { USDObject, USDZExporterContext } from "./ThreeUSDZExporter.js";
2
1
  import { Object3D } from "three";
3
2
 
3
+ import { USDObject, USDZExporterContext } from "./ThreeUSDZExporter.js";
4
+
4
5
  export interface IUSDExporterExtension {
5
6
 
6
7
  get extensionName(): string;
src/engine/extensions/extensions.ts CHANGED
@@ -1,20 +1,21 @@
1
- import { NEEDLE_techniques_webgl } from "./NEEDLE_techniques_webgl.js";
1
+ import { GLTFExporter, GLTFExporterPlugin, GLTFWriter } from "three/examples/jsm/exporters/GLTFExporter.js";
2
2
  import { GLTFLoader, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
3
+
4
+ import { isDevEnvironment } from "../debug/index.js";
5
+ import { isResourceTrackingEnabled } from "../engine_assetdatabase.js";
6
+ import { Context } from "../engine_setup.js";
7
+ import { type ConstructorConcrete, type SourceIdentifier } from "../engine_types.js";
8
+ import { getParam } from "../engine_utils.js";
9
+ import { NEEDLE_lightmaps } from "../extensions/NEEDLE_lightmaps.js";
10
+ import { EXT_texture_exr } from "./EXT_texture_exr.js";
3
11
  import { NEEDLE_components } from "./NEEDLE_components.js";
4
- import { EXT_texture_exr } from "./EXT_texture_exr.js";
5
12
  import { NEEDLE_gameobject_data } from "./NEEDLE_gameobject_data.js";
13
+ import { NEEDLE_lighting_settings } from "./NEEDLE_lighting_settings.js";
6
14
  import { NEEDLE_persistent_assets } from "./NEEDLE_persistent_assets.js";
7
- import { NEEDLE_lightmaps } from "../extensions/NEEDLE_lightmaps.js";
8
- import { type ConstructorConcrete, type SourceIdentifier } from "../engine_types.js";
9
- import { Context } from "../engine_setup.js";
10
- import { NEEDLE_lighting_settings } from "./NEEDLE_lighting_settings.js";
15
+ import { NEEDLE_progressive } from "./NEEDLE_progressive.js";
11
16
  import { NEEDLE_render_objects } from "./NEEDLE_render_objects.js";
12
- import { NEEDLE_progressive } from "./NEEDLE_progressive.js";
17
+ import { NEEDLE_techniques_webgl } from "./NEEDLE_techniques_webgl.js";
13
18
  import { InternalUsageTrackerPlugin } from "./usage_tracker.js";
14
- import { isResourceTrackingEnabled } from "../engine_assetdatabase.js";
15
- import { getParam } from "../engine_utils.js";
16
- import { isDevEnvironment } from "../debug/index.js";
17
- import { GLTFExporter, GLTFExporterPlugin, GLTFWriter } from "three/examples/jsm/exporters/GLTFExporter.js";
18
19
 
19
20
  const debug = getParam("debugextensions");
20
21
 
src/engine-components/js-extensions/ExtensionUtils.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Object3D } from "three";
2
+
2
3
  import type { Constructor } from "../../engine/engine_types.js";
3
4
 
4
5
  const handlers: Map<any, ApplyPrototypeExtension> = new Map();
src/engine-components/FlyControls.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import { FlyControls as ThreeFlyControls } from "three/examples/jsm/controls/FlyControls.js";
2
+
3
3
  import { Camera } from "./Camera.js";
4
+ import { Behaviour, GameObject } from "./Component.js";
4
5
 
5
6
  export class FlyControls extends Behaviour {
6
7
  private _controls: ThreeFlyControls | null = null;
src/engine-components/Fog.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Behaviour } from "./Component.js";
2
1
  import { Color, Fog as Fog3 } from "three";
2
+
3
3
  import { serializable } from "../engine/engine_serialization.js";
4
+ import { Behaviour } from "./Component.js";
4
5
 
5
6
 
6
7
  export enum FogMode {
src/engine-components/Gizmos.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Behaviour } from "./Component.js";
2
1
  import * as THREE from "three";
2
+ import { BoxHelper, Color } from "three";
3
+
4
+ import * as params from "../engine/engine_default_parameters.js";
3
5
  import * as Gizmos from "../engine/engine_gizmos.js";
4
- import * as params from "../engine/engine_default_parameters.js";
6
+ import { serializable } from "../engine/engine_serialization_decorator.js";
5
7
  import { FrameEvent } from "../engine/engine_setup.js";
6
- import { BoxHelper, Color } from "three";
7
- import { serializable } from "../engine/engine_serialization_decorator.js";
8
+ import { Behaviour } from "./Component.js";
8
9
 
9
10
 
10
11
  export class BoxGizmo extends Behaviour {
src/engine-components/export/gltf/GltfExport.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { Object3D, Vector3 } from "three";
2
+ import { AnimationClip } from "three";
2
3
  import { GLTFExporter, type GLTFExporterOptions } from 'three/examples/jsm/exporters/GLTFExporter.js';
3
4
 
4
- import { Behaviour, GameObject } from "../../Component.js";
5
- import GLTFMeshGPUInstancingExtension from '../../../include/three/EXT_mesh_gpu_instancing_exporter.js';
6
- import { Renderer } from "../../Renderer.js";
7
5
  import { SerializationContext } from "../../../engine/engine_serialization_core.js";
8
6
  import { serializable } from "../../../engine/engine_serialization_decorator.js";
9
- import { NEEDLE_components } from "../../../engine/extensions/NEEDLE_components.js";
10
7
  import { getWorldPosition } from "../../../engine/engine_three_utils.js";
11
- import { BoxHelperComponent } from "../../BoxHelperComponent.js";
12
- import { AnimationClip } from "three";
13
8
  import { getParam } from "../../../engine/engine_utils.js";
14
9
  import { registerExportExtensions } from "../../../engine/extensions/index.js";
10
+ import { NEEDLE_components } from "../../../engine/extensions/NEEDLE_components.js";
11
+ import GLTFMeshGPUInstancingExtension from '../../../include/three/EXT_mesh_gpu_instancing_exporter.js';
12
+ import { BoxHelperComponent } from "../../BoxHelperComponent.js";
13
+ import { Behaviour, GameObject } from "../../Component.js";
14
+ import { Renderer } from "../../Renderer.js";
15
15
 
16
16
  const debugExport = getParam("debuggltfexport");
17
17
 
src/engine-components/ui/Graphic.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { type IGraphic, type IRectTransformChangedReceiver } from './Interfaces.js';
1
+ import { Color, LinearSRGBColorSpace, Object3D, SRGBColorSpace, Texture } from 'three';
2
2
  import * as ThreeMeshUI from 'three-mesh-ui'
3
+ import SimpleStateBehavior from "three-mesh-ui/examples/behaviors/states/SimpleStateBehavior.js"
4
+
5
+ import { serializable } from '../../engine/engine_serialization_decorator.js';
6
+ import { GameObject } from '../Component.js';
3
7
  import { RGBAColor } from "../js-extensions/RGBAColor.js"
4
8
  import { BaseUIComponent } from "./BaseUIComponent.js";
5
- import { serializable } from '../../engine/engine_serialization_decorator.js';
6
- import { Color, LinearSRGBColorSpace, Object3D, SRGBColorSpace, Texture } from 'three';
9
+ import { type IGraphic, type IRectTransformChangedReceiver } from './Interfaces.js';
10
+ import { Outline } from './Outline.js';
7
11
  import { RectTransform } from './RectTransform.js';
8
12
  import { onChange, scheduleAction } from "./Utils.js"
9
- import { GameObject } from '../Component.js';
10
- import SimpleStateBehavior from "three-mesh-ui/examples/behaviors/states/SimpleStateBehavior.js"
11
- import { Outline } from './Outline.js';
12
13
 
13
14
  const _colorStateObject: { backgroundColor: Color, backgroundOpacity: number, borderColor: Color, borderOpacity: number } = {
14
15
  backgroundColor: new Color(1, 1, 1),
src/engine-components/GridHelper.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Behaviour } from "./Component.js";
2
- import { serializable } from "../engine/engine_serialization_decorator.js";
3
- import * as params from "../engine/engine_default_parameters.js";
4
1
  import { Color, GridHelper as _GridHelper } from "three";
5
2
 
3
+ import * as params from "../engine/engine_default_parameters.js";
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
5
+ import { Behaviour } from "./Component.js";
6
+
6
7
  export class GridHelper extends Behaviour {
7
8
 
8
9
  @serializable()
src/engine-components/GroundProjection.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Behaviour, GameObject } from "./Component.js";
1
+ import { Texture } from "three";
2
2
  import { GroundedSkybox as GroundProjection } from 'three/examples/jsm/objects/GroundedSkybox.js';
3
+
3
4
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
- import { Watch as Watch, getParam } from "../engine/engine_utils.js";
5
- import { Texture } from "three";
5
+ import { getParam,Watch as Watch } from "../engine/engine_utils.js";
6
+ import { Behaviour, GameObject } from "./Component.js";
6
7
 
7
8
  const debug = getParam("debuggroundprojection");
8
9
 
src/engine-components/ui/Image.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { Color, Texture } from 'three';
2
+
1
3
  import { serializable } from '../../engine/engine_serialization_decorator.js';
2
- import { Color, Texture } from 'three';
3
4
  import { MaskableGraphic } from './Graphic.js';
4
5
 
5
6
 
src/engine-components/export/usdz/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { USDZExporter } from "./USDZExporter.js";
2
- export { USDObject, imageToCanvas } from "./ThreeUSDZExporter.js";
3
- export { type UsdzBehaviour } from "./extensions/behavior/Behaviour.js";
1
+ export { type UsdzBehaviour } from "./extensions/behavior/Behaviour.js";
2
+ export { imageToCanvas,USDObject } from "./ThreeUSDZExporter.js";
3
+ export { USDZExporter } from "./USDZExporter.js";
src/engine-components/postprocessing/index.ts CHANGED
@@ -1,4 +1,4 @@
1
+ export * from "./PostProcessingEffect.js";
2
+ export * from "./PostProcessingHandler.js"
1
3
  export * from "./VolumeParameter.js"
2
- export * from "./PostProcessingHandler.js"
3
- export * from "./PostProcessingEffect.js";
4
4
  export * from "./VolumeProfile.js";
src/engine-components/timeline/index.ts CHANGED
@@ -1,4 +1,4 @@
1
+ export { type ITimelineAnimationCallbacks as ITimelineAnimationOverride } from "./PlayableDirector.js"
1
2
  export * from "./SignalAsset.js"
2
- export * from "./TimelineTracks.js"
3
3
  export * from "./TimelineModels.js"
4
- export { type ITimelineAnimationCallbacks as ITimelineAnimationOverride } from "./PlayableDirector.js"
4
+ export * from "./TimelineTracks.js"
src/engine-components/webxr/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./WebXRPlaneTracking.js";
1
+ export { WebXR as WebXR } from "./WebXR.js";
2
2
  export * from "./WebXRImageTracking.js";
3
- export { WebXR as WebXR } from "./WebXR.js";
3
+ export * from "./WebXRPlaneTracking.js";
src/engine/extensions/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./extensions.js"
2
2
  export * from "./NEEDLE_animator_controller_model.js"
3
+ export { SceneLightSettings } from "./NEEDLE_lighting_settings.js"
3
4
  export * from "./NEEDLE_progressive.js"
4
- export { CustomShader } from "./NEEDLE_techniques_webgl.js"
5
- export { SceneLightSettings } from "./NEEDLE_lighting_settings.js"
5
+ export { CustomShader } from "./NEEDLE_techniques_webgl.js"
src/engine/xr/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from "./XRRig.js";
1
+ export * from "./NeedleXRController.js";
2
2
  export * from "./NeedleXRSession.js";
3
- export * from "./NeedleXRController.js";
4
3
  export * from "./NeedleXRSync.js"
5
4
  export * from "./utils.js"
5
+ export * from "./XRRig.js";
src/engine-components/ui/InputField.ts CHANGED
@@ -1,10 +1,10 @@
1
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
2
+ import { FrameEvent } from "../../engine/engine_setup.js";
3
+ import { getParam, isiOS } from "../../engine/engine_utils.js";
1
4
  import { Behaviour, GameObject } from "../Component.js";
5
+ import { EventList } from "../EventList.js";
2
6
  import { type IPointerEventHandler } from "./PointerEvents.js";
3
- import { FrameEvent } from "../../engine/engine_setup.js";
4
- import { serializable } from "../../engine/engine_serialization_decorator.js";
5
7
  import { Text } from "./Text.js";
6
- import { getParam, isiOS } from "../../engine/engine_utils.js";
7
- import { EventList } from "../EventList.js";
8
8
  import { tryGetUIComponent } from "./Utils.js";
9
9
 
10
10
  const debug = getParam("debuginputfield");
src/engine/xr/internal.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { Matrix4, Object3D, Quaternion, Scene, Vector3 } from 'three';
2
- import { IXRRig } from './XRRig.js';
2
+
3
+ import { CreateWireCube, Gizmos } from '../engine_gizmos.js';
3
4
  import { IGameObject } from '../engine_types.js';
4
5
  import { getParam } from '../engine_utils.js';