@babylonjs/core 5.28.0 → 5.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/Actions/actionManager.js +2 -0
  2. package/Actions/actionManager.js.map +1 -1
  3. package/Cameras/camera.js +4 -4
  4. package/Cameras/camera.js.map +1 -1
  5. package/Collisions/pickingInfo.d.ts +1 -2
  6. package/Collisions/pickingInfo.js +7 -4
  7. package/Collisions/pickingInfo.js.map +1 -1
  8. package/Culling/ray.d.ts +1 -1
  9. package/Culling/ray.js +5 -6
  10. package/Culling/ray.js.map +1 -1
  11. package/Debug/debugLayer.d.ts +5 -0
  12. package/Debug/debugLayer.js.map +1 -1
  13. package/Engines/Extensions/engine.renderTarget.js +5 -1
  14. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  15. package/Engines/Extensions/engine.videoTexture.js +6 -3
  16. package/Engines/Extensions/engine.videoTexture.js.map +1 -1
  17. package/Engines/WebGPU/Extensions/engine.renderTarget.js +4 -1
  18. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  19. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +2 -0
  20. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  21. package/Engines/WebGPU/webgpuShaderProcessor.js +3 -7
  22. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  23. package/Engines/WebGPU/webgpuTextureHelper.js +2 -0
  24. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  25. package/Engines/WebGPU/webgpuTintWASM.d.ts +1 -0
  26. package/Engines/WebGPU/webgpuTintWASM.js +7 -1
  27. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  28. package/Engines/constants.d.ts +4 -0
  29. package/Engines/constants.js +4 -0
  30. package/Engines/constants.js.map +1 -1
  31. package/Engines/engine.d.ts +45 -12
  32. package/Engines/renderTargetWrapper.d.ts +2 -1
  33. package/Engines/renderTargetWrapper.js +1 -0
  34. package/Engines/renderTargetWrapper.js.map +1 -1
  35. package/Engines/thinEngine.js +6 -3
  36. package/Engines/thinEngine.js.map +1 -1
  37. package/Engines/webgpuEngine.d.ts +0 -2
  38. package/Engines/webgpuEngine.js +15 -14
  39. package/Engines/webgpuEngine.js.map +1 -1
  40. package/Events/pointerEvents.d.ts +11 -6
  41. package/Events/pointerEvents.js +24 -6
  42. package/Events/pointerEvents.js.map +1 -1
  43. package/IAccessibilityTag.d.ts +29 -0
  44. package/IAccessibilityTag.js +2 -0
  45. package/IAccessibilityTag.js.map +1 -0
  46. package/Inputs/scene.inputManager.d.ts +9 -1
  47. package/Inputs/scene.inputManager.js +83 -37
  48. package/Inputs/scene.inputManager.js.map +1 -1
  49. package/Layers/effectLayer.js +2 -6
  50. package/Layers/effectLayer.js.map +1 -1
  51. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +24 -3
  52. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +92 -21
  53. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  54. package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +1 -1
  55. package/Materials/PBR/pbrMetallicRoughnessMaterial.js +1 -1
  56. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  57. package/Materials/Textures/htmlElementTexture.d.ts +5 -0
  58. package/Materials/Textures/htmlElementTexture.js +4 -1
  59. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  60. package/Materials/Textures/renderTargetTexture.d.ts +1 -1
  61. package/Materials/Textures/renderTargetTexture.js +2 -2
  62. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  63. package/Materials/Textures/videoTexture.d.ts +6 -1
  64. package/Materials/Textures/videoTexture.js +7 -2
  65. package/Materials/Textures/videoTexture.js.map +1 -1
  66. package/Maths/math.vector.d.ts +460 -337
  67. package/Maths/math.vector.js +370 -184
  68. package/Maths/math.vector.js.map +1 -1
  69. package/Meshes/Builders/decalBuilder.d.ts +8 -0
  70. package/Meshes/Builders/decalBuilder.js +270 -51
  71. package/Meshes/Builders/decalBuilder.js.map +1 -1
  72. package/Meshes/mesh.d.ts +1 -1
  73. package/Meshes/mesh.js +42 -1
  74. package/Meshes/mesh.js.map +1 -1
  75. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +17 -4
  76. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +49 -9
  77. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  78. package/Misc/iInspectable.d.ts +5 -1
  79. package/Misc/iInspectable.js +4 -0
  80. package/Misc/iInspectable.js.map +1 -1
  81. package/Misc/index.d.ts +1 -1
  82. package/Misc/index.js +1 -1
  83. package/Misc/index.js.map +1 -1
  84. package/Misc/khronosTextureContainer2.js +41 -46
  85. package/Misc/khronosTextureContainer2.js.map +1 -1
  86. package/Misc/observable.js +4 -4
  87. package/Misc/observable.js.map +1 -1
  88. package/Misc/pressureObserverWrapper.d.ts +36 -0
  89. package/Misc/pressureObserverWrapper.js +68 -0
  90. package/Misc/pressureObserverWrapper.js.map +1 -0
  91. package/Misc/screenshotTools.js +0 -1
  92. package/Misc/screenshotTools.js.map +1 -1
  93. package/Particles/particleSystem.d.ts +4 -0
  94. package/Particles/particleSystem.js +12 -4
  95. package/Particles/particleSystem.js.map +1 -1
  96. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +14 -8
  97. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +16 -6
  98. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  99. package/PostProcesses/blurPostProcess.d.ts +2 -1
  100. package/PostProcesses/blurPostProcess.js +3 -2
  101. package/PostProcesses/blurPostProcess.js.map +1 -1
  102. package/PostProcesses/circleOfConfusionPostProcess.js +2 -1
  103. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  104. package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -1
  105. package/PostProcesses/depthOfFieldBlurPostProcess.js +3 -5
  106. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  107. package/PostProcesses/depthOfFieldEffect.js +9 -4
  108. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  109. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  110. package/PostProcesses/postProcess.js +4 -4
  111. package/PostProcesses/postProcess.js.map +1 -1
  112. package/PostProcesses/volumetricLightScatteringPostProcess.js +2 -6
  113. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  114. package/Rendering/depthPeelingRenderer.js +4 -0
  115. package/Rendering/depthPeelingRenderer.js.map +1 -1
  116. package/Rendering/depthRenderer.js +2 -6
  117. package/Rendering/depthRenderer.js.map +1 -1
  118. package/Rendering/geometryBufferRenderer.js +2 -6
  119. package/Rendering/geometryBufferRenderer.js.map +1 -1
  120. package/Rendering/renderingGroup.d.ts +4 -0
  121. package/Rendering/renderingGroup.js +7 -1
  122. package/Rendering/renderingGroup.js.map +1 -1
  123. package/Rendering/renderingManager.d.ts +8 -0
  124. package/Rendering/renderingManager.js +18 -0
  125. package/Rendering/renderingManager.js.map +1 -1
  126. package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +18 -13
  127. package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
  128. package/Shaders/circleOfConfusion.fragment.js +1 -1
  129. package/Shaders/circleOfConfusion.fragment.js.map +1 -1
  130. package/Shaders/depthOfFieldMerge.fragment.js +1 -1
  131. package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
  132. package/Shaders/fxaa.fragment.js +10 -5
  133. package/Shaders/fxaa.fragment.js.map +1 -1
  134. package/Shaders/kernelBlur.fragment.js +2 -2
  135. package/Shaders/kernelBlur.fragment.js.map +1 -1
  136. package/Shaders/particles.vertex.js +4 -1
  137. package/Shaders/particles.vertex.js.map +1 -1
  138. package/Shaders/spriteMap.fragment.js +7 -2
  139. package/Shaders/spriteMap.fragment.js.map +1 -1
  140. package/XR/features/WebXRControllerPointerSelection.js +1 -0
  141. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  142. package/XR/features/WebXRNearInteraction.js.map +1 -1
  143. package/XR/webXRRenderTargetTextureProvider.js +1 -0
  144. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  145. package/node.d.ts +8 -0
  146. package/node.js +13 -1
  147. package/node.js.map +1 -1
  148. package/package.json +1 -1
  149. package/scene.d.ts +6 -8
  150. package/scene.js +11 -30
  151. package/scene.js.map +1 -1
  152. package/Misc/computePressure.d.ts +0 -57
  153. package/Misc/computePressure.js +0 -48
  154. package/Misc/computePressure.js.map +0 -1
