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';
5
- import { CreateWireCube, Gizmos } from '../engine_gizmos.js';
6
+ import { IXRRig } from './XRRig.js';
6
7
 
7
8
  export const flipForwardMatrix = new Matrix4().makeRotationY(Math.PI);
8
9
  export const flipForwardQuaternion = new Quaternion().setFromAxisAngle(new Vector3(0, 1, 0), Math.PI);
src/engine-components/Joints.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Vector3 } from "three";
2
+
2
3
  import { serializable } from "../engine/engine_serialization.js";
3
4
  import { Behaviour } from "./Component.js";
4
5
  import { Rigidbody } from "./RigidBody.js";
src/engine-components/ui/Layout.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { type ILayoutGroup, type IRectTransform } from "./Interfaces.js";
1
+ import { serializable } from "../../engine/engine_serialization.js";
2
+ import { getParam } from "../../engine/engine_utils.js";
2
3
  import { Behaviour, GameObject } from "../Component.js";
3
- import { serializable } from "../../engine/engine_serialization.js";
4
4
  import { Canvas } from "./Canvas.js";
5
+ import { type ILayoutGroup, type IRectTransform } from "./Interfaces.js";
5
6
  import { RectTransform } from "./RectTransform.js";
6
- import { getParam } from "../../engine/engine_utils.js";
7
7
 
8
8
  const debug = getParam("debuguilayout");
9
9
 
src/engine-components/Light.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import * as THREE from "three";
3
- import { getParam, isMobileDevice } from "../engine/engine_utils.js";
2
+ import { Color, DirectionalLight, OrthographicCamera } from "three";
3
+
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
5
+ import { FrameEvent } from "../engine/engine_setup.js";
4
6
  import { setWorldPositionXYZ } from "../engine/engine_three_utils.js";
5
- import { FrameEvent } from "../engine/engine_setup.js";
6
- import { serializable } from "../engine/engine_serialization_decorator.js";
7
- import { Color, DirectionalLight, OrthographicCamera } from "three";
8
- import { WebARSessionRoot } from "./webxr/WebARSessionRoot.js";
9
7
  import type { ILight } from "../engine/engine_types.js";
8
+ import { getParam, isMobileDevice } from "../engine/engine_utils.js";
10
9
  import { NeedleXREventArgs } from "../engine/xr/index.js";
10
+ import { Behaviour, GameObject } from "./Component.js";
11
+ import { WebARSessionRoot } from "./webxr/WebARSessionRoot.js";
11
12
 
12
13
  // https://threejs.org/examples/webgl_shadowmap_csm.html
13
14
 
src/engine-components/LODGroup.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import * as THREE from "three";
3
- import { Renderer } from "./Renderer.js";
4
- import { getParam } from "../engine/engine_utils.js";
5
- import { serializable } from "../engine/engine_serialization_decorator.js";
6
2
  import { Vector3 } from "three";
7
3
 
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
5
+ import { getParam } from "../engine/engine_utils.js";
6
+ import { Behaviour, GameObject } from "./Component.js";
7
+ import { Renderer } from "./Renderer.js";
8
+
8
9
  const debug = getParam("debuglods");
9
10
  const noLods = getParam("nolods");
10
11
 
src/engine-components/debug/LogStats.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Behaviour } from "../../engine-components/Component.js";
2
1
  import { FrameEvent } from "../../engine/engine_setup.js";
3
2
  import { getParam } from "../../engine/engine_utils.js";
3
+ import { Behaviour } from "../../engine-components/Component.js";
4
4
 
5
5
  const debug = getParam("logstats");
6
6
 
src/engine-components/utils/LookAt.ts CHANGED
@@ -1,11 +1,11 @@
1
+ import { Matrix4, Object3D, Quaternion, Vector3 } from "three";
2
+
1
3
  import { serializable } from "../../engine/engine_serialization.js";
2
- import { Behaviour } from "../Component.js";
3
- import { Matrix4, Object3D, Quaternion, Vector3 } from "three";
4
4
  import { getWorldPosition, getWorldQuaternion, lookAtObject, setWorldQuaternion } from "../../engine/engine_three_utils.js";
5
-
6
- import { USDObject } from "../../engine-components/export/usdz/ThreeUSDZExporter.js";
7
5
  import { type UsdzBehaviour } from "../../engine-components/export/usdz/extensions/behavior/Behaviour.js";
8
6
  import { ActionBuilder, BehaviorModel, TriggerBuilder, USDVec3 } from "../../engine-components/export/usdz/extensions/behavior/BehavioursBuilder.js";
7
+ import { USDObject } from "../../engine-components/export/usdz/ThreeUSDZExporter.js";
8
+ import { Behaviour } from "../Component.js";
9
9
 
10
10
  export class LookAt extends Behaviour implements UsdzBehaviour {
11
11
 
src/engine-components/LookAtConstraint.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import * as THREE from "three";
3
- import { serializable } from "../engine/engine_serialization_decorator.js";
4
2
  import { Object3D } from "three";
5
3
 
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
5
+ import { Behaviour, GameObject } from "./Component.js";
6
+
6
7
  export class LookAtConstraint extends Behaviour {
7
8
 
8
9
  constraintActive: boolean = true;
src/engine/extensions/NEEDLE_animator_controller_model.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import { AnimationAction, AnimationClip, MathUtils, Object3D } from "three"
2
+
3
+ import { InstantiateIdProvider } from "../../engine/engine_networking_instantiate.js";
1
4
  import { Animator } from "../../engine-components/Animator.js";
2
- import { AnimationAction, AnimationClip, MathUtils, Object3D } from "three"
3
5
  import { Context } from "../engine_setup.js";
4
- import { InstantiateIdProvider } from "../../engine/engine_networking_instantiate.js";
5
6
 
6
7
 
7
8
  export declare type AnimatorControllerModel = {
src/engine/extensions/NEEDLE_components.ts CHANGED
@@ -1,12 +1,13 @@
1
+ import { Object3D } from "three";
2
+ import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';
1
3
  import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
4
+
5
+ import { apply } from "../../engine-components/js-extensions/Object3D.js";
6
+ import { builtinComponentKeyName } from "../engine_constants.js";
7
+ import { debugExtension } from "../engine_default_parameters.js";
8
+ import { getLoader } from "../engine_gltf.js";
2
9
  import { type NodeToObjectMap, type ObjectToNodeMap, SerializationContext } from "../engine_serialization_core.js";
3
- import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';
4
- import { debugExtension } from "../engine_default_parameters.js";
5
- import { builtinComponentKeyName } from "../engine_constants.js";
6
10
  import { resolveReferences } from "./extension_utils.js";
7
- import { apply } from "../../engine-components/js-extensions/Object3D.js";
8
- import { getLoader } from "../engine_gltf.js";
9
- import { Object3D } from "three";
10
11
 
11
12
  export const debug = debugExtension
12
13
  const componentsArrayExportKey = "$___Export_Components";
src/engine/extensions/NEEDLE_gameobject_data.ts CHANGED
@@ -39,7 +39,7 @@
39
39
  // }
40
40
 
41
41
  // private lastIndex: number = -1;
42
- afterRoot(_result: GLTF): Promise<void> | null {
42
+ afterRoot(_result: GLTF): Promise<any> | null {
43
43
  // console.log("AFTER ROOT", _result);
44
44
  const promises: Promise<void>[] = [];
45
45
  for (let index = 0; index < this.parser.json.nodes?.length; index++) {
@@ -52,7 +52,7 @@
52
52
  }
53
53
  }
54
54
  }
55
- return Promise.all(promises).then(() => { });
55
+ return Promise.all(promises).then(() => null);
56
56
  }
57
57
 
58
58
  private async findAndApplyExtensionData(nodeId: number, ext: GameObjectData) {
@@ -76,7 +76,7 @@
76
76
  node.userData.static = ext.static ?? false;
77
77
 
78
78
  node.visible = ext.activeSelf ?? true;
79
-
79
+
80
80
  node["guid"] = ext.guid;
81
81
  // console.log(node.name, ext.activeSelf, node);
82
82
  }
src/engine/extensions/NEEDLE_lighting_settings.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import { AmbientLight, Color, HemisphereLight, Object3D } from "three";
2
+ import { LightProbe } from "three";
2
3
  import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
3
- import { type SourceIdentifier } from "../engine_types.js";
4
+
4
5
  import { Behaviour, GameObject } from "../../engine-components/Component.js";
6
+ import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
7
+ import { Mathf } from "../engine_math.js";
5
8
  import { AmbientMode, DefaultReflectionMode } from "../engine_scenelighting.js";
9
+ import { Context } from "../engine_setup.js";
10
+ import { type SourceIdentifier } from "../engine_types.js";
11
+ import { getParam } from "../engine_utils.js";
6
12
  import { LightmapType } from "./NEEDLE_lightmaps.js";
7
- import { getParam } from "../engine_utils.js";
8
- import { Context } from "../engine_setup.js";
9
- import { LightProbe } from "three";
10
- import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
11
- import { Mathf } from "../engine_math.js";
12
13
 
13
14
  export const EXTENSION_NAME = "NEEDLE_lighting_settings";
14
15
  const debug = getParam("debugenvlight");
src/engine/extensions/NEEDLE_lightmaps.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { type ILightDataRegistry } from "../engine_lightdata.js";
2
1
  import { LinearSRGBColorSpace, SRGBColorSpace, Texture, TextureLoader } from "three";
2
+ import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
3
3
  import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
4
+ import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader.js";
5
+
6
+ import { isDevEnvironment } from "../debug/debug.js";
7
+ import { type ILightDataRegistry } from "../engine_lightdata.js";
4
8
  import { type SourceIdentifier } from "../engine_types.js";
9
+ import { getParam, PromiseAllWithErrors, resolveUrl } from "../engine_utils.js";
5
10
  import { resolveReferences } from "./extension_utils.js";
6
- import { getParam, PromiseAllWithErrors, resolveUrl } from "../engine_utils.js";
7
- import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
8
- import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader.js";
9
- import { isDevEnvironment } from "../debug/debug.js";
10
11
 
11
12
  // the lightmap extension is aimed to also export export skyboxes and custom reflection maps
12
13
  // should we rename it?
@@ -60,7 +61,7 @@
60
61
  if (debug)
61
62
  console.log(ext);
62
63
 
63
- return new Promise(async (res, _rej) => {
64
+ return new Promise(async (resolve, _reject) => {
64
65
 
65
66
  const dependencies: Array<Promise<any>> = [];
66
67
  for (const entry of arr) {
@@ -97,7 +98,7 @@
97
98
  if (isDevEnvironment())
98
99
  console.error("Failed to load lightmap extension", results);
99
100
  }
100
- res();
101
+ resolve();
101
102
  });
102
103
  }
103
104
  }
src/engine/extensions/NEEDLE_persistent_assets.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { resolveReferences } from "./extension_utils.js";
2
1
  import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
3
- import { type IExtensionReferenceResolver } from "./extension_resolver.js";
2
+
4
3
  import { debugExtension } from "../engine_default_parameters.js";
5
4
  import { TypeStore } from "../engine_typestore.js";
5
+ import { type IExtensionReferenceResolver } from "./extension_resolver.js";
6
+ import { resolveReferences } from "./extension_utils.js";
6
7
 
7
8
  export const EXTENSION_NAME = "NEEDLE_persistent_assets";
8
9
 
src/engine/extensions/NEEDLE_progressive.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { Material, RawShaderMaterial, Texture, TextureLoader } from "three";
2
2
  import { type GLTF, GLTFLoader, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
3
+
4
+ import { addDracoAndKTX2Loaders } from "../engine_loaders.js";
5
+ import { Context } from "../engine_setup.js";
3
6
  import { type SourceIdentifier } from "../engine_types.js";
4
- import { Context } from "../engine_setup.js";
5
- import { addDracoAndKTX2Loaders } from "../engine_loaders.js";
6
- import { PromiseAllWithErrors, PromiseErrorResult, delay, getParam, resolveUrl } from "../engine_utils.js";
7
+ import { delay, getParam, PromiseAllWithErrors, PromiseErrorResult, resolveUrl } from "../engine_utils.js";
7
8
 
8
9
  export const EXTENSION_NAME = "NEEDLE_progressive";
9
10
 
@@ -132,6 +133,7 @@
132
133
  if (t.source)
133
134
  t.source[$progressiveTextureExtension] = ext;
134
135
  NEEDLE_progressive.cache.set(t.uuid, ext);
136
+ return t;
135
137
  });
136
138
  }
137
139
  }
src/engine/extensions/NEEDLE_render_objects.ts CHANGED
@@ -1,34 +1,34 @@
1
1
 
2
- import { type SourceIdentifier } from "../engine_types.js";
3
- import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
4
- import { type IComponent as Component, type IRenderer } from "../engine_types.js";
5
-
6
2
  import {
7
- // stencil funcs
8
- NeverStencilFunc,
9
- LessStencilFunc,
3
+ AlwaysStencilFunc,
4
+ DecrementStencilOp,
5
+ DecrementWrapStencilOp,
10
6
  EqualStencilFunc,
11
- LessEqualStencilFunc,
7
+ GreaterEqualStencilFunc,
12
8
  GreaterStencilFunc,
13
- NotEqualStencilFunc,
14
- GreaterEqualStencilFunc,
15
- AlwaysStencilFunc,
16
- // stencil ops
17
- ZeroStencilOp,
18
- KeepStencilOp,
19
- ReplaceStencilOp,
20
9
  IncrementStencilOp,
21
- DecrementStencilOp,
22
10
  IncrementWrapStencilOp,
23
- DecrementWrapStencilOp,
24
11
  InvertStencilOp,
12
+ KeepStencilOp,
13
+ LessEqualStencilFunc,
14
+ LessStencilFunc,
15
+ // stencil funcs
16
+ NeverStencilFunc,
17
+ NotEqualStencilFunc,
18
+ ReplaceStencilOp,
25
19
  type StencilFunc,
26
20
  type StencilOp as ThreeStencilOp,
21
+ // stencil ops
22
+ ZeroStencilOp,
27
23
  } from "three";
28
- import { getParam } from "../engine_utils.js";
24
+ import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
25
+
29
26
  import { showBalloonWarning } from "../debug/index.js";
30
27
  import { isUsingInstancing } from "../engine_gameobject.js";
31
28
  import { isLocalNetwork } from "../engine_networking_utils.js";