@@ -2,6 +2,7 @@ import type { Nullable } from "../types";
2
2
  import { Vector2 } from "../Maths/math.vector";
3
3
  import type { PickingInfo } from "../Collisions/pickingInfo";
4
4
  import type { IMouseEvent } from "./deviceInputEvents";
5
+ import type { InputManager } from "../Inputs/scene.inputManager";
5
6
  declare type Ray = import("../Culling/ray").Ray;
6
7
  /**
7
8
  * Gather the list of pointer event types as constants.
@@ -102,21 +103,25 @@ export declare class PointerInfoPre extends PointerInfoBase {
102
103
  * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class.
103
104
  */
104
105
  export declare class PointerInfo extends PointerInfoBase {
106
+ private _pickInfo;
107
+ private _inputManager;
105
108
  /**
106
- * Defines the picking info associated to the info (if any)\
109
+ * Defines the picking info associated with this PointerInfo object (if applicable)
107
110
  */
108
- pickInfo: Nullable<PickingInfo>;
111
+ get pickInfo(): Nullable<PickingInfo>;
109
112
  /**
110
113
  * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.
111
114
  * @param type Defines the type of event (PointerEventTypes)
112
115
  * @param event Defines the related dom event
113
- * @param pickInfo Defines the picking info associated to the info (if any)\
116
+ * @param pickInfo Defines the picking info associated to the info (if any)
117
+ * @param inputManager Defines the InputManager to use if there is no pickInfo
114
118
  */
115
- constructor(type: number, event: IMouseEvent,
119
+ constructor(type: number, event: IMouseEvent, pickInfo: Nullable<PickingInfo>, inputManager?: Nullable<InputManager>);
116
120
  /**
117
- * Defines the picking info associated to the info (if any)\
121
+ * Generates the picking info if needed
118
122
  */
119
- pickInfo: Nullable<PickingInfo>);
123
+ /** @internal */
124
+ _generatePickInfo(): void;
120
125
  }
121
126
  /**
122
127
  * Data relating to a touch event on the screen.
@@ -89,15 +89,33 @@ export class PointerInfo extends PointerInfoBase {
89
89
  * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.
90
90
  * @param type Defines the type of event (PointerEventTypes)
91
91
  * @param event Defines the related dom event
92
- * @param pickInfo Defines the picking info associated to the info (if any)\
92
+ * @param pickInfo Defines the picking info associated to the info (if any)
93
+ * @param inputManager Defines the InputManager to use if there is no pickInfo
93
94
  */
94
- constructor(type, event,
95
+ constructor(type, event, pickInfo, inputManager = null) {
96
+ super(type, event);
97
+ this._pickInfo = pickInfo;
98
+ this._inputManager = inputManager;
99
+ }
95
100
  /**
96
- * Defines the picking info associated to the info (if any)\
101
+ * Defines the picking info associated with this PointerInfo object (if applicable)
97
102
  */
98
- pickInfo) {
99
- super(type, event);
100
- this.pickInfo = pickInfo;
103
+ get pickInfo() {
104
+ if (!this._pickInfo) {
105
+ this._generatePickInfo();
106
+ }
107
+ return this._pickInfo;
108
+ }
109
+ /**
110
+ * Generates the picking info if needed
111
+ */
112
+ /** @internal */
113
+ _generatePickInfo() {
114
+ if (this._inputManager) {
115
+ this._pickInfo = this._inputManager._pickMove(this.event.pointerId);
116
+ this._inputManager._setRayOnPointerInfo(this._pickInfo, this.event);
117
+ this._inputManager = null;
118
+ }
101
119
  }
102
120
  }
103
121
  //# sourceMappingURL=pointerEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pointerEvents.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Events/pointerEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAM/C;;GAEG;AACH,MAAM,OAAO,iBAAiB;;AAC1B;;GAEG;AACoB,6BAAW,GAAG,IAAI,CAAC;AAC1C;;GAEG;AACoB,2BAAS,GAAG,IAAI,CAAC;AACxC;;GAEG;AACoB,6BAAW,GAAG,IAAI,CAAC;AAC1C;;GAEG;AACoB,8BAAY,GAAG,IAAI,CAAC;AAC3C;;GAEG;AACoB,6BAAW,GAAG,IAAI,CAAC;AAC1C;;GAEG;AACoB,4BAAU,GAAG,IAAI,CAAC;AACzC;;GAEG;AACoB,kCAAgB,GAAG,IAAI,CAAC;AAGnD;;GAEG;AACH,MAAM,OAAO,eAAe;IACxB;;;;OAIG;IACH;IACI;;OAEG;IACI,IAAY;IACnB;;OAEG;IACI,KAAkB;QAJlB,SAAI,GAAJ,IAAI,CAAQ;QAIZ,UAAK,GAAL,KAAK,CAAa;IAC1B,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,eAAe;IA0B/C;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,KAAkB,EAAE,MAAc,EAAE,MAAc;QACxE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAjCvB;;WAEG;QACI,QAAG,GAAkB,IAAI,CAAC;QAOjC;;WAEG;QACI,wBAAmB,GAA0B,IAAI,CAAC;QAqBrD,IAAI,CAAC,uBAAuB,GAAG,KAAK,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,eAAe;IAC5C;;;;;OAKG;IACH,YACI,IAAY,EACZ,KAAkB;IAClB;;OAEG;IACI,QAA+B;QAEtC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAFZ,aAAQ,GAAR,QAAQ,CAAuB;IAG1C,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { PickingInfo } from \"../Collisions/pickingInfo\";\r\nimport type { IMouseEvent } from \"./deviceInputEvents\";\r\n\r\ndeclare type Ray = import(\"../Culling/ray\").Ray;\r\n\r\n/**\r\n * Gather the list of pointer event types as constants.\r\n */\r\nexport class PointerEventTypes {\r\n /**\r\n * The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer.\r\n */\r\n public static readonly POINTERDOWN = 0x01;\r\n /**\r\n * The pointerup event is fired when a pointer is no longer active.\r\n */\r\n public static readonly POINTERUP = 0x02;\r\n /**\r\n * The pointermove event is fired when a pointer changes coordinates.\r\n */\r\n public static readonly POINTERMOVE = 0x04;\r\n /**\r\n * The pointerwheel event is fired when a mouse wheel has been rotated.\r\n */\r\n public static readonly POINTERWHEEL = 0x08;\r\n /**\r\n * The pointerpick event is fired when a mesh or sprite has been picked by the pointer.\r\n */\r\n public static readonly POINTERPICK = 0x10;\r\n /**\r\n * The pointertap event is fired when a the object has been touched and released without drag.\r\n */\r\n public static readonly POINTERTAP = 0x20;\r\n /**\r\n * The pointerdoubletap event is fired when a the object has been touched and released twice without drag.\r\n */\r\n public static readonly POINTERDOUBLETAP = 0x40;\r\n}\r\n\r\n/**\r\n * Base class of pointer info types.\r\n */\r\nexport class PointerInfoBase {\r\n /**\r\n * Instantiates the base class of pointers info.\r\n * @param type Defines the type of event (PointerEventTypes)\r\n * @param event Defines the related dom event\r\n */\r\n constructor(\r\n /**\r\n * Defines the type of event (PointerEventTypes)\r\n */\r\n public type: number,\r\n /**\r\n * Defines the related dom event\r\n */\r\n public event: IMouseEvent\r\n ) {}\r\n}\r\n\r\n/**\r\n * This class is used to store pointer related info for the onPrePointerObservable event.\r\n * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable\r\n */\r\nexport class PointerInfoPre extends PointerInfoBase {\r\n /**\r\n * Ray from a pointer if available (eg. 6dof controller)\r\n */\r\n public ray: Nullable<Ray> = null;\r\n\r\n /**\r\n * Defines picking info coming from a near interaction (proximity instead of ray-based picking)\r\n */\r\n public nearInteractionPickingInfo: Nullable<PickingInfo>;\r\n\r\n /**\r\n * The original picking info that was used to trigger the pointer event\r\n */\r\n public originalPickingInfo: Nullable<PickingInfo> = null;\r\n\r\n /**\r\n * Defines the local position of the pointer on the canvas.\r\n */\r\n public localPosition: Vector2;\r\n\r\n /**\r\n * Defines whether the engine should skip the next OnPointerObservable associated to this pre.\r\n */\r\n public skipOnPointerObservable: boolean;\r\n\r\n /**\r\n * Instantiates a PointerInfoPre to store pointer related info to the onPrePointerObservable event.\r\n * @param type Defines the type of event (PointerEventTypes)\r\n * @param event Defines the related dom event\r\n * @param localX Defines the local x coordinates of the pointer when the event occured\r\n * @param localY Defines the local y coordinates of the pointer when the event occured\r\n */\r\n constructor(type: number, event: IMouseEvent, localX: number, localY: number) {\r\n super(type, event);\r\n this.skipOnPointerObservable = false;\r\n this.localPosition = new Vector2(localX, localY);\r\n }\r\n}\r\n\r\n/**\r\n * This type contains all the data related to a pointer event in Babylon.js.\r\n * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class.\r\n */\r\nexport class PointerInfo extends PointerInfoBase {\r\n /**\r\n * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.\r\n * @param type Defines the type of event (PointerEventTypes)\r\n * @param event Defines the related dom event\r\n * @param pickInfo Defines the picking info associated to the info (if any)\\\r\n */\r\n constructor(\r\n type: number,\r\n event: IMouseEvent,\r\n /**\r\n * Defines the picking info associated to the info (if any)\\\r\n */\r\n public pickInfo: Nullable<PickingInfo>\r\n ) {\r\n super(type, event);\r\n }\r\n}\r\n\r\n/**\r\n * Data relating to a touch event on the screen.\r\n */\r\nexport interface PointerTouch {\r\n /**\r\n * X coordinate of touch.\r\n */\r\n x: number;\r\n /**\r\n * Y coordinate of touch.\r\n */\r\n y: number;\r\n /**\r\n * Id of touch. Unique for each finger.\r\n */\r\n pointerId: number;\r\n /**\r\n * Event type passed from DOM.\r\n */\r\n type: any;\r\n}\r\n"]}