29
+ import { type SourceIdentifier } from "../engine_types.js";
30
+ import { type IComponent as Component, type IRenderer } from "../engine_types.js";
31
+ import { getParam } from "../engine_utils.js";
32
32
 
33
33
  const debug = getParam("debugstencil");
34
34
 
src/engine/extensions/NEEDLE_techniques_webgl.ts CHANGED
@@ -1,12 +1,13 @@
1
+ import { AlwaysDepth, BackSide, Camera, DoubleSide, EqualDepth, FrontSide, GLSL3, GreaterDepth, GreaterEqualDepth, type IUniform, LessDepth, LessEqualDepth, LinearSRGBColorSpace, Material, Matrix4, NotEqualDepth, Object3D, RawShaderMaterial, Texture, Vector3, Vector4 } from 'three';
1
2
  import { type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
2
- import { FindShaderTechniques, whiteDefaultTexture, ToUnityMatrixArray, SetUnitySphericalHarmonics } from '../engine_shaders.js';
3
- import { AlwaysDepth, BackSide, Camera, DoubleSide, EqualDepth, FrontSide, GLSL3, GreaterDepth, GreaterEqualDepth, type IUniform, LessDepth, LessEqualDepth, LinearSRGBColorSpace, Material, Matrix4, NotEqualDepth, Object3D, RawShaderMaterial, Texture, Vector3, Vector4 } from 'three';
3
+
4
4
  import { Context } from '../engine_setup.js';
5
+ import { FindShaderTechniques, SetUnitySphericalHarmonics,ToUnityMatrixArray, whiteDefaultTexture } from '../engine_shaders.js';
6
+ import { getWorldPosition } from "../engine_three_utils.js";
7
+ import { type SourceIdentifier } from "../engine_types.js";
8
+ import { type ILight } from "../engine_types.js";
5
9
  import { getParam } from "../engine_utils.js";
6
10
  import * as SHADERDATA from "../shaders/shaderData.js"
7
- import { type SourceIdentifier } from "../engine_types.js";
8
- import { type ILight } from "../engine_types.js";
9
- import { getWorldPosition } from "../engine_three_utils.js";
10
11
 
11
12
  const debug = getParam("debugcustomshader");
12
13
 
src/engine/xr/NeedleXRController.ts CHANGED
@@ -1,13 +1,14 @@
1
+ import { fetchProfile,MotionController } from "@webxr-input-profiles/motion-controllers";
1
2
  import { AxesHelper, Int8BufferAttribute, Object3D, Quaternion, Ray, Vector3 } from "three";
2
- import { MotionController, fetchProfile } from "@webxr-input-profiles/motion-controllers";
3
- import type { ButtonName, IGameObject, Vec3, XRControllerButtonName } from "../engine_types.js";
3
+
4
4
  import { Context } from "../engine_context.js";
5
5
  import { Gizmos } from "../engine_gizmos.js";
6
- import { InputEvents, NEPointerEventInit, PointerType, NEPointerEvent, InputEventNames } from "../engine_input.js";
7
- import { getTempVector, getTempQuaternion, getWorldQuaternion } from "../engine_three_utils.js";
6
+ import { InputEventNames,InputEvents, NEPointerEvent, NEPointerEventInit, PointerType } from "../engine_input.js";
7
+ import { getTempQuaternion, getTempVector, getWorldQuaternion } from "../engine_three_utils.js";
8
+ import type { ButtonName, IGameObject, Vec3, XRControllerButtonName } from "../engine_types.js";
9
+ import { getParam } from "../engine_utils.js";
10
+ import { flipForwardMatrix, flipForwardQuaternion } from "./internal.js";
8
11
  import type { NeedleXRHitTestResult, NeedleXRSession } from "./NeedleXRSession.js";
9
- import { flipForwardMatrix, flipForwardQuaternion } from "./internal.js";
10
- import { getParam } from "../engine_utils.js";
11
12
 
12
13
  const debug = getParam("debugwebxr");
13
14
 
@@ -222,7 +223,7 @@
222
223
  profile: this.inputSource.profiles[0],
223
224
  offsetRay: new XRRay(),
224
225
  })?.then(hitTestSource => {
225
- this._hitTestSource = hitTestSource;
226
+ return this._hitTestSource = hitTestSource;
226
227
  });
227
228
  }
228
229
  }
src/engine/xr/NeedleXRSession.ts CHANGED
@@ -1,20 +1,21 @@
1
- import { Mesh, Object3D, PerspectiveCamera, Quaternion, Vector3, PlaneHelper, PlaneGeometry, MeshBasicMaterial, Camera, WebXRArrayCamera, DoubleSide } from "three";
1
+ import { Camera, DoubleSide,Mesh, MeshBasicMaterial, Object3D, PerspectiveCamera, PlaneGeometry, PlaneHelper, Quaternion, Vector3, WebXRArrayCamera } from "three";
2
+
3
+ import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../debug/index.js";
2
4
  import { Context, FrameEvent } from "../engine_context.js";
3
5
  import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
6
+ import { isDestroyed } from "../engine_gameobject.js";
4
7
  import { Gizmos } from "../engine_gizmos.js";
5
- import { getTempVector, getTempQuaternion, getWorldPosition, getWorldQuaternion, getWorldScale, setWorldPosition, setWorldQuaternion, setWorldScale } from "../engine_three_utils.js";
8
+ import { registerFrameEventCallback, unregisterFrameEventCallback } from "../engine_lifecycle_functions_internal.js";
9
+ import { Mathf } from "../engine_math.js";
10
+ import { getTempQuaternion, getTempVector, getWorldPosition, getWorldQuaternion, getWorldScale, setWorldPosition, setWorldQuaternion, setWorldScale } from "../engine_three_utils.js";
11
+ import { ICamera, IComponent, INeedleXRSession } from "../engine_types.js";
12
+ import { delay, getParam, isDesktop, isQuest } from "../engine_utils.js";
13
+ import { flipForwardMatrix, flipForwardQuaternion,ImplictXRRig } from "./internal.js";
6
14
  import { NeedleXRController } from "./NeedleXRController.js";
7
- import type { IXRRig } from "./XRRig.js";
8
- import { ImplictXRRig, flipForwardMatrix, flipForwardQuaternion } from "./internal.js";
9
- import { delay, getParam, isDesktop, isQuest } from "../engine_utils.js";
10
- import { ICamera, IComponent, INeedleXRSession } from "../engine_types.js";
11
15
  import { NeedleXRSync } from "./NeedleXRSync.js";
12
- import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../debug/index.js";
13
- import { registerFrameEventCallback, unregisterFrameEventCallback } from "../engine_lifecycle_functions_internal.js";
14
- import { isDestroyed } from "../engine_gameobject.js";
16
+ import { SceneTransition } from "./SceneTransition.js";
15
17
  import { TemporaryXRContext } from "./TempXRContext.js";
16
- import { Mathf } from "../engine_math.js";
17
- import { SceneTransition } from "./SceneTransition.js";
18
+ import type { IXRRig } from "./XRRig.js";
18
19
 
19
20
  export type NeedleXREventArgs = { xr: NeedleXRSession }
20
21
  export type SessionChangedEvt = (args: NeedleXREventArgs) => void;
@@ -234,7 +235,7 @@
234
235
  navigator.xr.offerSession(mode, {
235
236
  ...init
236
237
  }).then((session) => {
237
- NeedleXRSession.setSession(mode, session, init as XRSessionInit, context);
238
+ return NeedleXRSession.setSession(mode, session, init as XRSessionInit, context);
238
239
  }).catch(_ => {
239
240
  console.log("XRSession offer rejected (perhaps because another call to offerSession was made or a call to requestSession was made)")
240
241
  });
@@ -692,10 +693,10 @@
692
693
 
693
694
  if (extra.init.optionalFeatures?.includes("hit-test") || extra.init.requiredFeatures?.includes("hit-test")) {
694
695
  session.requestReferenceSpace('viewer').then((referenceSpace) => {
695
- session.requestHitTestSource?.call(session, { space: referenceSpace })?.then((source) => {
696
- this._viewerHitTestSource = source;
696
+ return session.requestHitTestSource?.call(session, { space: referenceSpace })?.then((source) => {
697
+ return this._viewerHitTestSource = source;
697
698
  });
698
- })
699
+ }).catch(e => console.warn(e));
699
700
  }
700
701
 
701
702
  if (this.context.mainCamera) {
src/engine/xr/NeedleXRSync.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import type { Context } from "../engine_context.js";
2
+ import { RoomEvents, UserJoinedOrLeftRoomModel } from "../engine_networking.js";
2
3
  import { getParam } from "../engine_utils.js";
3
- import { RoomEvents, UserJoinedOrLeftRoomModel } from "../engine_networking.js";
4
+ import { NeedleXRController } from "./NeedleXRController.js";
4
5
  import { NeedleXRSession } from "./NeedleXRSession.js";
5
- import { NeedleXRController } from "./NeedleXRController.js";
6
6
 
7
7
  const debug = getParam("debugwebxr");
8
8
 
src/engine-components/NestedGltf.ts CHANGED
@@ -1,9 +1,9 @@
1
+ import { AssetReference, type ProgressCallback } from "../engine/engine_addressables.js";
2
+ import { InstantiateOptions } from "../engine/engine_gameobject.js";
3
+ import { InstantiateIdProvider } from "../engine/engine_networking_instantiate.js";
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
1
5
  import { getParam } from "../engine/engine_utils.js";
2
6
  import { Behaviour } from "../engine-components/Component.js";
3
- import { AssetReference, type ProgressCallback } from "../engine/engine_addressables.js";
4
- import { serializable } from "../engine/engine_serialization_decorator.js";
5
- import { InstantiateIdProvider } from "../engine/engine_networking_instantiate.js";
6
- import { InstantiateOptions } from "../engine/engine_gameobject.js";
7
7
 
8
8
  const debug = getParam("debugnestedgltf");
9
9
 
src/engine-components/Networking.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { serializable } from "../engine/engine_serialization.js";
2
1
  import type { INetworkingWebsocketUrlProvider } from "../engine/engine_networking.js";
3
2
  import { isLocalNetwork } from "../engine/engine_networking_utils.js";
3
+ import { serializable } from "../engine/engine_serialization.js";
4
4
  import { getParam } from "../engine/engine_utils.js";
5
5
  import { Behaviour } from "./Component.js";
6
6
 
src/engine-components/js-extensions/Object3D.ts CHANGED
@@ -1,24 +1,23 @@
1
- import { applyPrototypeExtensions, registerPrototypeExtensions } from "./ExtensionUtils.js";
2
1
  import { Object3D, Quaternion, Vector3 } from "three";
3
- import type { Constructor, ConstructorConcrete, IComponent, IComponent as Component } from "../../engine/engine_types.js";
4
- import { moveComponentInstance, addNewComponent, getComponent, getComponentInChildren, getComponentInParent, getComponents, getComponentsInChildren, getComponentsInParent, getOrAddComponent, removeComponent } from "../../engine/engine_components.js";
5
- import { isActiveSelf, setActive, destroy } from "../../engine/engine_gameobject.js";
2
+ import { TransformControlsGizmo } from "three/examples/jsm/controls/TransformControls.js";
3
+
4
+ import { addNewComponent, getComponent, getComponentInChildren, getComponentInParent, getComponents, getComponentsInChildren, getComponentsInParent, getOrAddComponent, moveComponentInstance, removeComponent } from "../../engine/engine_components.js";
5
+ import { destroy,isActiveSelf, setActive } from "../../engine/engine_gameobject.js";
6
6
  import {
7
- setWorldPosition,
7
+ getTempVector,
8
8
  getWorldPosition,
9
- setWorldQuaternion,
10
9
  getWorldQuaternion,
10
+ getWorldRotation,
11
11
  getWorldScale,
12
- setWorldScale,
12
+ setWorldPosition,
13
+ setWorldQuaternion,
13
14
  setWorldRotation,
14
- getWorldRotation,
15
- getTempVector
16
- }
15
+ setWorldScale}
17
16
  from "../../engine/engine_three_utils.js";
17
+ import type { Constructor, ConstructorConcrete, IComponent as Component,IComponent } from "../../engine/engine_types.js";
18
+ import { applyPrototypeExtensions, registerPrototypeExtensions } from "./ExtensionUtils.js";
18
19
 
19
- import { TransformControlsGizmo } from "three/examples/jsm/controls/TransformControls.js";
20
20
 
21
-
22
21
  // used to decorate cloned object3D objects with the same added components defined above