1
+ {"version":3,"file":"pointerEvents.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Events/pointerEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C;;GAEG;AACH,MAAM,OAAO,iBAAiB;;AAC1B;;GAEG;AACoB,6BAAW,GAAG,IAAI,CAAC;AAC1C;;GAEG;AACoB,2BAAS,GAAG,IAAI,CAAC;AACxC;;GAEG;AACoB,6BAAW,GAAG,IAAI,CAAC;AAC1C;;GAEG;AACoB,8BAAY,GAAG,IAAI,CAAC;AAC3C;;GAEG;AACoB,6BAAW,GAAG,IAAI,CAAC;AAC1C;;GAEG;AACoB,4BAAU,GAAG,IAAI,CAAC;AACzC;;GAEG;AACoB,kCAAgB,GAAG,IAAI,CAAC;AAGnD;;GAEG;AACH,MAAM,OAAO,eAAe;IACxB;;;;OAIG;IACH;IACI;;OAEG;IACI,IAAY;IACnB;;OAEG;IACI,KAAkB;QAJlB,SAAI,GAAJ,IAAI,CAAQ;QAIZ,UAAK,GAAL,KAAK,CAAa;IAC1B,CAAC;CACP;AAED;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,eAAe;IA0B/C;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,KAAkB,EAAE,MAAc,EAAE,MAAc;QACxE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAjCvB;;WAEG;QACI,QAAG,GAAkB,IAAI,CAAC;QAOjC;;WAEG;QACI,wBAAmB,GAA0B,IAAI,CAAC;QAqBrD,IAAI,CAAC,uBAAuB,GAAG,KAAK,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,eAAe;IAc5C;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,KAAkB,EAAE,QAA+B,EAAE,eAAuC,IAAI;QACtH,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACtC,CAAC;IArBD;;OAEG;IACH,IAAW,QAAQ;QACf,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC5B;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAcD;;OAEG;IACH,gBAAgB;IACT,iBAAiB;QACpB,IAAI,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAE,IAAI,CAAC,KAAuB,CAAC,SAAS,CAAC,CAAC;YACvF,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACpE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;SAC7B;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { PickingInfo } from \"../Collisions/pickingInfo\";\r\nimport type { IMouseEvent, IPointerEvent } from \"./deviceInputEvents\";\r\nimport type { InputManager } from \"../Inputs/scene.inputManager\";\r\n\r\ndeclare type Ray = import(\"../Culling/ray\").Ray;\r\n\r\n/**\r\n * Gather the list of pointer event types as constants.\r\n */\r\nexport class PointerEventTypes {\r\n /**\r\n * The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer.\r\n */\r\n public static readonly POINTERDOWN = 0x01;\r\n /**\r\n * The pointerup event is fired when a pointer is no longer active.\r\n */\r\n public static readonly POINTERUP = 0x02;\r\n /**\r\n * The pointermove event is fired when a pointer changes coordinates.\r\n */\r\n public static readonly POINTERMOVE = 0x04;\r\n /**\r\n * The pointerwheel event is fired when a mouse wheel has been rotated.\r\n */\r\n public static readonly POINTERWHEEL = 0x08;\r\n /**\r\n * The pointerpick event is fired when a mesh or sprite has been picked by the pointer.\r\n */\r\n public static readonly POINTERPICK = 0x10;\r\n /**\r\n * The pointertap event is fired when a the object has been touched and released without drag.\r\n */\r\n public static readonly POINTERTAP = 0x20;\r\n /**\r\n * The pointerdoubletap event is fired when a the object has been touched and released twice without drag.\r\n */\r\n public static readonly POINTERDOUBLETAP = 0x40;\r\n}\r\n\r\n/**\r\n * Base class of pointer info types.\r\n */\r\nexport class PointerInfoBase {\r\n /**\r\n * Instantiates the base class of pointers info.\r\n * @param type Defines the type of event (PointerEventTypes)\r\n * @param event Defines the related dom event\r\n */\r\n constructor(\r\n /**\r\n * Defines the type of event (PointerEventTypes)\r\n */\r\n public type: number,\r\n /**\r\n * Defines the related dom event\r\n */\r\n public event: IMouseEvent\r\n ) {}\r\n}\r\n\r\n/**\r\n * This class is used to store pointer related info for the onPrePointerObservable event.\r\n * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable\r\n */\r\nexport class PointerInfoPre extends PointerInfoBase {\r\n /**\r\n * Ray from a pointer if available (eg. 6dof controller)\r\n */\r\n public ray: Nullable<Ray> = null;\r\n\r\n /**\r\n * Defines picking info coming from a near interaction (proximity instead of ray-based picking)\r\n */\r\n public nearInteractionPickingInfo: Nullable<PickingInfo>;\r\n\r\n /**\r\n * The original picking info that was used to trigger the pointer event\r\n */\r\n public originalPickingInfo: Nullable<PickingInfo> = null;\r\n\r\n /**\r\n * Defines the local position of the pointer on the canvas.\r\n */\r\n public localPosition: Vector2;\r\n\r\n /**\r\n * Defines whether the engine should skip the next OnPointerObservable associated to this pre.\r\n */\r\n public skipOnPointerObservable: boolean;\r\n\r\n /**\r\n * Instantiates a PointerInfoPre to store pointer related info to the onPrePointerObservable event.\r\n * @param type Defines the type of event (PointerEventTypes)\r\n * @param event Defines the related dom event\r\n * @param localX Defines the local x coordinates of the pointer when the event occured\r\n * @param localY Defines the local y coordinates of the pointer when the event occured\r\n */\r\n constructor(type: number, event: IMouseEvent, localX: number, localY: number) {\r\n super(type, event);\r\n this.skipOnPointerObservable = false;\r\n this.localPosition = new Vector2(localX, localY);\r\n }\r\n}\r\n\r\n/**\r\n * This type contains all the data related to a pointer event in Babylon.js.\r\n * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class.\r\n */\r\nexport class PointerInfo extends PointerInfoBase {\r\n private _pickInfo: Nullable<PickingInfo>;\r\n private _inputManager: Nullable<InputManager>;\r\n\r\n /**\r\n * Defines the picking info associated with this PointerInfo object (if applicable)\r\n */\r\n public get pickInfo(): Nullable<PickingInfo> {\r\n if (!this._pickInfo) {\r\n this._generatePickInfo();\r\n }\r\n\r\n return this._pickInfo;\r\n }\r\n /**\r\n * Instantiates a PointerInfo to store pointer related info to the onPointerObservable event.\r\n * @param type Defines the type of event (PointerEventTypes)\r\n * @param event Defines the related dom event\r\n * @param pickInfo Defines the picking info associated to the info (if any)\r\n * @param inputManager Defines the InputManager to use if there is no pickInfo\r\n */\r\n constructor(type: number, event: IMouseEvent, pickInfo: Nullable<PickingInfo>, inputManager: Nullable<InputManager> = null) {\r\n super(type, event);\r\n this._pickInfo = pickInfo;\r\n this._inputManager = inputManager;\r\n }\r\n\r\n /**\r\n * Generates the picking info if needed\r\n */\r\n /** @internal */\r\n public _generatePickInfo(): void {\r\n if (this._inputManager) {\r\n this._pickInfo = this._inputManager._pickMove((this.event as IPointerEvent).pointerId);\r\n this._inputManager._setRayOnPointerInfo(this._pickInfo, this.event);\r\n this._inputManager = null;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Data relating to a touch event on the screen.\r\n */\r\nexport interface PointerTouch {\r\n /**\r\n * X coordinate of touch.\r\n */\r\n x: number;\r\n /**\r\n * Y coordinate of touch.\r\n */\r\n y: number;\r\n /**\r\n * Id of touch. Unique for each finger.\r\n */\r\n pointerId: number;\r\n /**\r\n * Event type passed from DOM.\r\n */\r\n type: any;\r\n}\r\n"]}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Define an interface for a node to indicate it's info for accessibility.
3
+ * By default, Node type doesn't imply accessibility info unless this tag is assigned. Whereas GUI controls already indicate accessibility info, but one can override the info using this tag.
4
+ */
5
+ export interface IAccessibilityTag {
6
+ /**
7
+ * A string as alt text of the node, describing what the node is/does, for accessibility purpose.
8
+ */
9
+ description?: string;
10
+ /**
11
+ * Customize the event of the accessible object.
12
+ * This will be applied on the generated HTML twin node.
13
+ */
14
+ eventHandler?: {
15
+ [key in keyof HTMLElementEventMap]: (e?: Event) => void;
16
+ };
17
+ /**
18
+ * ARIA roles and attributes to customize accessibility support.
19
+ * If you use BabylonJS's accessibility html twin renderer, and want to override the default behavior (not suggested), this can be your way.
20
+ * Learn more about ARIA: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
21
+ */
22
+ role?: AcceptedRole;
23
+ aria?: {
24
+ [key in AcceptedARIA]: any;
25
+ };
26
+ }
27
+ declare type AcceptedRole = "toolbar" | "tooltip" | "feed" | "math" | "presentation" | "none" | "note" | "application" | "article" | "cell" | "columnheader" | "definition" | "directory" | "document" | "figure" | "group" | "heading" | "img" | "list" | "listitem" | "meter" | "row" | "rowgroup" | "rowheader" | "separator" | "table" | "term" | "scrollbar" | "searchbox" | "separator" | "slider" | "spinbutton" | "switch" | "tab" | "tabpanel" | "treeitem" | "combobox" | "menu" | "menubar" | "tablist" | "tree" | "treegrid" | "banner" | "complementary" | "contentinfo" | "form" | "main" | "navigation" | "region" | "search" | "alert" | "log" | "marquee" | "status" | "timer" | "alertdialog" | "dialog";
28
+ declare type AcceptedARIA = "aria-autocomplete" | "aria-checked" | "aria-disabled" | "aria-errormessage" | "aria-expanded" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-label" | "aria-level" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-selected" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "aria-busy" | "aria-live" | "aria-relevant" | "aria-atomic" | "aria-dropeffect" | "aria-grabbed" | "aria-activedescendant" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-describedby" | "aria-description" | "aria-details" | "aria-errormessage" | "aria-flowto" | "aria-labelledby" | "aria-owns" | "aria-posinset" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-setsize";
29
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IAccessibilityTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAccessibilityTag.js","sourceRoot":"","sources":["../../../../lts/core/generated/IAccessibilityTag.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Define an interface for a node to indicate it's info for accessibility.\r\n * By default, Node type doesn't imply accessibility info unless this tag is assigned. Whereas GUI controls already indicate accessibility info, but one can override the info using this tag.\r\n */\r\nexport interface IAccessibilityTag {\r\n /**\r\n * A string as alt text of the node, describing what the node is/does, for accessibility purpose.\r\n */\r\n description?: string;\r\n\r\n /**\r\n * Customize the event of the accessible object.\r\n * This will be applied on the generated HTML twin node.\r\n */\r\n eventHandler?: { [key in keyof HTMLElementEventMap]: (e?: Event) => void };\r\n\r\n /**\r\n * ARIA roles and attributes to customize accessibility support.\r\n * If you use BabylonJS's accessibility html twin renderer, and want to override the default behavior (not suggested), this can be your way.\r\n * Learn more about ARIA: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA\r\n */\r\n role?: AcceptedRole;\r\n aria?: { [key in AcceptedARIA]: any };\r\n}\r\n\r\n// Based on https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles\r\ntype AcceptedRole =\r\n | \"toolbar\"\r\n | \"tooltip\"\r\n | \"feed\"\r\n | \"math\"\r\n | \"presentation\"\r\n | \"none\"\r\n | \"note\"\r\n | \"application\"\r\n | \"article\"\r\n | \"cell\"\r\n | \"columnheader\"\r\n | \"definition\"\r\n | \"directory\"\r\n | \"document\"\r\n | \"figure\"\r\n | \"group\"\r\n | \"heading\"\r\n | \"img\"\r\n | \"list\"\r\n | \"listitem\"\r\n | \"meter\"\r\n | \"row\"\r\n | \"rowgroup\"\r\n | \"rowheader\"\r\n | \"separator\"\r\n | \"table\"\r\n | \"term\"\r\n | \"scrollbar\"\r\n | \"searchbox\"\r\n | \"separator\"\r\n | \"slider\"\r\n | \"spinbutton\"\r\n | \"switch\"\r\n | \"tab\"\r\n | \"tabpanel\"\r\n | \"treeitem\"\r\n | \"combobox\"\r\n | \"menu\"\r\n | \"menubar\"\r\n | \"tablist\"\r\n | \"tree\"\r\n | \"treegrid\"\r\n | \"banner\"\r\n | \"complementary\"\r\n | \"contentinfo\"\r\n | \"form\"\r\n | \"main\"\r\n | \"navigation\"\r\n | \"region\"\r\n | \"search\"\r\n | \"alert\"\r\n | \"log\"\r\n | \"marquee\"\r\n | \"status\"\r\n | \"timer\"\r\n | \"alertdialog\"\r\n | \"dialog\";\r\n\r\n// Based on https://developer.mozilla.org/en-US/docs/web/Accessibility/ARIA/Attributes#aria_attribute_types\r\ntype AcceptedARIA =\r\n | \"aria-autocomplete\"\r\n | \"aria-checked\"\r\n | \"aria-disabled\"\r\n | \"aria-errormessage\"\r\n | \"aria-expanded\"\r\n | \"aria-haspopup\"\r\n | \"aria-hidden\"\r\n | \"aria-invalid\"\r\n | \"aria-label\"\r\n | \"aria-level\"\r\n | \"aria-modal\"\r\n | \"aria-multiline\"\r\n | \"aria-multiselectable\"\r\n | \"aria-orientation\"\r\n | \"aria-placeholder\"\r\n | \"aria-pressed\"\r\n | \"aria-readonly\"\r\n | \"aria-required\"\r\n | \"aria-selected\"\r\n | \"aria-sort\"\r\n | \"aria-valuemax\"\r\n | \"aria-valuemin\"\r\n | \"aria-valuenow\"\r\n | \"aria-valuetext\"\r\n | \"aria-busy\"\r\n | \"aria-live\"\r\n | \"aria-relevant\"\r\n | \"aria-atomic\"\r\n | \"aria-dropeffect\"\r\n | \"aria-grabbed\"\r\n | \"aria-activedescendant\"\r\n | \"aria-colcount\"\r\n | \"aria-colindex\"\r\n | \"aria-colspan\"\r\n | \"aria-controls\"\r\n | \"aria-describedby\"\r\n | \"aria-description\"\r\n | \"aria-details\"\r\n | \"aria-errormessage\"\r\n | \"aria-flowto\"\r\n | \"aria-labelledby\"\r\n | \"aria-owns\"\r\n | \"aria-posinset\"\r\n | \"aria-rowcount\"\r\n | \"aria-rowindex\"\r\n | \"aria-rowspan\"\r\n | \"aria-setsize\";\r\n"]}
@@ -2,6 +2,7 @@ import type { Nullable } from "../types";
2
2
  import { PickingInfo } from "../Collisions/pickingInfo";
3
3
  import { Vector2 } from "../Maths/math.vector";
4
4
  import type { AbstractMesh } from "../Meshes/abstractMesh";
5
+ import type { IMouseEvent } from "../Events/deviceInputEvents";
5
6
  declare type Scene = import("../scene").Scene;
6
7
  /**
7
8
  * Class used to manage all inputs for the scene.
@@ -32,6 +33,8 @@ export declare class InputManager {
32
33
  private _previousPickResult;
33
34
  private _totalPointersPressed;
34
35
  private _doubleClickOccured;
36
+ private _isSwiping;
37
+ private _swipeButtonPressed;
35
38
  private _pointerOverMesh;
36
39
  private _pickedDownMesh;
37
40
  private _pickedUpMesh;
@@ -45,6 +48,7 @@ export declare class InputManager {
45
48
  private _previousStartingPointerTime;
46
49
  private _pointerCaptures;
47
50
  private _meshUnderPointerId;
51
+ private _movePointerInfo;
48
52
  private _onKeyDown;
49
53
  private _onKeyUp;
50
54
  private _scene;
@@ -84,8 +88,12 @@ export declare class InputManager {
84
88
  set pointerY(value: number);
85
89
  private _updatePointerPosition;
86
90
  private _processPointerMove;
87
- private _setRayOnPointerInfo;
91
+ /** @internal */
92
+ _setRayOnPointerInfo(pickInfo: Nullable<PickingInfo>, event: IMouseEvent): void;
88
93
  private _checkPrePointerObservable;