23
22
  export function apply(object: Object3D) {
24
23
  if (object && object.isObject3D === true) {
src/engine-components/OffsetConstraint.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import { Euler, Plane,Quaternion, Vector3 } from "three";
2
+
3
+ import { serializable } from "../engine/engine_serialization_decorator.js";
4
+ import * as utils from "./../engine/engine_three_utils.js";
1
5
  import { Behaviour, GameObject } from "./Component.js";
2
- import * as utils from "./../engine/engine_three_utils.js";
3
- import { Quaternion, Euler, Vector3, Plane } from "three";
4
- import { serializable } from "../engine/engine_serialization_decorator.js";
5
6
 
6
7
  export class OffsetConstraint extends Behaviour {
7
8
 
src/engine-components/utils/OpenURL.ts CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
+ import { isDevEnvironment, showBalloonMessage } from "../../engine/debug/index.js";
3
+ import { serializable } from "../../engine/engine_serialization.js";
4
+ import { isiOS,isSafari } from "../../engine/engine_utils.js";
5
+ import { Behaviour } from "../Component.js";
2
6
  import { type IPointerClickHandler, PointerEventData } from "../ui/index.js";
3
- import { Behaviour } from "../Component.js";
4
- import { serializable } from "../../engine/engine_serialization.js";
5
- import { isDevEnvironment, showBalloonMessage } from "../../engine/debug/index.js";
6
- import { isSafari, isiOS } from "../../engine/engine_utils.js";
7
7
  import { ObjectRaycaster, Raycaster } from "../ui/Raycaster.js";
8
8
  import { tryGetUIComponent } from "../ui/Utils.js";
9
9
 
src/engine-components/OrbitControls.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
- import { Camera } from "./Camera.js";
3
- import { LookAtConstraint } from "./LookAtConstraint.js";
4
- import { getWorldDirection, getWorldPosition, getWorldRotation, setWorldRotation } from "../engine/engine_three_utils.js";
1
+ import { Box3, Box3Helper, GridHelper, Mesh, Object3D, PerspectiveCamera, Ray,ShadowMaterial, Vector2, Vector3 } from "three";
2
+ import { OrbitControls as ThreeOrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
3
+ import { GroundedSkybox } from "three/examples/jsm/objects/GroundedSkybox.js";
4
+
5
+ import { setCameraController, useForAutoFit } from "../engine/engine_camera.js";
6
+ import { Gizmos } from "../engine/engine_gizmos.js";
7
+ import { Mathf } from "../engine/engine_math.js";
5
8
  import { RaycastOptions } from "../engine/engine_physics.js";
6
9
  import { serializable } from "../engine/engine_serialization_decorator.js";
10
+ import { getWorldDirection, getWorldPosition, getWorldRotation, setWorldRotation } from "../engine/engine_three_utils.js";
11
+ import type { ICameraController } from "../engine/engine_types.js";
7
12
  import { getParam, isMobileDevice } from "../engine/engine_utils.js";
8
-
9
- import { Box3, Object3D, PerspectiveCamera, Vector2, Vector3, Box3Helper, GridHelper, Mesh, ShadowMaterial, Ray } from "three";
10
- import { OrbitControls as ThreeOrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
13
+ import { Camera } from "./Camera.js";
14
+ import { Behaviour, GameObject } from "./Component.js";
15
+ import { LookAtConstraint } from "./LookAtConstraint.js";
16
+ import { SyncedTransform } from "./SyncedTransform.js";
11
17
  import { type AfterHandleInputEvent, EventSystem, EventSystemEvents } from "./ui/EventSystem.js";
12
- import type { ICameraController } from "../engine/engine_types.js";
13
- import { setCameraController, useForAutoFit } from "../engine/engine_camera.js";
14
- import { SyncedTransform } from "./SyncedTransform.js";
15
18
  import { tryGetUIComponent } from "./ui/Utils.js";
16
- import { GroundedSkybox } from "three/examples/jsm/objects/GroundedSkybox.js";
17
- import { Mathf } from "../engine/engine_math.js";
18
- import { Gizmos } from "../engine/engine_gizmos.js";
19
19
 
20
20
 
21
21
  const debug = getParam("debugorbit");
src/engine-components/ui/Outline.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { RGBAColor } from "../js-extensions/index.js";
1
+ import { Color, Vector2 } from "three"
2
+
2
3
  import { serializable } from "../../engine/engine_serialization.js";
3
4
  import { Behaviour } from "../Component.js";
4
- import { Color, Vector2 } from "three"
5
+ import { RGBAColor } from "../js-extensions/index.js";
5
6
 
6
7
  export class Outline extends Behaviour {
7
8
 
src/engine-components/ParticleSystem.ts CHANGED
@@ -1,32 +1,31 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import * as THREE from "three";
3
- import { MainModule, EmissionModule, ShapeModule, ParticleSystemShapeType, MinMaxCurve, MinMaxGradient, ColorOverLifetimeModule, SizeOverLifetimeModule, NoiseModule, ParticleSystemSimulationSpace, ParticleBurst, type IParticleSystem, ParticleSystemRenderMode, TrailModule, VelocityOverLifetimeModule, TextureSheetAnimationModule, RotationOverLifetimeModule, LimitVelocityOverLifetimeModule, RotationBySpeedModule, InheritVelocityModule, SizeBySpeedModule, ColorBySpeedModule, ParticleSystemScalingMode } from "./ParticleSystemModules.js"
4
- import { getParam } from "../engine/engine_utils.js";
2
+ import { AxesHelper, BufferGeometry, Color, Material, Matrix4, Mesh, MeshStandardMaterial, Object3D, OneMinusDstAlphaFactor, PlaneGeometry, Quaternion, Sprite, SpriteMaterial, Vector3, Vector4 } from "three";
3
+ import type { BatchedRenderer, Behavior, BehaviorPlugin, BillBoardSettings, BurstParameters, ColorGenerator, EmissionState, EmitSubParticleSystem, EmitterShape, FunctionColorGenerator, FunctionJSON, FunctionValueGenerator, IntervalValue, MeshSettings, Particle, ParticleEmitter, ParticleSystemParameters, PointEmitter, RecordState, RotationGenerator, SizeOverLife, TrailSettings, ValueGenerator,VFXBatchSettings } from "three.quarks";
4
+ import { BatchedParticleRenderer, ConstantColor, ConstantValue, ParticleSystem as _ParticleSystem, RenderMode,TrailBatch, TrailParticle } from "three.quarks";
5
5
 
6
+ import { isDevEnvironment, showBalloonWarning } from "../engine/debug/index.js";
7
+ import { Gizmos } from "../engine/engine_gizmos.js";
8
+ import { Mathf } from "../engine/engine_math.js";
6
9
  // https://github.dev/creativelifeform/three-nebula
7
10
  // import System, { Emitter, Position, Life, SpriteRenderer, Particle, Body, MeshRenderer, } from 'three-nebula.js';
8
-
9
11
  import { serializable } from "../engine/engine_serialization.js";
10
- import { RGBAColor } from "./js-extensions/RGBAColor.js";
11
- import { AxesHelper, BufferGeometry, Color, Material, Matrix4, Mesh, MeshStandardMaterial, Object3D, OneMinusDstAlphaFactor, PlaneGeometry, Quaternion, Sprite, SpriteMaterial, Vector3, Vector4 } from "three";
12
- import { getWorldPosition, getWorldQuaternion, getWorldScale, setWorldScale } from "../engine/engine_three_utils.js";
13
12
  import { assign } from "../engine/engine_serialization_core.js";
14
- import { ParticleSystem as _ParticleSystem, ConstantValue, ConstantColor, BatchedParticleRenderer, TrailBatch, TrailParticle, RenderMode } from "three.quarks";
15
- import type { BatchedRenderer, Behavior, BehaviorPlugin, BillBoardSettings, BurstParameters, ColorGenerator, EmissionState, EmitSubParticleSystem, EmitterShape, FunctionColorGenerator, FunctionJSON, FunctionValueGenerator, IntervalValue, MeshSettings, Particle, ParticleEmitter, ParticleSystemParameters, PointEmitter, RecordState, RotationGenerator, SizeOverLife, TrailSettings, VFXBatchSettings, ValueGenerator } from "three.quarks";
13
+ import { Context } from "../engine/engine_setup.js";
16
14
  import { createFlatTexture } from "../engine/engine_shaders.js";
17
- import { Mathf } from "../engine/engine_math.js";
18
- import { Context } from "../engine/engine_setup.js";
15
+ import { getWorldPosition, getWorldQuaternion, getWorldScale, setWorldScale } from "../engine/engine_three_utils.js";
16
+ import { getParam } from "../engine/engine_utils.js";
17
+ import { NEEDLE_progressive } from "../engine/extensions/NEEDLE_progressive.js";
18
+ import { Behaviour, GameObject } from "./Component.js";
19
+ import { RGBAColor } from "./js-extensions/RGBAColor.js";
20
+ import { ColorBySpeedModule, ColorOverLifetimeModule, EmissionModule, InheritVelocityModule, type IParticleSystem, LimitVelocityOverLifetimeModule, MainModule, MinMaxCurve, MinMaxGradient, NoiseModule, ParticleBurst, ParticleSystemRenderMode, ParticleSystemScalingMode,ParticleSystemShapeType, ParticleSystemSimulationSpace, RotationBySpeedModule, RotationOverLifetimeModule, ShapeModule, SizeBySpeedModule, SizeOverLifetimeModule, TextureSheetAnimationModule, TrailModule, VelocityOverLifetimeModule } from "./ParticleSystemModules.js"
19
21
  import { ParticleSubEmitter } from "./ParticleSystemSubEmitter.js";
20
- import { NEEDLE_progressive } from "../engine/extensions/NEEDLE_progressive.js";
21
- import { Gizmos } from "../engine/engine_gizmos.js";
22
- import { isDevEnvironment, showBalloonWarning } from "../engine/debug/index.js";
23
22
 
24
23
  const debug = getParam("debugparticles");
25
24
  const suppressProgressiveLoading = getParam("noprogressive");
26
25
  const debugProgressiveLoading = getParam("debugprogressive");
27
26
 
28
27
 
29
- export type { Behavior as QParticleBehaviour, Particle as QParticle } from "three.quarks"
28
+ export type { Particle as QParticle,Behavior as QParticleBehaviour } from "three.quarks"
30
29
 
31
30
 
32
31
 
src/engine-components/ParticleSystemModules.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { Matrix4, Object3D, Quaternion, Vector3, Vector2, Euler, Vector4 } from "three";
1
+ import { createNoise4D, type NoiseFunction4D } from 'simplex-noise';
2
+ import { Euler, Matrix4, Object3D, Quaternion, Vector2, Vector3, Vector4 } from "three";
3
+ import type { EmitterShape, Particle, ShapeJSON } from "three.quarks";
4
+
5
+ import { Gizmos } from "../engine/engine_gizmos.js";
2
6
  import { Mathf } from "../engine/engine_math.js";
3
7
  import { serializable } from "../engine/engine_serialization.js";
4
- import { RGBAColor } from "./js-extensions/RGBAColor.js";
5
- import { AnimationCurve } from "./AnimationCurve.js";
8
+ import { Context } from "../engine/engine_setup.js";
6
9
  import type { Vec2, Vec3 } from "../engine/engine_types.js";
7
- import { Context } from "../engine/engine_setup.js";
8
- import type { EmitterShape, Particle, ShapeJSON } from "three.quarks";
9
- import { createNoise4D, type NoiseFunction4D } from 'simplex-noise';
10
- import { Gizmos } from "../engine/engine_gizmos.js";
11
10
  import { getParam } from "../engine/engine_utils.js";
11
+ import { AnimationCurve } from "./AnimationCurve.js";
12
+ import { RGBAColor } from "./js-extensions/RGBAColor.js";
12
13
 
13
14
  const debug = getParam("debugparticles");
14
15
 
src/engine-components/ParticleSystemSubEmitter.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { type Behavior, type Particle, type EmissionState, type ParticleSystem } from "three.quarks";
2
- import { Vector3, Quaternion, Matrix4 } from "three";
3
- import type { IParticleSystem } from "./ParticleSystemModules.js";
1
+ import { Matrix4,Quaternion, Vector3 } from "three";
2
+ import { type Behavior, type EmissionState, type Particle, type ParticleSystem } from "three.quarks";
3
+
4
4
  import { CircularBuffer } from "../engine/engine_utils.js";
5
5
  import { $particleLife, SubEmitterType } from "./ParticleSystem.js";
6
+ import type { IParticleSystem } from "./ParticleSystemModules.js";
6
7
 
7
8
  const VECTOR_ONE = new Vector3(1, 1, 1);
8
9
  const VECTOR_Z = new Vector3(0, 0, 1);
src/engine-components/postprocessing/Effects/Pixelation.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { registerCustomEffectType } from "../VolumeProfile.js";
1
+ import { PixelationEffect as PixelationEffectPP } from "postprocessing";
2
+
3
+ import { serializable } from "../../../engine/engine_serialization.js";
2
4
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
3
- import { PixelationEffect as PixelationEffectPP } from "postprocessing";
4
5
  import { VolumeParameter } from "../VolumeParameter.js";
5
- import { serializable } from "../../../engine/engine_serialization.js";
6
+ import { registerCustomEffectType } from "../VolumeProfile.js";
6
7
 
7
8
  export class PixelationEffect extends PostProcessingEffect {
8
9
  get typeName(): string {
src/engine-components/timeline/PlayableDirector.ts CHANGED
@@ -1,16 +1,17 @@
1
+ import * as THREE from 'three';
2
+ import { Object3D, Quaternion, Vector3 } from 'three';
3
+
4
+ import { FrameEvent } from '../../engine/engine_context.js';
5
+ import { isLocalNetwork } from '../../engine/engine_networking_utils.js';
6
+ import type { GuidsMap } from '../../engine/engine_types.js';
7
+ import { deepClone, delay, getParam } from '../../engine/engine_utils.js';
1
8
  import { Animator } from '../Animator.js';
2
- import { Behaviour, GameObject } from '../Component.js';
3
- import * as THREE from 'three';
4
9
  import { AudioListener } from '../AudioListener.js';
5
10
  import { AudioSource } from '../AudioSource.js';
11
+ import { Behaviour, GameObject } from '../Component.js';
6
12
  import { SignalReceiver } from './SignalAsset.js';
7
13
  import * as Models from "./TimelineModels.js";
8
14
  import * as Tracks from "./TimelineTracks.js";
9
- import { deepClone, delay, getParam } from '../../engine/engine_utils.js';
10
- import type { GuidsMap } from '../../engine/engine_types.js';
11
- import { Object3D, Quaternion, Vector3 } from 'three';
12
- import { isLocalNetwork } from '../../engine/engine_networking_utils.js';
13
- import { FrameEvent } from '../../engine/engine_context.js';
14
15
 
15
16
  const debug = getParam("debugtimeline");
16
17
 
@@ -518,7 +519,7 @@
518
519
  const clipModel = track.clips[i];
519
520
  const animModel = clipModel.asset as Models.AnimationClipModel;
520
521
  if (!animModel) {
521
- console.error("MISSING anim model?", "clip#" + i, clipModel, track, this.playableAsset, this.name);
522
+ console.error(`Timeline ${this.name}: clip #${i} on track \"${track.name}\" has no animation data`);
522
523
  continue;
523
524
  }
524
525
  // console.log(clipModel, track);
src/engine-components/PlayerColor.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { RoomEvents } from "../engine/engine_networking.js";
2
- import { Behaviour, GameObject } from "./Component.js";
3
1
  import * as THREE from "three";
2
+
4
3
  import { WaitForSeconds } from "../engine/engine_coroutine.js";
4
+ import { RoomEvents } from "../engine/engine_networking.js";
5
5
  import { PlayerState } from "../engine-components-experimental/networking/PlayerSync.js";
6
+ import { Behaviour, GameObject } from "./Component.js";
6
7
  import { AvatarMarker } from "./webxr/WebXRAvatar.js";
7
8
 
8
9
 
src/engine-components-experimental/networking/PlayerSync.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { Behaviour, Component, GameObject } from "../../engine-components/Component.js";
1
+ import { Object3D } from "three";
2
+
2
3
  import { AssetReference } from "../../engine/engine_addressables.js";
3
- import { serializable } from "../../engine/engine_serialization_decorator.js";
4
+ import { RoomEvents } from "../../engine/engine_networking.js";
4
5
  import { syncField } from "../../engine/engine_networking_auto.js"
5
- import { RoomEvents } from "../../engine/engine_networking.js";
6
6
  import { syncDestroy } from "../../engine/engine_networking_instantiate.js";
7
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
8
+ import { IGameObject } from "../../engine/engine_types.js";
7
9
  import { delay, getParam } from "../../engine/engine_utils.js";
8
-
9
- import { Object3D } from "three";
10
+ import { Behaviour, Component, GameObject } from "../../engine-components/Component.js";
10
11
  import { EventList } from "../../engine-components/EventList.js";
11
- import { IGameObject } from "../../engine/engine_types.js";
12
12
 
13
13
 
14
14
  const debug = getParam("debugplayersync");
@@ -87,7 +87,7 @@
87
87
  destroyInstance() {
88
88
  this._localInstance?.then(go => {
89
89
  if (debug) console.log("PlayerSync.destroyInstance", go);
90
- GameObject.destroySynced(go);
90
+ return GameObject.destroySynced(go);
91
91
  });
92
92
  this._localInstance = undefined;
93
93
  }
src/engine-components/ui/PointerEvents.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { GameObject } from "../Component.js";
1
+ import { Face, Object3D, Vector3 } from "three";
2
+
2
3
  import { Input, NEPointerEvent } from "../../engine/engine_input.js";
3
- import { Face, Object3D, Vector3 } from "three";
4
4
  import { GamepadButtonName, MouseButtonName } from "../../engine/engine_types.js";
5
+ import { GameObject } from "../Component.js";
5
6
 
6
7
  export interface IInputEventArgs {
7
8
  get used(): boolean;
src/engine-components/postprocessing/PostProcessingEffect.ts CHANGED
@@ -1,10 +1,11 @@
1
+ import { Effect, Pass } from "postprocessing";
2
+
3
+ import type { EditorModification, IEditorModification } from "../../engine/engine_editor-sync.js";
1
4
  import { serializable } from "../../engine/engine_serialization.js";
2
- import { Effect, Pass } from "postprocessing";
3
- import { VolumeParameter } from "./VolumeParameter.js";
4
- import { Component } from "../Component.js";
5
5
  import type { ISerializable, SerializationContext } from "../../engine/engine_serialization_core.js";
6
- import type { EditorModification, IEditorModification } from "../../engine/engine_editor-sync.js";
7
6
  import { getParam } from "../../engine/engine_utils.js";
7
+ import { Component } from "../Component.js";
8
+ import { VolumeParameter } from "./VolumeParameter.js";
8
9
 
9
10
  const debug = getParam("debugpost");
10
11
 
src/engine-components/postprocessing/PostProcessingHandler.ts CHANGED
@@ -1,12 +1,13 @@
1
+ import { N8AOPostPass } from "n8ao";
2
+ import { BloomEffect, BrightnessContrastEffect, ChromaticAberrationEffect, DepthDownsamplingPass, DepthOfFieldEffect, Effect, EffectComposer, EffectPass, HueSaturationEffect, NormalPass, Pass, PixelationEffect, RenderPass, SelectiveBloomEffect, SSAOEffect, VignetteEffect } from "postprocessing";
1
3
  import { HalfFloatType } from "three";
4
+
5
+ import { showBalloonWarning } from "../../engine/debug/index.js";
2
6
  import { Context } from "../../engine/engine_setup.js";
7
+ import type { Constructor } from "../../engine/engine_types.js";
3
8
  import { getParam, isMobileDevice } from "../../engine/engine_utils.js";
4
- import { BloomEffect, BrightnessContrastEffect, ChromaticAberrationEffect, DepthDownsamplingPass, DepthOfFieldEffect, Effect, EffectComposer, EffectPass, HueSaturationEffect, NormalPass, Pass, PixelationEffect, RenderPass, SelectiveBloomEffect, SSAOEffect, VignetteEffect } from "postprocessing";
5
- import { showBalloonWarning } from "../../engine/debug/index.js";
6
9
  import { Camera } from "../Camera.js";
7
10
  import { PostProcessingEffect } from "./PostProcessingEffect.js";
8
- import type { Constructor } from "../../engine/engine_types.js";
9
- import { N8AOPostPass } from "n8ao";
10
11
 
11
12
  const debug = getParam("debugpost");
12
13
 
src/engine-components-experimental/Presentation.ts CHANGED
@@ -1,5 +1,5 @@
1
+ import type { KeyCode } from "../engine/engine_input.js";
1
2
  import { Behaviour } from "../engine-components/Component.js";
2
- import type { KeyCode } from "../engine/engine_input.js";
3
3
 
4
4
  export class PresentationMode extends Behaviour {
5
5
 
src/engine-components/ui/Raycaster.ts CHANGED
@@ -1,9 +1,10 @@
1
+ import { SkinnedMesh } from "three";
2
+
3
+ import { IRaycastOptions, RaycastOptions } from "../../engine/engine_physics.js";
1
4
  import { serializable } from "../../engine/engine_serialization.js";
2
- import { IRaycastOptions, RaycastOptions } from "../../engine/engine_physics.js";
5
+ import { NeedleXRSession } from "../../engine/engine_xr.js";
3
6
  import { Behaviour } from "../Component.js";
4
7
  import { EventSystem } from "./EventSystem.js";
5
- import { SkinnedMesh } from "three";
6
- import { NeedleXRSession } from "../../engine/engine_xr.js";
7
8
 
8
9
 
9
10
  /** Derive from this class to create your own custom Raycaster
src/engine-components/ui/RaycastUtils.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import { Object3D } from "three";
2
+
1
3
  import { foreachComponent } from "../../engine/engine_gameobject.js";
2
4
  import { type IComponent } from "../../engine/engine_types.js";
3
5
  import { $shadowDomOwner } from "./BaseUIComponent.js";
4
6
  import { type ICanvasGroup, type IGraphic } from "./Interfaces.js";
5
- import { Object3D } from "three";
6
7
 
7
8
 
8
9
  export class UIRaycastUtils {
src/engine-components/ui/RectTransform.ts CHANGED
@@ -1,13 +1,14 @@
1
+ import { Matrix4, Object3D, Quaternion, Vector2, Vector3 } from "three";
1
2
  import * as ThreeMeshUI from 'three-mesh-ui'
2
- import { BaseUIComponent } from "./BaseUIComponent.js";
3
3
  import { type DocumentedOptions as ThreeMeshUIEveryOptions } from "three-mesh-ui/build/types/core/elements/MeshUIBaseElement.js";
4
+
5
+ import { foreachComponentEnumerator } from "../../engine/engine_gameobject.js";
4
6
  import { serializable } from "../../engine/engine_serialization_decorator.js";
5
- import { Matrix4, Object3D, Quaternion, Vector2, Vector3 } from "three";
6
7
  import { getParam } from "../../engine/engine_utils.js";
8
+ import { GameObject } from '../Component.js';
9
+ import { BaseUIComponent } from "./BaseUIComponent.js";
10
+ import { type ICanvas, type IRectTransform, type IRectTransformChangedReceiver } from "./Interfaces.js";
7
11
  import { onChange } from "./Utils.js";
8
- import { foreachComponentEnumerator } from "../../engine/engine_gameobject.js";
9
- import { type ICanvas, type IRectTransform, type IRectTransformChangedReceiver } from "./Interfaces.js";
10
- import { GameObject } from '../Component.js';
11
12
 
12
13
  const debug = getParam("debugui");
13
14
  const debugLayout = getParam("debuguilayout");
src/engine-components/ReflectionProbe.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Behaviour } from "./Component.js";
2
1
  import { EquirectangularReflectionMapping, Material, Object3D, SRGBColorSpace, Texture, Vector3 } from "three";
2
+
3
3
  import { serializable } from "../engine/engine_serialization.js";
4
4
  import { Context } from "../engine/engine_setup.js";
5
5
  import type { IRenderer } from "../engine/engine_types.js";
6
+ import { getParam } from "../engine/engine_utils.js";
6
7
  import { BoxHelperComponent } from "./BoxHelperComponent.js";
7
- import { getParam } from "../engine/engine_utils.js";
8
+ import { Behaviour } from "./Component.js";
8
9
 
9
10
  export const debug = getParam("debugreflectionprobe");
10
11
  const disable = getParam("noreflectionprobe");
src/engine/codegen/register_types.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { TypeStore } from "./../engine_typestore.js"
1
+ /* eslint-disable */
2
+ import { TypeStore } from "./../engine_typestore.js"
2
3
 
3
4
  // Import types
4
5
  import { __Ignore } from "../../engine-components/codegen/components.js";
src/engine-components/Renderer.ts CHANGED
@@ -1,21 +1,22 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
1
  import * as THREE from "three";
3
- // import { RendererCustomShader } from "./RendererCustomShader.js";
4
- import { RendererLightmap } from "./RendererLightmap.js";
2
+ import { AxesHelper, Material, Matrix4, Mesh, Object3D, SkinnedMesh, Texture, Vector4 } from "three";
3
+
4
+ import { showBalloonWarning } from "../engine/debug/index.js";
5
+ import { Gizmos } from "../engine/engine_gizmos.js";
6
+ import { $instancingAutoUpdateBounds, $instancingRenderer, InstancingUtil, NEED_UPDATE_INSTANCE_KEY } from "../engine/engine_instancing.js";
7
+ import { isLocalNetwork } from "../engine/engine_networking_utils.js";
8
+ import { serializable } from "../engine/engine_serialization_decorator.js";
5
9
  import { Context, FrameEvent } from "../engine/engine_setup.js";
10
+ import { getTempVector } from "../engine/engine_three_utils.js";
11
+ import type { IRenderer, ISharedMaterials } from "../engine/engine_types.js";
6
12
  import { getParam } from "../engine/engine_utils.js";
7
- import { serializable } from "../engine/engine_serialization_decorator.js";
8
- import { AxesHelper, Material, Matrix4, Mesh, Object3D, SkinnedMesh, Texture, Vector4 } from "three";
13
+ import { NEEDLE_progressive } from "../engine/extensions/NEEDLE_progressive.js";
9
14
  import { NEEDLE_render_objects } from "../engine/extensions/NEEDLE_render_objects.js";
10
- import { NEEDLE_progressive } from "../engine/extensions/NEEDLE_progressive.js";
11
- import { $instancingAutoUpdateBounds, $instancingRenderer, InstancingUtil, NEED_UPDATE_INSTANCE_KEY } from "../engine/engine_instancing.js";
12
- import type { IRenderer, ISharedMaterials } from "../engine/engine_types.js";
15
+ import { setCustomVisibility } from "../engine/js-extensions/Layers.js";
16
+ import { Behaviour, GameObject } from "./Component.js";
13
17
  import { ReflectionProbe } from "./ReflectionProbe.js";
14
- import { setCustomVisibility } from "../engine/js-extensions/Layers.js";
15
- import { isLocalNetwork } from "../engine/engine_networking_utils.js";
16
- import { showBalloonWarning } from "../engine/debug/index.js";
17
- import { Gizmos } from "../engine/engine_gizmos.js";
18
- import { getTempVector } from "../engine/engine_three_utils.js";
18
+ // import { RendererCustomShader } from "./RendererCustomShader.js";
19
+ import { RendererLightmap } from "./RendererLightmap.js";
19
20
 
20
21
  // for staying compatible with old code
21
22
  export { InstancingUtil } from "../engine/engine_instancing.js";
src/engine-components/RendererLightmap.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Material, Mesh, type WebGLProgramParametersWithUniforms, ShaderMaterial, Texture, Vector4 } from "three";
1
+ import { Material, Mesh, ShaderMaterial, Texture, Vector4,type WebGLProgramParametersWithUniforms } from "three";
2
+
2
3
  import type { Context, OnRenderCallback } from "../engine/engine_setup.js";
3
4
  import { getParam } from "../engine/engine_utils.js";
4
5
 
src/engine-components/js-extensions/RGBAColor.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Mathf } from "../../engine/engine_math.js";
2
1
  import { Color } from "three";
3
2
 
3
+ import { Mathf } from "../../engine/engine_math.js";
4
+
4
5
  export class RGBAColor extends Color {
5
6
  alpha: number = 1;
6
7
 
src/engine-components/RigidBody.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Behaviour } from "./Component.js";
2
1
  import * as THREE from 'three'
2
+ import { Matrix4, Object3D, Vector3 } from "three";
3
+
4
+ import { CollisionDetectionMode, RigidbodyConstraints } from "../engine/engine_physics.types.js";
5
+ import { serializable } from "../engine/engine_serialization_decorator.js";
6
+ import { Context, FrameEvent } from "../engine/engine_setup.js";
3
7
  import { getWorldPosition } from "../engine/engine_three_utils.js";
4
- import { serializable } from "../engine/engine_serialization_decorator.js";
5
- import { Watch } from "../engine/engine_utils.js";
6
- import { Matrix4, Object3D, Vector3 } from "three";
7
8
  import type { IRigidbody, Vec3 } from "../engine/engine_types.js";
8
- import { CollisionDetectionMode, RigidbodyConstraints } from "../engine/engine_physics.types.js";
9
9
  import { validate } from "../engine/engine_util_decorator.js";
10
- import { Context, FrameEvent } from "../engine/engine_setup.js";
10
+ import { Watch } from "../engine/engine_utils.js";
11
+ import { Behaviour } from "./Component.js";
11
12
 
12
13
  class TransformWatch {
13
14
 
src/engine-components/SceneSwitcher.ts CHANGED
@@ -1,11 +1,12 @@
1
+ import { Object3D } from "three";
2
+
1
3
  import { AssetReference } from "../engine/engine_addressables.js";
4
+ import { registerObservableAttribute } from "../engine/engine_element_extras.js";
2
5
  import { InputEvents } from "../engine/engine_input.js";
3
6
  import { isLocalNetwork } from "../engine/engine_networking_utils.js";
7
+ import { serializable } from "../engine/engine_serialization.js";
4
8
  import { delay, getParam, setParamWithoutReload } from "../engine/engine_utils.js";
5
- import { serializable } from "../engine/engine_serialization.js";
6
9
  import { Behaviour, GameObject } from "./Component.js";
7
- import { registerObservableAttribute } from "../engine/engine_element_extras.js";
8
- import { Object3D } from "three";
9
10
 
10
11
  const debug = getParam("debugsceneswitcher");
11
12
 
src/engine/xr/SceneTransition.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Camera, DoubleSide, Mesh, MeshBasicMaterial, PlaneGeometry } from "three";
2
+
2
3
  import { Mathf } from "../engine_math.js";
3
4
 
4
5
  export class SceneTransition {
src/engine-schemes/schemes.ts CHANGED
@@ -1,7 +1,8 @@
1
1
 
2
2
  import * as flatbuffers from "flatbuffers"
3
+
4
+ import { SyncedTransformModel } from "./synced-transform-model.js";
3
5
  import { Transform } from "./transform.js";
4
- import { SyncedTransformModel } from "./synced-transform-model.js";
5
6
 
6
7
  // registry
7
8
  export const binaryIdentifierCasts : {[key:string] : (bin:flatbuffers.ByteBuffer) => object} = {};
src/engine-components/ScreenCapture.ts CHANGED
@@ -1,12 +1,12 @@
1
+ import { showBalloonWarning } from "../engine/debug/index.js";
2
+ import { RoomEvents } from "../engine/engine_networking.js";
3
+ import { disposeStream, NetworkedStreamEvents,NetworkedStreams, PeerHandle, StreamEndedEvent, StreamReceivedEvent } from "../engine/engine_networking_streams.js";
4
+ import { serializable } from "../engine/engine_serialization.js";
5
+ import { delay, getParam } from "../engine/engine_utils.js";
6
+ import { AudioSource } from "./AudioSource.js";
1
7
  import { Behaviour, GameObject } from "./Component.js";
8
+ import type { IPointerClickHandler, PointerEventData } from "./ui/PointerEvents.js";
2
9
  import { AspectMode, VideoPlayer } from "./VideoPlayer.js";
3
- import { serializable } from "../engine/engine_serialization.js";
4
- import type { IPointerClickHandler, PointerEventData } from "./ui/PointerEvents.js";
5
- import { AudioSource } from "./AudioSource.js";
6
- import { delay, getParam } from "../engine/engine_utils.js";
7
- import { showBalloonWarning } from "../engine/debug/index.js";
8
- import { NetworkedStreams, disposeStream, StreamReceivedEvent, StreamEndedEvent, PeerHandle, NetworkedStreamEvents } from "../engine/engine_networking_streams.js";
9
- import { RoomEvents } from "../engine/engine_networking.js";
10
10
 
11
11
  const debug = getParam("debugscreensharing");
12
12
 
@@ -146,6 +146,7 @@
146
146
  delay(1000).then(() => {
147
147
  if (this.enabled && this.autoConnect && !this.isReceiving && !this.isSending && this.context.connection.isInRoom)
148
148
  this.share()
149
+ return 0;
149
150
  });
150
151
  }
151
152
  }
@@ -181,7 +182,7 @@
181
182
  if (this._activeShareRequest) return this._activeShareRequest;
182
183
  this._activeShareRequest = this.internalShare(opts);
183
184
  return this._activeShareRequest.then(() =>{
184
- this._activeShareRequest = null;
185
+ return this._activeShareRequest = null;
185
186
  })
186
187
  }
187
188
 
src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { BlendFunction, DepthDownsamplingPass, NormalPass, SSAOEffect } from "postprocessing";
2
2
  import { Color, PerspectiveCamera } 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/postprocessing/Effects/ScreenspaceAmbientOcclusionN8.ts CHANGED
@@ -1,10 +1,11 @@
1
+ import { N8AOPostPass } from "n8ao";
1
2
  import { Color, NeverDepth, PerspectiveCamera } from "three";
3
+
2
4
  import { serializable } from "../../../engine/engine_serialization.js";
5
+ import { validate } from "../../../engine/engine_util_decorator.js";
3
6
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
4
7
  import { VolumeParameter } from "../VolumeParameter.js";
5
8
  import { registerCustomEffectType } from "../VolumeProfile.js";
6
- import { N8AOPostPass } from "n8ao";
7
- import { validate } from "../../../engine/engine_util_decorator.js";
8
9
 
9
10
  // https://github.com/N8python/n8ao
10
11
 
src/engine-components/ShadowCatcher.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import { AdditiveBlending, Material, Mesh, MeshBasicMaterial, MeshStandardMaterial,ShadowMaterial } from "three";
2
+
3
+ import { ObjectUtils, PrimitiveType } from "../engine/engine_create_objects.js";
4
+ import { serializable } from "../engine/engine_serialization_decorator.js";
1
5
  import { Behaviour, GameObject } from "./Component.js";
2
6
  import { RGBAColor } from "./js-extensions/RGBAColor.js";
3
- import { ShadowMaterial, AdditiveBlending, Material, MeshBasicMaterial, Mesh, MeshStandardMaterial } from "three";
4
- import { serializable } from "../engine/engine_serialization_decorator.js";
5
- import { ObjectUtils, PrimitiveType } from "../engine/engine_create_objects.js";
6
7
  import { Renderer } from "./Renderer.js";
7
8
 
8
9
  enum ShadowMode {
src/engine-components/timeline/SignalAsset.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { EventList } from "../EventList.js";
2
- import { Behaviour } from "../Component.js";
3
1
  import { serializable } from "../../engine/engine_serialization_decorator.js";
4
2
  import { getParam } from "../../engine/engine_utils.js";
3
+ import { Behaviour } from "../Component.js";
4
+ import { EventList } from "../EventList.js";
5
5
 
6
6
  const debug = getParam("debugsignals")
7
7
 
src/engine-components/Skybox.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { serializable } from "../engine/engine_serialization_decorator.js";
2
- import { Behaviour, GameObject } from "./Component.js";
1
+ import { EquirectangularRefractionMapping, NeverDepth, SRGBColorSpace, sRGBEncoding, Texture, TextureLoader } from "three"
2
+ import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
3
3
  import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js';
4
- import { EXRLoader } from "three/examples/jsm/loaders/EXRLoader.js";
5
- import { EquirectangularRefractionMapping, NeverDepth, SRGBColorSpace, sRGBEncoding, Texture, TextureLoader } from "three"
6
- import { syncField } from "../engine/engine_networking_auto.js";
7
- import { Camera, ClearFlags } from "./Camera.js";
8
- import { PromiseAllWithErrors, addAttributeChangeCallback, getParam, removeAttributeChangeCallback } from "../engine/engine_utils.js";
4
+
5
+ import { disposeObjectResources, setDisposable } from "../engine/engine_assetdatabase.js";
9
6
  import { ContextRegistry } from "../engine/engine_context_registry.js";
10
7
  import { registerObservableAttribute } from "../engine/engine_element_extras.js";
8
+ import { syncField } from "../engine/engine_networking_auto.js";
9
+ import { serializable } from "../engine/engine_serialization_decorator.js";
11
10
  import { type IContext } from "../engine/engine_types.js";
12
- import { disposeObjectResources, setDisposable } from "../engine/engine_assetdatabase.js";
11
+ import { addAttributeChangeCallback, getParam, PromiseAllWithErrors, removeAttributeChangeCallback } from "../engine/engine_utils.js";
12
+ import { Camera, ClearFlags } from "./Camera.js";
13
+ import { Behaviour, GameObject } from "./Component.js";
13
14
 
14
15
  const debug = getParam("debugskybox");
15
16
 
@@ -92,7 +93,7 @@
92
93
  const entry = cache.shift();
93
94
  if (entry) { disposeCachedTexture(entry.texture); }
94
95
  }
95
- texture.then(t => setDisposable(t, false));
96
+ texture.then(t => { return setDisposable(t, false) });
96
97
  cache.push({ src, texture });
97
98
  }
98
99
 
src/engine-components/SmoothFollow.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { Camera } from "./Camera.js";
2
- import { Behaviour, GameObject } from "./Component.js";
3
1
  import * as THREE from "three";
2
+ import { Object3D } from "three";
3
+
4
4
  import { Mathf } from "../engine/engine_math.js";
5
+ import { Axes } from "../engine/engine_physics.types.js";
5
6
  import { serializable } from "../engine/engine_serialization_decorator.js";
6
- import { Object3D } from "three";
7
7
  import { getWorldPosition, getWorldQuaternion } from "../engine/engine_three_utils.js";
8
- import { Axes } from "../engine/engine_physics.types.js";
8
+ import { Camera } from "./Camera.js";
9
+ import { Behaviour, GameObject } from "./Component.js";
9
10
 
10
11
  export class SmoothFollow extends Behaviour {
11
12
 
src/engine-components/ui/SpatialHtml.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as THREE from 'three'
2
2
  import { HTMLMesh } from 'three/examples/jsm/interactive/HTMLMesh.js';
3
3
  import { InteractiveGroup } from 'three/examples/jsm/interactive/InteractiveGroup.js';
4
+
4
5
  import { getWorldEuler, getWorldRotation, setWorldRotationXYZ } from '../../engine/engine_three_utils.js';
5
6
  import { Behaviour } from '../Component.js';
6
7
 
src/engine-components/SpatialTrigger.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { BoxHelper, Layers } from "three";
2
+
3
+ import { serializable } from "../engine/engine_serialization_decorator.js";
4
+ import { getParam } from "../engine/engine_utils.js";
5
+ import { BoxHelperComponent } from "./BoxHelperComponent.js"
2
6
  import { Behaviour, GameObject } from "./Component.js";
3
- import { BoxHelperComponent } from "./BoxHelperComponent.js"
4
7
  import { EventList } from "./EventList.js";
5
- import { serializable } from "../engine/engine_serialization_decorator.js";
6
- import { getParam } from "../engine/engine_utils.js";
7
8
 
8
9
  const debug = getParam("debugspatialtrigger");
9
10
 
src/engine-components/SpectatorCamera.ts CHANGED
@@ -1,20 +1,21 @@
1
- import { Behaviour, Component, GameObject } from "./Component.js";
2
- import { Camera } from "./Camera.js";
3
1
  import * as THREE from "three";
4
- import { OrbitControls } from "./OrbitControls.js";
5
- import { AvatarMarker } from "./webxr/WebXRAvatar.js";
6
- import { XRStateFlag } from "./webxr/XRFlag.js";
7
- import { SmoothFollow } from "./SmoothFollow.js";
8
2
  import { Object3D } from "three";
3
+
9
4
  import { InputEvents } from "../engine/engine_input.js";
10
- import { Context } from "../engine/engine_setup.js";
11
- import { getParam } from "../engine/engine_utils.js";
12
- import { PlayerView, ViewDevice } from "../engine/engine_playerview.js";
13
- import { RaycastOptions } from "../engine/engine_physics.js";
14
5
  import { RoomEvents } from "../engine/engine_networking.js";
15
- import type { ICamera } from "../engine/engine_types.js";
16
6
  import type { IModel } from "../engine/engine_networking_types.js";
7
+ import { RaycastOptions } from "../engine/engine_physics.js";
8
+ import { PlayerView, ViewDevice } from "../engine/engine_playerview.js";
17
9
  import { serializable } from "../engine/engine_serialization.js";
10
+ import { Context } from "../engine/engine_setup.js";
11
+ import type { ICamera } from "../engine/engine_types.js";
12
+ import { getParam } from "../engine/engine_utils.js";
13
+ import { Camera } from "./Camera.js";
14
+ import { Behaviour, Component, GameObject } from "./Component.js";
15
+ import { OrbitControls } from "./OrbitControls.js";
16
+ import { SmoothFollow } from "./SmoothFollow.js";
17
+ import { AvatarMarker } from "./webxr/WebXRAvatar.js";
18
+ import { XRStateFlag } from "./webxr/XRFlag.js";
18
19
 
19
20
 
20
21
  export enum SpectatorMode {
src/engine-components/SpriteRenderer.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { Behaviour } from "./Component.js";
2
1
  import * as THREE from "three";
2
+ import { Material, NearestFilter, Texture } from "three";
3
+
3
4
  import { serializable, serializeable } from "../engine/engine_serialization_decorator.js";
4
- import { Material, NearestFilter, Texture } from "three";
5
+ import { getParam } from "../engine/engine_utils.js";
6
+ import { Behaviour } from "./Component.js";
5
7
  import { RGBAColor } from "./js-extensions/RGBAColor.js";
6
- import { getParam } from "../engine/engine_utils.js";
7
8
 
8
9
  const debug = getParam("debugspriterenderer");
9
10
  const showWireframe = getParam("wireframe");
src/engine-components/SyncedCamera.ts CHANGED
@@ -1,19 +1,20 @@
1
+ import { Builder } from "flatbuffers";
2
+ import { Object3D } from "three";
3
+
4
+ import { isDevEnvironment } from "../engine/debug/index.js";
5
+ import { AssetReference } from "../engine/engine_addressables.js";
6
+ import { InstantiateOptions } from "../engine/engine_gameobject.js";
7
+ import { InstancingUtil } from "../engine/engine_instancing.js";
1
8
  import { NetworkConnection } from "../engine/engine_networking.js";
2
- import { Behaviour, GameObject } from "./Component.js";
3
- import { Camera } from "./Camera.js";
9
+ import { ViewDevice } from "../engine/engine_playerview.js";
10
+ import { serializable } from "../engine/engine_serialization_decorator.js";
4
11
  import * as utils from "../engine/engine_three_utils.js"
5
- import { Builder } from "flatbuffers";
12
+ import { registerBinaryType } from "../engine-schemes/schemes.js";
6
13
  import { SyncedCameraModel } from "../engine-schemes/synced-camera-model.js";
7
14
  import { Vec3 } from "../engine-schemes/vec3.js";
8
- import { registerBinaryType } from "../engine-schemes/schemes.js";
9
- import { InstancingUtil } from "../engine/engine_instancing.js";
10
- import { serializable } from "../engine/engine_serialization_decorator.js";
11
- import { Object3D } from "three";
15
+ import { Camera } from "./Camera.js";
16
+ import { Behaviour, GameObject } from "./Component.js";
12
17
  import { AvatarMarker } from "./webxr/WebXRAvatar.js";
13
- import { AssetReference } from "../engine/engine_addressables.js";
14
- import { ViewDevice } from "../engine/engine_playerview.js";
15
- import { InstantiateOptions } from "../engine/engine_gameobject.js";
16
- import { isDevEnvironment } from "../engine/debug/index.js";
17
18
 
18
19
  const SyncedCameraModelIdentifier = "SCAM";
19
20
  registerBinaryType(SyncedCameraModelIdentifier, SyncedCameraModel.getRootAsSyncedCameraModel);
src/engine-components/SyncedRoom.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Behaviour } from "./Component.js";
1
+ import { serializable } from "../engine/engine_serialization_decorator.js";
2
2
  import * as utils from "../engine/engine_utils.js"
3
- import { serializable } from "../engine/engine_serialization_decorator.js";
4
3
  import { getParam } from "../engine/engine_utils.js";
4
+ import { Behaviour } from "./Component.js";
5
5
 
6
6
  const viewParamName = "view";
7
7
  const debug = utils.getParam("debugsyncedroom");
src/engine-components/SyncedTransform.ts CHANGED
@@ -1,16 +1,17 @@
1
+ import * as flatbuffers from "flatbuffers";
1
2
  import * as THREE from 'three'
3
+
4
+ import { InstancingUtil } from "../engine/engine_instancing.js";
5
+ import { onUpdate } from '../engine/engine_lifecycle_api.js';
2
6
  import { OwnershipModel, RoomEvents } from "../engine/engine_networking.js"
3
- import { Behaviour, GameObject } from "./Component.js";
4
- import { Rigidbody } from "./RigidBody.js";
7
+ import { sendDestroyed } from '../engine/engine_networking_instantiate.js';
8
+ import { setWorldEuler } from '../engine/engine_three_utils.js';
5
9
  import * as utils from "../engine/engine_utils.js"
6
- import { sendDestroyed } from '../engine/engine_networking_instantiate.js';
7
- import { InstancingUtil } from "../engine/engine_instancing.js";
10
+ import { registerBinaryType } from '../engine-schemes/schemes.js';
8
11
  import { SyncedTransformModel } from '../engine-schemes/synced-transform-model.js';
9
- import * as flatbuffers from "flatbuffers";
10
12
  import { Transform } from '../engine-schemes/transform.js';
11
- import { registerBinaryType } from '../engine-schemes/schemes.js';
12
- import { setWorldEuler } from '../engine/engine_three_utils.js';
13
- import { onUpdate } from '../engine/engine_lifecycle_api.js';
13
+ import { Behaviour, GameObject } from "./Component.js";
14
+ import { Rigidbody } from "./RigidBody.js";
14
15
 
15
16
  const debug = utils.getParam("debugsync");
16
17
  export const SyncedTransformIdentifier = "STRS";
src/engine/xr/TempXRContext.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { AxesHelper, Camera, Color, DirectionalLight, GridHelper, Mesh, MeshBasicMaterial, MeshStandardMaterial, PerspectiveCamera, Scene, WebGLRenderer } from "three";
2
- import { delay } from "../engine_utils.js";
2
+
3
3
  import { ObjectUtils, PrimitiveType } from "../engine_create_objects.js";
4
4
  import { Mathf } from "../engine_math.js";
5
+ import { delay } from "../engine_utils.js";
5
6
 
6
7
  declare type SessionInfo = { session: XRSession, mode: XRSessionMode, init: XRSessionInit };
7
8
 
src/engine/tests/test_utils.ts CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
+ import { noVoip } from "../../engine-components/Voip.js";
2
3
  import * as utils from "../engine_utils.js";
3
- import { noVoip } from "../../engine-components/Voip.js";
4
4
 
5
5
 
6
6
  export function detect_run_tests(){
src/engine-components/TestRunner.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { Behaviour } from "./Component.js";
1
+ import * as flatbuffers from 'flatbuffers';
2
+ import { Vector3 } from "three";
3
+
4
+ import type { IModel } from "../engine/engine_networking_types.js";
2
5
  import * as tests from "../engine/tests/test_utils.js";
3
- import { createTransformModel, SyncedTransform, SyncedTransformIdentifier } from "./SyncedTransform.js";
4
- import * as flatbuffers from 'flatbuffers';
5
6
  import { SyncedTransformModel } from "../engine-schemes/synced-transform-model.js";
7
+ import { Behaviour } from "./Component.js";
6
8
  import { Rigidbody } from "./RigidBody.js";
7
- import { Vector3 } from "three";
8
- import type { IModel } from "../engine/engine_networking_types.js";
9
+ import { createTransformModel, SyncedTransform, SyncedTransformIdentifier } from "./SyncedTransform.js";
9
10
 
10
11
  export class TestRunner extends Behaviour {
11
12
  awake(): void {
src/engine-components/ui/Text.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { Graphic } from './Graphic.js';
1
+ import { Color } from 'three';
2
2
  import * as ThreeMeshUI from 'three-mesh-ui'
3
3
  import type { DocumentedOptions as ThreeMeshUIEveryOptions } from "three-mesh-ui/build/types/core/elements/MeshUIBaseElement.js";
4
- import { Color } from 'three';
5
- import { updateRenderSettings } from './Utils.js';
6
- import { Canvas } from './Canvas.js';
4
+
7
5
  import { serializable } from '../../engine/engine_serialization_decorator.js';
8
6
  import { getParam } from '../../engine/engine_utils.js';
7
+ import { Canvas } from './Canvas.js';
8
+ import { Graphic } from './Graphic.js';
9
9
  import { type ICanvas, type ICanvasEventReceiver, type IHasAlphaFactor } from './Interfaces.js';
10
+ import { updateRenderSettings } from './Utils.js';
10
11
 
11
12
  const debug = getParam("debugtext");
12
13
 
src/engine-components/export/usdz/ThreeUSDZExporter.ts CHANGED
@@ -1,36 +1,37 @@
1
- import { Renderer } from '../../Renderer.js';
2
- import { GameObject } from '../../Component.js';
3
- import type { OffscreenCanvasExt } from '../../../engine/engine_shims.js';
4
1
  import '../../../engine/engine_shims.js';
2
+
5
3
  import {
6
- PlaneGeometry,
7
- Texture,
8
- Uniform,
9
- PerspectiveCamera,
10
- Scene,
11
- Mesh,
12
- ShaderMaterial,
13
- WebGLRenderer,
4
+ AnimationClip,
5
+ Bone,
6
+ BufferAttribute,
7
+ BufferGeometry,
8
+ Color,
9
+ DoubleSide,
10
+ Material,
14
11
  MathUtils,
15
12
  Matrix4,
16
- DoubleSide,
17
- BufferGeometry,
18
- Material,
19
- Color,
13
+ Mesh,
14
+ MeshBasicMaterial,
15
+ MeshPhysicalMaterial,
20
16
  MeshStandardMaterial,
21
- MeshPhysicalMaterial,
22
17
  Object3D,
23
- MeshBasicMaterial,
24
- Bone,
18
+ OrthographicCamera,
19
+ PerspectiveCamera,
20
+ PlaneGeometry,
21
+ Scene,
22
+ ShaderMaterial,
25
23
  SkinnedMesh,
26
24
  SRGBColorSpace,
27
- AnimationClip,
28
- OrthographicCamera,
29
- BufferAttribute,
30
- Vector4
31
- } from 'three';
25
+ Texture,
26
+ Uniform,
27
+ Vector4,
28
+ WebGLRenderer} from 'three';
32
29
  import * as fflate from 'three/examples/jsm/libs/fflate.module.js';
33
30
 
31
+ import type { OffscreenCanvasExt } from '../../../engine/engine_shims.js';
32
+ import { GameObject } from '../../Component.js';
33
+ import { Renderer } from '../../Renderer.js';
34
+
34
35
  function makeNameSafe( str ) {
35
36
  str = str.replace( /[^a-zA-Z0-9_]/g, '' );
36
37
 
@@ -1758,17 +1759,17 @@
1758
1759
  ];
1759
1760
 
1760
1761
  export {
1761
- USDZExporter,
1762
- USDZExporterContext,
1763
- USDWriter,
1764
- USDObject,
1765
1762
  buildMatrix,
1763
+ decompressGpuTexture,
1764
+ findStructuralNodesInBoneHierarchy,
1766
1765
  getBoneName,
1767
1766
  getPathToSkeleton,
1767
+ imageToCanvas,
1768
+ makeNameSafe as makeNameSafeForUSD,
1769
+ USDDocument,
1768
1770
  fn as usdNumberFormatting,
1769
- USDDocument,
1770
- makeNameSafe as makeNameSafeForUSD,
1771
- imageToCanvas,
1772
- decompressGpuTexture,
1773
- findStructuralNodesInBoneHierarchy,
1771
+ USDObject,
1772
+ USDWriter,
1773
+ USDZExporter,
1774
+ USDZExporterContext,
1774
1775
  };
src/engine-components/postprocessing/Effects/TiltShiftEffect.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { registerCustomEffectType } from "../VolumeProfile.js";
1
+ import { KernelSize, TiltShiftEffect as TiltShift } from "postprocessing";
2
+
3
+ import { serializable } from "../../../engine/engine_serialization.js";
2
4
  import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
3
- import { KernelSize, TiltShiftEffect as TiltShift } from "postprocessing";
4
5
  import { VolumeParameter } from "../VolumeParameter.js";
5
- import { serializable } from "../../../engine/engine_serialization.js";
6
+ import { registerCustomEffectType } from "../VolumeProfile.js";
6
7
 
7
8
 
8
9
  export class TiltShiftEffect extends PostProcessingEffect {
src/engine-components/timeline/TimelineTracks.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { PlayableDirector } from "./PlayableDirector.js";
2
- import * as Models from "./TimelineModels.js";
3
- import { GameObject } from "../Component.js";
1
+ import { AnimationAction, AnimationClip, AnimationMixer, Audio, AudioListener, AudioLoader, Euler, Object3D, Quaternion, QuaternionKeyframeTrack, Vector3, VectorKeyframeTrack } from "three";
2
+
3
+ import { isDevEnvironment } from "../../engine/debug/index.js";
4
4
  import { Context } from "../../engine/engine_setup.js";
5
- import { SignalReceiver } from "./SignalAsset.js";
6
- import { Audio, AudioListener, AnimationAction, AnimationClip, AnimationMixer, AudioLoader, Euler, Object3D, Quaternion, QuaternionKeyframeTrack, Vector3, VectorKeyframeTrack } from "three";
7
5
  import { getParam, resolveUrl } from "../../engine/engine_utils.js";
6
+ import { setObjectAnimated } from "../AnimationUtils.js";
7
+ import { Animator } from "../Animator.js"
8
8
  import { AudioSource } from "../AudioSource.js";
9
- import { Animator } from "../Animator.js"
10
- import { setObjectAnimated } from "../AnimationUtils.js";
11
- import { isDevEnvironment } from "../../engine/debug/index.js";
9
+ import { GameObject } from "../Component.js";
10
+ import { PlayableDirector } from "./PlayableDirector.js";
11
+ import { SignalReceiver } from "./SignalAsset.js";
12
+ import * as Models from "./TimelineModels.js";
12
13
 
13
14
  const debug = getParam("debugtimeline");
14
15
 
src/engine-components/postprocessing/Effects/Tonemapping.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ACESFilmicToneMapping, LinearToneMapping, NoToneMapping, ReinhardToneMapping } from "three";
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/TransformGizmo.ts CHANGED
@@ -1,10 +1,11 @@
1
+ import { MathUtils,Mesh } from "three";
2
+ import { TransformControls } from "three/examples/jsm/controls/TransformControls.js";
3
+
4
+ import * as params from "../engine/engine_default_parameters.js";
5
+ import { serializable } from "../engine/engine_serialization_decorator.js";
1
6
  import { Behaviour, GameObject } from "./Component.js";
7
+ import { OrbitControls } from "./OrbitControls.js";
2
8
  import { SyncedTransform } from "./SyncedTransform.js";
3
- import { serializable } from "../engine/engine_serialization_decorator.js";
4
- import * as params from "../engine/engine_default_parameters.js";
5
- import { Mesh, MathUtils } from "three";
6
- import { TransformControls } from "three/examples/jsm/controls/TransformControls.js";
7
- import { OrbitControls } from "./OrbitControls.js";
8
9
 
9
10
  export class TransformGizmo extends Behaviour {
10
11
 
src/engine/extensions/usage_tracker.ts CHANGED
@@ -1,6 +1,7 @@
1
1
 
2
+ import { Mesh, Object3D } from "three";
2
3
  import { type GLTF, type GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js";
3
- import { Mesh, Object3D } from "three";
4
+
4
5
  import { getParam } from "../engine_utils.js";
5
6
 
6
7
 
src/engine-components/export/usdz/USDZExporter.ts CHANGED
@@ -1,23 +1,24 @@
1
+ import { Matrix4,Mesh, Object3D } from "three";
2
+
3
+ import { showBalloonMessage, showBalloonWarning } from "../../../engine/debug/index.js";
4
+ import { hasProLicense } from "../../../engine/engine_license.js";
5
+ import { serializable } from "../../../engine/engine_serialization.js";
6
+ import { Context } from "../../../engine/engine_setup.js";
1
7
  import { delay, getParam, isiOS, isMobileDevice, isSafari } from "../../../engine/engine_utils.js";
2
- import { Object3D, Mesh, Matrix4 } from "three";
3
- import { USDZExporter as ThreeUSDZExporter } from "./ThreeUSDZExporter.js";
4
- import { AnimationExtension } from "./extensions/Animation.js"
5
- import { ensureQuicklookLinkIsCreated } from "./utils/quicklook.js";
6
- import { getFormattedDate } from "./utils/timeutils.js";
7
- import { registerAnimatorsImplictly } from "./utils/animationutils.js";
8
- import type { IUSDExporterExtension } from "./Extension.js";
9
8
  import { Behaviour, GameObject } from "../../Component.js";
10
- import { serializable } from "../../../engine/engine_serialization.js";
11
- import { showBalloonMessage, showBalloonWarning } from "../../../engine/debug/index.js";
12
- import { Context } from "../../../engine/engine_setup.js";
9
+ import { Renderer } from "../../Renderer.js"
13
10
  import { WebARSessionRoot } from "../../webxr/WebARSessionRoot.js";
14
- import { hasProLicense } from "../../../engine/engine_license.js";
11
+ import { XRFlag, XRState, XRStateFlag } from "../../webxr/XRFlag.js";
12
+ import type { IUSDExporterExtension } from "./Extension.js";
13
+ import { AnimationExtension } from "./extensions/Animation.js"
14
+ import { AudioExtension } from "./extensions/behavior/AudioExtension.js";
15
15
  import { BehaviorExtension } from "./extensions/behavior/Behaviour.js";
16
- import { AudioExtension } from "./extensions/behavior/AudioExtension.js";
17
16
  import { TextExtension } from "./extensions/USDZText.js";
18
17
  import { USDZUIExtension } from "./extensions/USDZUI.js";
19
- import { Renderer } from "../../Renderer.js"
20
- import { XRFlag, XRState, XRStateFlag } from "../../webxr/XRFlag.js";
18
+ import { USDZExporter as ThreeUSDZExporter } from "./ThreeUSDZExporter.js";
19
+ import { registerAnimatorsImplictly } from "./utils/animationutils.js";
20
+ import { ensureQuicklookLinkIsCreated } from "./utils/quicklook.js";
21
+ import { getFormattedDate } from "./utils/timeutils.js";
21
22
 
22
23
  const debug = getParam("debugusdz");
23
24
 
src/engine-components/export/usdz/extensions/USDZText.ts CHANGED
@@ -1,11 +1,12 @@
1
+ import { Color, Material, Matrix4, MeshStandardMaterial, Object3D, Vector3 } from "three";
2
+
3
+ import { GameObject } from "../../../Component.js";
4
+ import { RectTransform } from "../../../ui/RectTransform.js";
5
+ import { Text } from "../../../ui/Text.js"
6
+ import { TextAnchor } from "../../../ui/Text.js";
1
7
  import type { IUSDExporterExtension } from "../Extension.js";
2
8
  import type { IBehaviorElement } from "../extensions/behavior/BehavioursBuilder.js";
3
9
  import { USDDocument, USDObject, USDWriter, USDZExporterContext } from "../ThreeUSDZExporter.js";
4
- import { GameObject } from "../../../Component.js";
5
- import { Text } from "../../../ui/Text.js"
6
- import { RectTransform } from "../../../ui/RectTransform.js";
7
- import { Color, Material, Matrix4, MeshStandardMaterial, Object3D, Vector3 } from "three";
8
- import { TextAnchor } from "../../../ui/Text.js";
9
10
 
10
11
 
11
12
  export enum TextWrapMode {
src/engine-components/export/usdz/extensions/USDZUI.ts CHANGED
@@ -1,13 +1,14 @@
1
- import type { IUSDExporterExtension } from "../Extension.js";
2
- import { USDObject, USDZExporterContext } from "../ThreeUSDZExporter.js";
1
+ import { Color, Mesh, MeshBasicMaterial, Object3D } from "three";
2
+
3
3
  import { GameObject } from "../../../Component.js";
4
+ import { $shadowDomOwner } from "../../../ui/BaseUIComponent.js";
4
5
  import { Canvas } from "../../../ui/Canvas.js";
6
+ import { RenderMode } from "../../../ui/Canvas.js";
5
7
  import { CanvasGroup } from "../../../ui/CanvasGroup.js";
6
- import { $shadowDomOwner } from "../../../ui/BaseUIComponent.js";
7
8
  import { RectTransform } from "../../../ui/RectTransform.js";
8
- import { Color, Mesh, MeshBasicMaterial, Object3D } from "three";
9
+ import type { IUSDExporterExtension } from "../Extension.js";
10
+ import { USDObject, USDZExporterContext } from "../ThreeUSDZExporter.js";
9
11
  import { TextExtension } from "./USDZText.js";
10
- import { RenderMode } from "../../../ui/Canvas.js";
11
12
 
12
13
  export class USDZUIExtension implements IUSDExporterExtension {
13
14
  get extensionName(): string {
src/engine-components/ui/Utils.ts CHANGED
@@ -1,9 +1,10 @@
1
1
 
2
- import { FrontSide, DoubleSide, Object3D } from "three"
2
+ import { DoubleSide, FrontSide, Object3D } from "three"
3
+ import ThreeMeshUI from "three-mesh-ui";
4
+
3
5
  import { FrameEvent } from "../../engine/engine_setup.js";
4
6
  import { Behaviour } from "../Component.js";
5
7
  import { $shadowDomOwner, BaseUIComponent } from "./BaseUIComponent.js";
6
- import ThreeMeshUI from "three-mesh-ui";
7
8
 
8
9
  export function tryGetUIComponent(obj: Object3D): BaseUIComponent | null {
9
10
  const owner = obj[$shadowDomOwner];
src/engine/xr/utils.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Object3D } from "three";
2
+
3
+ import { AssetReference } from "../engine_addressables.js";
2
4
  import type { SourceIdentifier } from "../engine_types.js";
3
- import { AssetReference } from "../engine_addressables.js";
4
5
  import { getParam } from "../engine_utils.js";
5
6
 
6
7
  const debug = getParam("debugwebxr");
src/engine-components/js-extensions/Vector.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { applyPrototypeExtensions, registerPrototypeExtensions } from "./ExtensionUtils.js";
2
1
  import { Vector3 } from "three";
2
+
3
3
  import { slerp } from "../../engine/engine_three_utils.js";
4
+ import { applyPrototypeExtensions, registerPrototypeExtensions } from "./ExtensionUtils.js";
4
5
 
5
6
  export function apply(object: Vector3) {
6
7
  if (object && object.isVector3 === true) {
src/engine-components/VideoPlayer.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Behaviour, GameObject } from "./Component.js";
2
- import { serializable } from "../engine/engine_serialization_decorator.js";
3
1
  import { Material, Mesh, Object3D, ShaderMaterial, SRGBColorSpace, sRGBEncoding, Texture, Vector2, Vector4, VideoTexture } from "three";
2
+
3
+ import { isDevEnvironment } from "../engine/debug/index.js";
4
+ import { ObjectUtils, PrimitiveType } from "../engine/engine_create_objects.js";
4
5
  import { awaitInput } from "../engine/engine_input_utils.js";
6
+ import { serializable } from "../engine/engine_serialization_decorator.js";
7
+ import { Context } from "../engine/engine_setup.js";
8
+ import { getWorldScale } from "../engine/engine_three_utils.js";
5
9
  import { getParam } from "../engine/engine_utils.js";
10
+ import { Behaviour, GameObject } from "./Component.js";
6
11
  import { Renderer } from "./Renderer.js";
7
- import { getWorldScale } from "../engine/engine_three_utils.js";
8
- import { ObjectUtils, PrimitiveType } from "../engine/engine_create_objects.js";
9
- import { Context } from "../engine/engine_setup.js";
10
- import { isDevEnvironment } from "../engine/debug/index.js";
11
12
 
12
13
  const debug = getParam("debugvideo");
13
14
 
src/engine-components/postprocessing/Effects/Vignette.ts CHANGED
@@ -1,8 +1,9 @@
1
+ import { VignetteEffect } from "postprocessing";
2
+
1
3
  import { serializable } from "../../../engine/engine_serialization.js";
4
+ import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
2
5
  import { VolumeParameter } from "../VolumeParameter.js";
3
- import { type EffectProviderResult, PostProcessingEffect } from "../PostProcessingEffect.js";
4
6
  import { registerCustomEffectType } from "../VolumeProfile.js";
5
- import { VignetteEffect } from "postprocessing";
6
7
 
7
8
 
8
9
  export class Vignette extends PostProcessingEffect {
src/engine-components/Voip.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { Behaviour } from "./Component.js";
2
- import { StreamEndedEvent, NetworkedStreamEvents, NetworkedStreams, StreamReceivedEvent, disposeStream } from "../engine/engine_networking_streams.js"
1
+ import { AudioAnalyser } from "three";
2
+
3
+ import { isDevEnvironment, showBalloonError, showBalloonWarning } from "../engine/debug/index.js";
4
+ import { RoomEvents } from "../engine/engine_networking.js";
5
+ import { disposeStream,NetworkedStreamEvents, NetworkedStreams, StreamEndedEvent, StreamReceivedEvent } from "../engine/engine_networking_streams.js"
3
6
  import { serializable } from "../engine/engine_serialization_decorator.js";
4
7
  import { getParam, microphonePermissionsGranted } from "../engine/engine_utils.js";
5
- import { RoomEvents } from "../engine/engine_networking.js";
6
8
  import { delay } from "../engine/engine_utils.js";
7
- import { isDevEnvironment, showBalloonError, showBalloonWarning } from "../engine/debug/index.js";
8
- import { AudioAnalyser } from "three";
9
+ import { Behaviour } from "./Component.js";
9
10
 
10
11
  export const noVoip = "noVoip";
11
12
  const debugParam = getParam("debugvoip");
src/engine-components/postprocessing/Volume.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Behaviour } from "../Component.js";
1
+ import { EffectComposer } from "postprocessing";
2
+
3
+ import { isDevEnvironment } from "../../engine/debug/index.js";
4
+ import type { EditorModification, IEditorModification as IEditorModificationReceiver } from "../../engine/engine_editor-sync.js";
2
5
  import { serializeable } from "../../engine/engine_serialization_decorator.js";
3
6
  import { getParam } from "../../engine/engine_utils.js";
4
- import { VolumeProfile } from "./VolumeProfile.js";
5
- import type { EditorModification, IEditorModification as IEditorModificationReceiver } from "../../engine/engine_editor-sync.js";
7
+ import { Behaviour } from "../Component.js";
8
+ import { PostProcessingEffect } from "./PostProcessingEffect.js";
6
9
  import { PostProcessingHandler } from "./PostProcessingHandler.js";
7
- import { PostProcessingEffect } from "./PostProcessingEffect.js";
8
10
  import { VolumeParameter } from "./VolumeParameter.js";
9
- import { isDevEnvironment } from "../../engine/debug/index.js";
10
- import { EffectComposer } from "postprocessing";
11
+ import { VolumeProfile } from "./VolumeProfile.js";
11
12
 
12
13
  const debug = getParam("debugpost");
13
14
 
src/engine-components/webxr/WebARCameraBackground.ts CHANGED
@@ -1,20 +1,21 @@
1
- import { Behaviour } from "../Component.js";
2
- import { serializable } from "../../engine/engine_serialization_decorator.js";
3
- import { RGBAColor } from "../js-extensions/RGBAColor.js"
4
- import { getParam } from "../../engine/engine_utils.js";
5
- import { NeedleXREventArgs } from "../../engine/engine_xr.js";
6
1
  import {
7
- Scene,
8
- Texture,
2
+ DoubleSide,
9
3
  Mesh, MeshBasicMaterial,
10
- UniformsUtils,
4
+ PerspectiveCamera,
11
5
  PlaneGeometry,
6
+ Scene,
12
7
  ShaderLib,
13
8
  ShaderMaterial,
14
- DoubleSide,
15
- PerspectiveCamera,
9
+ Texture,
10
+ UniformsUtils,
16
11
  } from "three";
17
12
 
13
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
14
+ import { getParam } from "../../engine/engine_utils.js";
15
+ import { NeedleXREventArgs } from "../../engine/engine_xr.js";
16
+ import { Behaviour } from "../Component.js";
17
+ import { RGBAColor } from "../js-extensions/RGBAColor.js"
18
+
18
19
  const debug = getParam("debugarcamera");
19
20
 
20
21
  export class WebARCameraBackground extends Behaviour {
src/engine-components/webxr/WebARSessionRoot.ts CHANGED
@@ -1,14 +1,15 @@
1
- import { Behaviour, GameObject } from "../Component.js";
2
1
  import { AxesHelper, DoubleSide, Matrix4, Mesh, MeshBasicMaterial, Object3D, Plane, Quaternion, Raycaster, RingGeometry, Scene, Vector3 } from "three";
2
+
3
+ import { isDevEnvironment, showBalloonWarning } from "../../engine/debug/index.js";
4
+ import { Context } from "../../engine/engine_context.js";
5
+ import { ObjectUtils, PrimitiveType } from "../../engine/engine_create_objects.js";
6
+ import { destroy } from "../../engine/engine_gameobject.js";
7
+ import { NEPointerEvent } from "../../engine/engine_input.js";
3
8
  import { serializable } from "../../engine/engine_serialization_decorator.js";
4
- import { Context } from "../../engine/engine_context.js";
5
9
  import { IComponent, IGameObject } from "../../engine/engine_types.js";
10
+ import { getParam } from "../../engine/engine_utils.js";
6
11
  import { NeedleXRController, NeedleXREventArgs, NeedleXRHitTestResult, NeedleXRSession } from "../../engine/engine_xr.js";
7
- import { NEPointerEvent } from "../../engine/engine_input.js";
8
- import { getParam } from "../../engine/engine_utils.js";
9
- import { destroy } from "../../engine/engine_gameobject.js";
10
- import { isDevEnvironment, showBalloonWarning } from "../../engine/debug/index.js";
11
- import { ObjectUtils, PrimitiveType } from "../../engine/engine_create_objects.js";
12
+ import { Behaviour, GameObject } from "../Component.js";
12
13
 
13
14
  // https://github.com/takahirox/takahirox.github.io/blob/master/js.mmdeditor/examples/js/controls/DeviceOrientationControls.js
14
15
 
src/engine-components/webxr/WebXR.ts CHANGED
@@ -1,18 +1,19 @@
1
- import { Behaviour, GameObject } from "../Component.js";
2
- import { NeedleXREventArgs, NeedleXRSession } from "../../engine/engine_xr.js";
1
+ import { Object3D } from "three";
2
+
3
3
  import { AssetReference } from "../../engine/engine_addressables.js";
4
4
  import { serializable } from "../../engine/engine_serialization.js";
5
- import { Object3D } from "three";
5
+ import { getParam, isDesktop, isiOS,isMobileDevice, isQuest, isSafari } from "../../engine/engine_utils.js";
6
+ import { NeedleXREventArgs, NeedleXRSession } from "../../engine/engine_xr.js";
7
+ import { PlayerSync } from "../../engine-components-experimental/networking/PlayerSync.js";
8
+ import { Behaviour, GameObject } from "../Component.js";
9
+ import { USDZExporter } from "../export/usdz/USDZExporter.js";
10
+ import { SpatialGrabRaycaster } from "../ui/Raycaster.js";
6
11
  import { Avatar } from "./Avatar.js";
7
- import { XRState, XRStateFlag } from "./XRFlag.js";
12
+ import { XRControllerModel } from "./controllers/XRControllerModel.js";
13
+ import { XRControllerMovement } from "./controllers/XRControllerMovement.js";
8
14
  import { WebARSessionRoot } from "./WebARSessionRoot.js";
9
- import { USDZExporter } from "../export/usdz/USDZExporter.js";
10
- import { getParam, isDesktop, isMobileDevice, isQuest, isSafari, isiOS } from "../../engine/engine_utils.js";
11
- import { XRControllerMovement } from "./controllers/XRControllerMovement.js";
12
- import { XRControllerModel } from "./controllers/XRControllerModel.js";
13
- import { PlayerSync } from "../../engine-components-experimental/networking/PlayerSync.js";
14
- import { SpatialGrabRaycaster } from "../ui/Raycaster.js";
15
15
  import { NeedleWebXRHtmlElement } from "./WebXRButtons.js";
16
+ import { XRState, XRStateFlag } from "./XRFlag.js";
16
17
 
17
18
  const debug = getParam("debugwebxr");
18
19
  const debugQuicklook = getParam("debugusdz");
@@ -273,10 +274,8 @@
273
274
  }
274
275
  }
275
276
  // WebXR
276
- else {
277
- if (this.createARButton) this.getButtonsContainer().createARButton();
278
- if (this.createVRButton) this.getButtonsContainer().createVRButton();
279
- }
277
+ if (this.createARButton) this.getButtonsContainer().createARButton();
278
+ if (this.createVRButton) this.getButtonsContainer().createVRButton();
280
279
  }
281
280
 
282
281
  if (this.createSendToQuestButton && !isQuest()) {
src/engine-components/webxr/WebXRAvatar.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Behaviour, GameObject } from "../Component.js";
2
1
  import { Object3D } from "three";
2
+
3
3
  import { getParam } from "../../engine/engine_utils.js";
4
+ import { Behaviour, GameObject } from "../Component.js";
4
5
  import { XRFlag } from "./XRFlag.js";
5
6
 
6
7
  export const debug = getParam("debugavatar");
src/engine-components/webxr/WebXRButtons.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { GameObject } from "../Component.js";
2
- import { NeedleXRSession } from "../../engine/engine_xr.js";
3
- import { USDZExporter } from "../export/usdz/USDZExporter.js";
4
1
  import { isDevEnvironment } from "../../engine/debug/index.js";
5
2
  import { generateQRCode } from "../../engine/engine_utils.js";
6
3
  import { isMozillaXR } from "../../engine/engine_utils.js";
4
+ import { NeedleXRSession } from "../../engine/engine_xr.js";
5
+ import { GameObject } from "../Component.js";
6
+ import { USDZExporter } from "../export/usdz/USDZExporter.js";
7
7
 
8
8
  const webXRElementName = "needle-webxr-buttons";
9
9
 
@@ -23,8 +23,11 @@
23
23
  :host {
24
24
  position: absolute;
25
25
  display: flex;
26
+ flex-wrap: wrap;
27
+ justify-content: center;
26
28
  /** increase z-index (nipplejs has 999 as default) */
27
29
  z-index: 5000;
30
+ width: 100%;
28
31
  bottom: 100px;
29
32
  left: 50%;
30
33
  transform: translateX(-50%);
@@ -34,7 +37,7 @@
34
37
  border: none;
35
38
  color: black;
36
39
  background: rgba(255, 255, 255, 1);
37
- margin: 0 5px;
40
+ margin: 5px 5px;
38
41
  padding: 0.5rem .7rem;
39
42
  font-size: 1rem;
40
43
  white-space: nowrap;
@@ -79,11 +82,12 @@
79
82
  left: 50%;
80
83
  transform: translateX(-50%) translateY(-10px);
81
84
  background-color: white;
82
- padding: 0.8rem;
83
- border-radius: 0.2rem;
85
+ padding: 1.2rem;
86
+ border-radius: 0.4rem;
84
87
  pointer-events: all;
85
88
  opacity: 1;
86
89
  transition: opacity 0.2s ease-in-out;
90
+ box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
87
91
  }
88
92
 
89
93
  :host .qr-code-container img {
@@ -134,10 +138,10 @@
134
138
  this.updateSessionSupported(button, mode);
135
139
  this.listenToXRSessionState(button, mode);
136
140
  this.shadowRoot?.appendChild(button);
137
-
141
+
138
142
  if (!isMozillaXR()) // WebXR Viewer can't attach events before session start
139
143
  navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(button, mode));
140
-
144
+
141
145
  return button;
142
146
  }
143
147
 
@@ -155,11 +159,11 @@
155
159
  this.updateSessionSupported(button, mode);
156
160
  this.listenToXRSessionState(button, mode);
157
161
  this.shadowRoot?.appendChild(button);
158
-
162
+
159
163
  if (!isMozillaXR()) // WebXR Viewer can't attach events before session start
160
164
  navigator.xr?.addEventListener("devicechange", () => this.updateSessionSupported(button, mode));
161
-
162
- return button;
165
+
166
+ return button;
163
167
  }
164
168
 
165
169
  /** @returns the Send to Quest button */
@@ -177,7 +181,7 @@
177
181
  window.open(baseUrl + urlParameter);
178
182
  });
179
183
  // make sure to hide the button when we have VR support directly on the device
180
- if (!isMozillaXR()) {// WebXR Viewer can't attach events before session start
184
+ if (!isMozillaXR()) { // WebXR Viewer can't attach events before session start
181
185
  navigator.xr?.addEventListener("devicechange", () => {
182
186
  if (navigator.xr?.isSessionSupported("immersive-vr")) {
183
187
  button.style.display = "none";
@@ -212,8 +216,8 @@
212
216
  generateAndInsertQRCode();
213
217
  });
214
218
  async function generateAndInsertQRCode() {
215
- const size = 256;
216
- const code = await generateQRCode({
219
+ const size = 200;
220
+ const code = await generateQRCode({
217
221
  text: window.location.href,
218
222
  width: size,
219
223
  height: size,
@@ -229,7 +233,7 @@
229
233
  }
230
234
 
231
235
  private updateSessionSupported(button: HTMLButtonElement, mode: XRSessionMode) {
232
- if(!navigator.xr){
236
+ if (!navigator.xr) {
233
237
  button.style.display = "none";
234
238
  return;
235
239
  }
src/engine-components/webxr/WebXRImageTracking.ts CHANGED
@@ -1,13 +1,13 @@
1
+ import { Object3D, Quaternion, Vector3 } from "three";
2
+
3
+ import { showBalloonMessage, showBalloonWarning } from "../../engine/debug/index.js";
4
+ import { AssetReference } from "../../engine/engine_addressables.js";
1
5
  import { serializable } from "../../engine/engine_serialization.js";
2
- import { Behaviour, GameObject } from "../Component.js";
3
- import { Object3D, Quaternion, Vector3 } from "three";
4
6
  import { CircularBuffer, getParam } from "../../engine/engine_utils.js";
5
- import { AssetReference } from "../../engine/engine_addressables.js";
6
- import { showBalloonMessage, showBalloonWarning } from "../../engine/debug/index.js";
7
-
7
+ import { NeedleXREventArgs, NeedleXRSession } from "../../engine/xr/index.js";
8
+ import { imageToCanvas,USDWriter, USDZExporterContext } from "../../engine-components/export/usdz/ThreeUSDZExporter.js";
8
9
  import { USDZExporter } from "../../engine-components/export/usdz/USDZExporter.js";
9
- import { USDZExporterContext, USDWriter, imageToCanvas } from "../../engine-components/export/usdz/ThreeUSDZExporter.js";
10
- import { NeedleXREventArgs, NeedleXRSession } from "../../engine/xr/index.js";
10
+ import { Behaviour, GameObject } from "../Component.js";
11
11
  import { InstancingUtil, Renderer } from "../Renderer.js";
12
12
 
13
13
  // https://github.com/immersive-web/marker-tracking/blob/main/explainer.md
src/engine-components/webxr/WebXRPlaneTracking.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { Box3, BufferAttribute, BufferGeometry, Group, Material, Matrix4, Mesh, MeshBasicMaterial, MeshNormalMaterial, Object3D, Vector3 } from "three";
2
2
 
3
- import { MeshCollider } from "../Collider.js";
4
- import { Behaviour, GameObject } from "../Component.js";
3
+ import { AssetReference } from "../../engine/engine_addressables.js";
4
+ import { disposeObjectResources } from "../../engine/engine_assetdatabase.js";
5
+ import { destroy } from "../../engine/engine_gameobject.js";
5
6
  import { serializable } from "../../engine/engine_serialization.js";
6
7
  import type { Vec3 } from "../../engine/engine_types.js";
7
- import { disposeObjectResources } from "../../engine/engine_assetdatabase.js";
8
8
  import { getParam } from "../../engine/engine_utils.js";
9
- import { destroy } from "../../engine/engine_gameobject.js";
10
9
  import { NeedleXREventArgs, NeedleXRSession } from "../../engine/engine_xr.js";
11
- import { AssetReference } from "../../engine/engine_addressables.js";
10
+ import { MeshCollider } from "../Collider.js";
11
+ import { Behaviour, GameObject } from "../Component.js";
12
12
  // import { SimplifyModifier } from 'three/examples/jsm/modifiers/SimplifyModifier.js';
13
13
 
14
14
  const debug = getParam("debugplanetracking");
src/engine-components/webxr/WebXRRig.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { AxesHelper, Euler, Object3D, Quaternion, Vector3 } from "three";
2
+
3
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
2
4
  import type { IGameObject } from "../../engine/engine_types.js";
3
5
  import { getParam } from "../../engine/engine_utils.js";
6
+ import { NeedleXREventArgs, NeedleXRSession } from "../../engine/engine_xr.js";
7
+ import { IXRRig } from "../../engine/engine_xr.js";
4
8
  import { Behaviour } from "../Component.js";
5
9
  import { BoxGizmo } from "../Gizmos.js";
6
- import { NeedleXREventArgs, NeedleXRSession } from "../../engine/engine_xr.js";
7
- import { IXRRig } from "../../engine/engine_xr.js";
8
- import { serializable } from "../../engine/engine_serialization_decorator.js";
9
10
 
10
11
  const debug = getParam("debugwebxr");
11
12
 
src/engine-components/webxr/controllers/XRControllerModel.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { Behaviour, GameObject } from "../../Component.js"
1
+ import { AxesHelper, Group, Material, Mesh, Object3D } from "three";
2
+ import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
2
3
  import { XRControllerModelFactory } from "three/examples/jsm/webxr/XRControllerModelFactory.js";
4
+ import { XRHandMeshModel } from "three/examples/jsm/webxr/XRHandMeshModel.js";
5
+
6
+ import { showBalloonWarning } from "../../../engine/debug/index.js";
3
7
  import { AssetReference } from "../../../engine/engine_addressables.js";
4
- import { NeedleXRController, NeedleXRControllerEventArgs, NeedleXREventArgs, NeedleXRSession } from "../../../engine/engine_xr.js";
8
+ import { addDracoAndKTX2Loaders } from "../../../engine/engine_loaders.js";
5
9
  import { serializable } from "../../../engine/engine_serialization_decorator.js";
6
10
  import { IGameObject } from "../../../engine/engine_types.js";
7
- import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
8
- import { addDracoAndKTX2Loaders } from "../../../engine/engine_loaders.js";
9
- import { XRHandMeshModel } from "three/examples/jsm/webxr/XRHandMeshModel.js";
10
- import { AxesHelper, Group, Material, Mesh, Object3D } from "three";
11
11
  import { getParam } from "../../../engine/engine_utils.js";
12
- import { showBalloonWarning } from "../../../engine/debug/index.js";
12
+ import { NeedleXRController, NeedleXRControllerEventArgs, NeedleXREventArgs, NeedleXRSession } from "../../../engine/engine_xr.js";
13
+ import { Behaviour, GameObject } from "../../Component.js"
13
14
 
14
15
  const debug = getParam("debugwebxr");
15
16
 
src/engine-components/webxr/controllers/XRControllerMovement.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { Behaviour, GameObject } from "../../Component.js"
2
1
  import { AdditiveBlending, BufferAttribute, Color, DoubleSide, Line, Line3, Mesh, MeshBasicMaterial, Object3D, RingGeometry, SubtractiveBlending, Vector3 } from "three";
2
+ import { Line2 } from "three/examples/jsm/lines/Line2.js";
3
+ import { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js";
4
+ import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
5
+
6
+ import { Gizmos } from "../../../engine/engine_gizmos.js";
3
7
  import { Mathf } from "../../../engine/engine_math.js";
4
- import { Gizmos } from "../../../engine/engine_gizmos.js";
8
+ import { serializable } from "../../../engine/engine_serialization.js"
9
+ import { getWorldQuaternion, getWorldScale } from "../../../engine/engine_three_utils.js";
10
+ import { IGameObject } from "../../../engine/engine_types.js";
11
+ import { getParam } from "../../../engine/engine_utils.js";
5
12
  import { NeedleXRController, NeedleXREventArgs, NeedleXRSession } from "../../../engine/engine_xr.js";
13
+ import { Behaviour, GameObject } from "../../Component.js"
6
14
  import { TeleportTarget } from "../TeleportTarget.js";
7
15
  import { XRMovementBehaviour } from "../types.js";
8
- import { serializable } from "../../../engine/engine_serialization.js"
9
- import { IGameObject } from "../../../engine/engine_types.js";
10
- import { getWorldQuaternion, getWorldScale } from "../../../engine/engine_three_utils.js";
11
- import { getParam } from "../../../engine/engine_utils.js";
12
16
 
13
- import { Line2 } from "three/examples/jsm/lines/Line2.js";
14
- import { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js";
15
- import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
16
-
17
17
  const debug = getParam("debugwebxr");
18
18
 
19
19
  export class XRControllerMovement extends Behaviour implements XRMovementBehaviour {
src/engine-components/webxr/XRFlag.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import { serializable } from "../../engine/engine_serialization_decorator.js";
2
+ import { getParam } from "../../engine/engine_utils.js";
1
3
  import { Behaviour, GameObject } from "../Component.js";
2
- import { getParam } from "../../engine/engine_utils.js";
3
- import { serializable } from "../../engine/engine_serialization_decorator.js";
4
4
 
5
5
 
6
6
  const debug = getParam("debugxrflags");