94
+ /** @internal */
95
+ _pickMove(pointerId: number): PickingInfo;
96
+ private _setCursorAndPointerOverMesh;
89
97
  /**
90
98
  * Use this method to simulate a pointer move on a mesh
91
99
  * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
@@ -58,6 +58,8 @@ export class InputManager {
58
58
  this._previousPickResult = null;
59
59
  this._totalPointersPressed = 0;
60
60
  this._doubleClickOccured = false;
61
+ this._isSwiping = false;
62
+ this._swipeButtonPressed = -1;
61
63
  this._pointerX = 0;
62
64
  this._pointerY = 0;
63
65
  this._startingPointerPosition = new Vector2(0, 0);
@@ -66,6 +68,7 @@ export class InputManager {
66
68
  this._previousStartingPointerTime = 0;
67
69
  this._pointerCaptures = {};
68
70
  this._meshUnderPointerId = {};
71
+ this._movePointerInfo = null;
69
72
  this._deviceSourceManager = null;
70
73
  this._scene = scene || EngineStore.LastCreatedScene;
71
74
  if (!this._scene) {
@@ -77,6 +80,13 @@ export class InputManager {
77
80
  * @returns Mesh that the pointer is pointer is hovering over
78
81
  */
79
82
  get meshUnderPointer() {
83
+ if (this._movePointerInfo) {
84
+ // Because _pointerOverMesh is populated as part of _pickMove, we need to force a pick to update it.
85
+ // Calling _pickMove calls _setCursorAndPointerOverMesh which calls setPointerOverMesh
86
+ this._movePointerInfo._generatePickInfo();
87
+ // Once we have what we need, we can clear _movePointerInfo because we don't need it anymore
88
+ this._movePointerInfo = null;
89
+ }
80
90
  return this._pointerOverMesh;
81
91
  }
82
92
  /**
@@ -135,40 +145,37 @@ export class InputManager {
135
145
  canvas.style.cursor = scene.defaultCursor;
136
146
  }
137
147
  }
138
- const isMeshPicked = pickResult && pickResult.hit && pickResult.pickedMesh ? true : false;
139
- if (isMeshPicked) {
140
- scene.setPointerOverMesh(pickResult.pickedMesh, evt.pointerId, pickResult);
141
- if (!scene.doNotHandleCursors && canvas && this._pointerOverMesh) {
142
- const actionManager = this._pointerOverMesh._getActionManagerForTrigger();
143
- if (actionManager && actionManager.hasPointerTriggers) {
144
- canvas.style.cursor = actionManager.hoverCursor || scene.hoverCursor;
145
- }
146
- }
147
- }
148
- else {
149
- scene.setPointerOverMesh(null, evt.pointerId, pickResult);
150
- }
148
+ this._setCursorAndPointerOverMesh(pickResult, evt.pointerId, scene);
151
149
  for (const step of scene._pointerMoveStage) {
150
+ const isMeshPicked = (pickResult === null || pickResult === void 0 ? void 0 : pickResult.pickedMesh) ? true : false;
152
151
  pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, isMeshPicked, canvas);
153
152
  }
153
+ const type = evt.inputIndex >= PointerInput.MouseWheelX && evt.inputIndex <= PointerInput.MouseWheelZ ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE;
154
+ if (scene.onPointerMove) {
155
+ // Because of lazy picking, we need to force a pick to update the pickResult
156
+ const pr = pickResult ? pickResult : this._pickMove(evt.pointerId);
157
+ scene.onPointerMove(evt, pr, type);
158
+ }
159
+ let pointerInfo;
154
160
  if (pickResult) {
155
- const type = evt.inputIndex >= PointerInput.MouseWheelX && evt.inputIndex <= PointerInput.MouseWheelZ ? PointerEventTypes.POINTERWHEEL : PointerEventTypes.POINTERMOVE;
156
- if (scene.onPointerMove) {
157
- scene.onPointerMove(evt, pickResult, type);
158
- }
159
- if (scene.onPointerObservable.hasObservers()) {
160
- const pi = new PointerInfo(type, evt, pickResult);
161
- this._setRayOnPointerInfo(pi);
162
- scene.onPointerObservable.notifyObservers(pi, type);
163
- }
161
+ pointerInfo = new PointerInfo(type, evt, pickResult);
162
+ this._setRayOnPointerInfo(pickResult, evt);
163
+ }
164
+ else {
165
+ pointerInfo = new PointerInfo(type, evt, null, this);
166
+ this._movePointerInfo = pointerInfo;
167
+ }
168
+ if (scene.onPointerObservable.hasObservers()) {
169
+ scene.onPointerObservable.notifyObservers(pointerInfo, type);
164
170
  }
165
171
  }
166
172
  // Pointers handling
167
- _setRayOnPointerInfo(pointerInfo) {
173
+ /** @internal */
174
+ _setRayOnPointerInfo(pickInfo, event) {
168
175
  const scene = this._scene;
169
- if (pointerInfo.pickInfo && !pointerInfo.pickInfo._pickingUnavailable) {
170
- if (!pointerInfo.pickInfo.ray) {
171
- pointerInfo.pickInfo.ray = scene.createPickingRay(pointerInfo.event.offsetX, pointerInfo.event.offsetY, Matrix.Identity(), scene.activeCamera);
176
+ if (pickInfo && scene._pickingAvailable) {
177
+ if (!pickInfo.ray) {
178
+ pickInfo.ray = scene.createPickingRay(event.offsetX, event.offsetY, Matrix.Identity(), scene.activeCamera);
172
179
  }
173
180
  }
174
181
  }
@@ -190,6 +197,29 @@ export class InputManager {
190
197
  return false;
191
198
  }
192
199
  }
200
+ /** @internal */
201
+ _pickMove(pointerId) {
202
+ const scene = this._scene;
203
+ const pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerMovePredicate, false, scene.cameraToUseForPointers, scene.pointerMoveTrianglePredicate);
204
+ this._setCursorAndPointerOverMesh(pickResult, pointerId, scene);
205
+ return pickResult;
206
+ }
207
+ _setCursorAndPointerOverMesh(pickResult, pointerId, scene) {
208
+ const engine = scene.getEngine();
209
+ const canvas = engine.getInputElement();
210
+ if (pickResult === null || pickResult === void 0 ? void 0 : pickResult.pickedMesh) {
211
+ this.setPointerOverMesh(pickResult.pickedMesh, pointerId, pickResult);
212
+ if (!scene.doNotHandleCursors && canvas && this._pointerOverMesh) {
213
+ const actionManager = this._pointerOverMesh._getActionManagerForTrigger();
214
+ if (actionManager && actionManager.hasPointerTriggers) {
215
+ canvas.style.cursor = actionManager.hoverCursor || scene.hoverCursor;
216
+ }
217
+ }
218
+ }
219
+ else {
220
+ this.setPointerOverMesh(null, pointerId, pickResult);
221
+ }
222
+ }
193
223
  /**
194
224
  * Use this method to simulate a pointer move on a mesh
195
225
  * The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay
@@ -268,7 +298,7 @@ export class InputManager {
268
298
  }
269
299
  if (scene.onPointerObservable.hasObservers()) {
270
300
  const pi = new PointerInfo(type, evt, pickResult);
271
- this._setRayOnPointerInfo(pi);
301
+ this._setRayOnPointerInfo(pickResult, evt);
272
302
  scene.onPointerObservable.notifyObservers(pi, type);
273
303
  }
274
304
  }
@@ -278,8 +308,7 @@ export class InputManager {
278
308
  * @internals Boolean if delta for pointer exceeds drag movement threshold
279
309
  */
280
310
  _isPointerSwiping() {
281
- return (Math.abs(this._startingPointerPosition.x - this._pointerX) > InputManager.DragMovementThreshold ||
282
- Math.abs(this._startingPointerPosition.y - this._pointerY) > InputManager.DragMovementThreshold);
311
+ return this._isSwiping;
283
312
  }
284
313
  /**
285
314
  * Use this method to simulate a pointer up on a mesh
@@ -314,7 +343,7 @@ export class InputManager {
314
343
  if (clickInfo.singleClick && !clickInfo.ignore && scene.onPointerObservable.hasObservers()) {
315
344
  const type = PointerEventTypes.POINTERPICK;
316
345
  const pi = new PointerInfo(type, evt, pickResult);
317
- this._setRayOnPointerInfo(pi);
346
+ this._setRayOnPointerInfo(pickResult, evt);
318
347
  scene.onPointerObservable.notifyObservers(pi, type);
319
348
  }
320
349
  }
@@ -354,14 +383,14 @@ export class InputManager {
354
383
  }
355
384
  if (type) {
356
385
  const pi = new PointerInfo(type, evt, pickResult);
357
- this._setRayOnPointerInfo(pi);
386
+ this._setRayOnPointerInfo(pickResult, evt);
358
387
  scene.onPointerObservable.notifyObservers(pi, type);
359
388
  }
360
389
  }
361
390
  if (!clickInfo.ignore) {
362
391
  type = PointerEventTypes.POINTERUP;
363
392
  const pi = new PointerInfo(type, evt, pickResult);
364
- this._setRayOnPointerInfo(pi);
393
+ this._setRayOnPointerInfo(pickResult, evt);
365
394
  scene.onPointerObservable.notifyObservers(pi, type);
366
395
  }
367
396
  }
@@ -400,7 +429,7 @@ export class InputManager {
400
429
  // Because this is only called from _initClickEvent, which is called in _onPointerUp, we'll use the pointerUpPredicate for the pick call
401
430
  this._initActionManager = (act) => {
402
431
  if (!this._meshPickProceed) {
403
- const pickResult = scene.skipPointerUpPicking
432
+ const pickResult = scene.skipPointerUpPicking || (scene._registeredActions === 0 && !scene.onPointerObservable.hasObservers())
404
433
  ? null
405
434
  : scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerUpPredicate, false, scene.cameraToUseForPointers);
406
435
  this._currentPickResult = pickResult;
@@ -547,8 +576,13 @@ export class InputManager {
547
576
  (mesh.enablePointerMoveEvents || scene.constantlyUpdateMeshUnderPointer || mesh._getActionManagerForTrigger() !== null) &&
548
577
  (!scene.cameraToUseForPointers || (scene.cameraToUseForPointers.layerMask & mesh.layerMask) !== 0);
549
578
  }
550
- // Meshes
551
- const pickResult = scene.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, scene.pointerMovePredicate, false, scene.cameraToUseForPointers, scene.pointerMoveTrianglePredicate);
579
+ // Check if pointer leaves DragMovementThreshold range to determine if swipe is occurring
580
+ if (!this._isSwiping && this._swipeButtonPressed !== -1) {
581
+ this._isSwiping =
582
+ Math.abs(this._startingPointerPosition.x - this._pointerX) > InputManager.DragMovementThreshold ||
583
+ Math.abs(this._startingPointerPosition.y - this._pointerY) > InputManager.DragMovementThreshold;
584
+ }
585
+ const pickResult = scene._registeredActions > 0 ? this._pickMove(evt.pointerId) : null;
552
586
  this._processPointerMove(pickResult, evt);
553
587
  };
554
588
  this._onPointerDown = (evt) => {
@@ -560,6 +594,9 @@ export class InputManager {
560
594
  evt.pointerId = 0;
561
595
  }
562
596
  this._updatePointerPosition(evt);
597
+ if (this._swipeButtonPressed === -1) {
598
+ this._swipeButtonPressed = evt.button;
599
+ }
563
600
  if (scene.preventDefaultOnPointerDown && elementToAttachTo) {
564
601
  evt.preventDefault();
565
602
  elementToAttachTo.focus();
@@ -587,7 +624,7 @@ export class InputManager {
587
624
  // Meshes
588
625
  this._pickedDownMesh = null;
589
626
  let pickResult;
590
- if (scene.skipPointerDownPicking) {
627
+ if (scene.skipPointerDownPicking || (scene._registeredActions === 0 && !scene.onPointerObservable.hasObservers())) {
591
628
  pickResult = new PickingInfo();
592
629
  }
593
630
  else {
@@ -629,6 +666,11 @@ export class InputManager {
629
666
  }
630
667
  }
631
668
  if (this._checkPrePointerObservable(null, evt, PointerEventTypes.POINTERUP)) {
669
+ // If we're skipping the next observable, we need to reset the swipe state before returning
670
+ if (this._swipeButtonPressed === evt.button) {
671
+ this._isSwiping = false;
672
+ this._swipeButtonPressed = -1;
673
+ }
632
674
  return;
633
675
  }
634
676
  }
@@ -655,6 +697,10 @@ export class InputManager {
655
697
  }
656
698
  this._processPointerUp(pickResult, evt, clickInfo);
657
699
  this._previousPickResult = this._currentPickResult;
700
+ if (this._swipeButtonPressed === evt.button) {
701
+ this._isSwiping = false;
702
+ this._swipeButtonPressed = -1;
703
+ }
658
704
  });
659
705
  };
660
706
  this._onKeyDown = (evt) => {
@@ -798,7 +844,7 @@ export class InputManager {
798
844
  * @returns a Mesh or null if no mesh is under the pointer
799
845
  */
800
846
  getPointerOverMesh() {
801
- return this._pointerOverMesh;
847
+ return this.meshUnderPointer;
802
848
  }
803
849
  /**
804
850
  * @param mesh - Mesh to invalidate