@onerjs/core 8.56.3 → 9.0.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 (484) hide show
  1. package/Animations/animatable.core.js +36 -0
  2. package/Animations/animatable.core.js.map +1 -1
  3. package/Animations/animationGroup.pure.d.ts +61 -1
  4. package/Animations/animationGroup.pure.js +191 -2
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/index.d.ts +1 -0
  7. package/Animations/index.js +1 -0
  8. package/Animations/index.js.map +1 -1
  9. package/Animations/pure.d.ts +1 -0
  10. package/Animations/pure.js +1 -0
  11. package/Animations/pure.js.map +1 -1
  12. package/Animations/rootMotion.d.ts +560 -0
  13. package/Animations/rootMotion.js +1709 -0
  14. package/Animations/rootMotion.js.map +1 -0
  15. package/Animations/runtimeAnimation.d.ts +57 -0
  16. package/Animations/runtimeAnimation.js +127 -3
  17. package/Animations/runtimeAnimation.js.map +1 -1
  18. package/Cameras/arcRotateCamera.pure.d.ts +2 -0
  19. package/Cameras/arcRotateCamera.pure.js +2 -0
  20. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  21. package/Cameras/camera.pure.js +4 -0
  22. package/Cameras/camera.pure.js.map +1 -1
  23. package/Cameras/targetCamera.pure.d.ts +2 -0
  24. package/Cameras/targetCamera.pure.js +7 -1
  25. package/Cameras/targetCamera.pure.js.map +1 -1
  26. package/Collisions/gpuPicker.js +5 -5
  27. package/Collisions/gpuPicker.js.map +1 -1
  28. package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
  29. package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
  30. package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
  31. package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
  32. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
  33. package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
  34. package/Engines/Extensions/engine.multiRender.pure.js +63 -0
  35. package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
  36. package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
  37. package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
  38. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
  39. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
  40. package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
  41. package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
  42. package/Engines/Extensions/index.d.ts +1 -0
  43. package/Engines/Extensions/index.js +1 -0
  44. package/Engines/Extensions/index.js.map +1 -1
  45. package/Engines/Extensions/pure.d.ts +1 -1
  46. package/Engines/Extensions/pure.js +1 -1
  47. package/Engines/Extensions/pure.js.map +1 -1
  48. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
  49. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
  50. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
  51. package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
  52. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
  53. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
  54. package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
  55. package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
  56. package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
  57. package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
  58. package/Engines/WebGPU/Extensions/index.d.ts +1 -0
  59. package/Engines/WebGPU/Extensions/index.js +1 -0
  60. package/Engines/WebGPU/Extensions/index.js.map +1 -1
  61. package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
  62. package/Engines/WebGPU/Extensions/pure.js +1 -1
  63. package/Engines/WebGPU/Extensions/pure.js.map +1 -1
  64. package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
  65. package/Engines/WebGPU/webgpuBundleList.js +4 -0
  66. package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
  67. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
  68. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  69. package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
  70. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  71. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
  72. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  73. package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
  74. package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
  75. package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
  76. package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
  77. package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
  78. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  79. package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
  80. package/Engines/WebGPU/webgpuTextureManager.js +286 -13
  81. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  82. package/Engines/abstractEngine.pure.d.ts +2 -0
  83. package/Engines/abstractEngine.pure.js +7 -3
  84. package/Engines/abstractEngine.pure.js.map +1 -1
  85. package/Engines/constants.d.ts +4 -0
  86. package/Engines/constants.js +4 -0
  87. package/Engines/constants.js.map +1 -1
  88. package/Engines/thinEngine.pure.d.ts +14 -0
  89. package/Engines/thinEngine.pure.js +48 -12
  90. package/Engines/thinEngine.pure.js.map +1 -1
  91. package/Engines/thinNativeEngine.pure.d.ts +1 -0
  92. package/Engines/thinNativeEngine.pure.js +7 -1
  93. package/Engines/thinNativeEngine.pure.js.map +1 -1
  94. package/Engines/thinWebGPUEngine.d.ts +4 -0
  95. package/Engines/thinWebGPUEngine.js +10 -1
  96. package/Engines/thinWebGPUEngine.js.map +1 -1
  97. package/Engines/webgpuEngine.pure.d.ts +5 -2
  98. package/Engines/webgpuEngine.pure.js +48 -13
  99. package/Engines/webgpuEngine.pure.js.map +1 -1
  100. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
  101. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
  102. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
  103. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
  104. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
  105. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
  106. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
  107. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
  108. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
  109. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
  110. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
  111. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
  112. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
  113. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
  114. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
  115. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
  116. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
  117. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
  118. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
  119. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
  120. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +2 -0
  121. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +4 -0
  122. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  123. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
  124. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +53 -10
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
  129. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
  130. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
  131. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
  132. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
  133. package/FlowGraph/flowGraph.d.ts +4 -0
  134. package/FlowGraph/flowGraph.js +38 -7
  135. package/FlowGraph/flowGraph.js.map +1 -1
  136. package/FlowGraph/flowGraphBlock.js +3 -0
  137. package/FlowGraph/flowGraphBlock.js.map +1 -1
  138. package/FlowGraph/flowGraphConnection.d.ts +7 -0
  139. package/FlowGraph/flowGraphConnection.js +7 -0
  140. package/FlowGraph/flowGraphConnection.js.map +1 -1
  141. package/FlowGraph/flowGraphContext.d.ts +2 -1
  142. package/FlowGraph/flowGraphContext.js +4 -3
  143. package/FlowGraph/flowGraphContext.js.map +1 -1
  144. package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
  145. package/FlowGraph/flowGraphCoordinator.js +47 -16
  146. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  147. package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
  148. package/FlowGraph/flowGraphEventBlock.js +7 -0
  149. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  150. package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
  151. package/FlowGraph/flowGraphHostResolver.js.map +1 -1
  152. package/FlowGraph/flowGraphParser.js +60 -2
  153. package/FlowGraph/flowGraphParser.js.map +1 -1
  154. package/FlowGraph/serialization.d.ts +2 -0
  155. package/FlowGraph/serialization.js +10 -22
  156. package/FlowGraph/serialization.js.map +1 -1
  157. package/FlowGraph/typeDefinitions.d.ts +8 -0
  158. package/FlowGraph/typeDefinitions.js.map +1 -1
  159. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
  160. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
  161. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
  162. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
  163. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
  164. package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
  165. package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
  166. package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
  167. package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
  168. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
  169. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  170. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
  171. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
  172. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
  174. package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
  175. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  176. package/FrameGraph/Node/Blocks/index.js +1 -0
  177. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  178. package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
  179. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  180. package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
  181. package/FrameGraph/Node/Blocks/pure.js +1 -0
  182. package/FrameGraph/Node/Blocks/pure.js.map +1 -1
  183. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
  184. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
  185. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  186. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  187. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  188. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
  189. package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
  190. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
  191. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  192. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
  193. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
  194. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
  195. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
  196. package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
  197. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
  198. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +69 -33
  199. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  200. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
  201. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  202. package/FrameGraph/frameGraphObjectList.d.ts +6 -1
  203. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  204. package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
  205. package/FrameGraph/frameGraphRenderContext.js +5 -5
  206. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  207. package/FrameGraph/index.d.ts +1 -0
  208. package/FrameGraph/index.js +1 -0
  209. package/FrameGraph/index.js.map +1 -1
  210. package/FrameGraph/pure.d.ts +1 -0
  211. package/FrameGraph/pure.js +1 -0
  212. package/FrameGraph/pure.js.map +1 -1
  213. package/Inputs/scene.inputManager.d.ts +4 -0
  214. package/Inputs/scene.inputManager.js +50 -8
  215. package/Inputs/scene.inputManager.js.map +1 -1
  216. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +5 -5
  217. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
  218. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +5 -5
  219. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  220. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
  221. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +151 -47
  222. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  223. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
  224. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  225. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
  226. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  227. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
  228. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  229. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
  230. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  231. package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
  232. package/Materials/Node/nodeMaterial.pure.js +4 -0
  233. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  234. package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
  235. package/Materials/Node/nodeMaterialBuildState.js +25 -3
  236. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  237. package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
  238. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
  239. package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +13 -14
  240. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +6 -6
  241. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  242. package/Materials/Textures/baseTexture.pure.js +3 -0
  243. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  244. package/Materials/Textures/cubeTexture.pure.js +1 -1
  245. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  246. package/Materials/Textures/internalTexture.d.ts +8 -1
  247. package/Materials/Textures/internalTexture.js +9 -2
  248. package/Materials/Textures/internalTexture.js.map +1 -1
  249. package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
  250. package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
  251. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  252. package/Materials/Textures/rawTexture3D.js +1 -1
  253. package/Materials/Textures/rawTexture3D.js.map +1 -1
  254. package/Materials/Textures/textureHelper.functions.d.ts +14 -0
  255. package/Materials/Textures/textureHelper.functions.js +24 -0
  256. package/Materials/Textures/textureHelper.functions.js.map +1 -1
  257. package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
  258. package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
  259. package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
  260. package/Materials/index.d.ts +1 -0
  261. package/Materials/index.js +1 -0
  262. package/Materials/index.js.map +1 -1
  263. package/Materials/materialHelper.geometryrendering.d.ts +46 -1
  264. package/Materials/materialHelper.geometryrendering.js +105 -8
  265. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  266. package/Materials/prepass.defines.d.ts +2 -0
  267. package/Materials/prepass.defines.js +2 -0
  268. package/Materials/prepass.defines.js.map +1 -1
  269. package/Materials/pure.d.ts +1 -0
  270. package/Materials/pure.js +1 -0
  271. package/Materials/pure.js.map +1 -1
  272. package/Materials/standardMaterial.pure.d.ts +2 -0
  273. package/Materials/standardMaterial.pure.js +6 -3
  274. package/Materials/standardMaterial.pure.js.map +1 -1
  275. package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
  276. package/Meshes/Builders/polygonBuilder.pure.js +4 -1
  277. package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
  278. package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
  279. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
  280. package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
  281. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -14
  282. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +20 -24
  283. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  284. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -0
  285. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +11 -4
  286. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  287. package/Meshes/abstractMesh.pure.d.ts +18 -0
  288. package/Meshes/abstractMesh.pure.js +22 -0
  289. package/Meshes/abstractMesh.pure.js.map +1 -1
  290. package/Meshes/index.d.ts +1 -0
  291. package/Meshes/index.js +1 -0
  292. package/Meshes/index.js.map +1 -1
  293. package/Meshes/instancedMesh.pure.d.ts +5 -0
  294. package/Meshes/instancedMesh.pure.js +12 -0
  295. package/Meshes/instancedMesh.pure.js.map +1 -1
  296. package/Meshes/mesh.pure.js +23 -8
  297. package/Meshes/mesh.pure.js.map +1 -1
  298. package/Meshes/meshBlendingTag.d.ts +47 -0
  299. package/Meshes/meshBlendingTag.js +64 -0
  300. package/Meshes/meshBlendingTag.js.map +1 -0
  301. package/Meshes/polygonMesh.js +2 -2
  302. package/Meshes/polygonMesh.js.map +1 -1
  303. package/Meshes/pure.d.ts +1 -0
  304. package/Meshes/pure.js +1 -0
  305. package/Meshes/pure.js.map +1 -1
  306. package/Misc/fileTools.pure.js +21 -0
  307. package/Misc/fileTools.pure.js.map +1 -1
  308. package/Misc/snapshotRenderingHelper.js +2 -2
  309. package/Misc/snapshotRenderingHelper.js.map +1 -1
  310. package/Misc/tools.pure.js +1 -1
  311. package/Misc/tools.pure.js.map +1 -1
  312. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  313. package/Particles/gpuParticleSystem.pure.js +89 -28
  314. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  315. package/Particles/thinParticleSystem.pure.d.ts +2 -0
  316. package/Particles/thinParticleSystem.pure.js +84 -19
  317. package/Particles/thinParticleSystem.pure.js.map +1 -1
  318. package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
  319. package/Particles/webgl2ParticleSystem.pure.js +12 -4
  320. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  321. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
  322. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
  323. package/PostProcesses/index.d.ts +2 -0
  324. package/PostProcesses/index.js +2 -0
  325. package/PostProcesses/index.js.map +1 -1
  326. package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
  327. package/PostProcesses/meshBlendingBlueNoise.js +77 -0
  328. package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
  329. package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
  330. package/PostProcesses/meshBlendingPostProcess.js +315 -0
  331. package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
  332. package/PostProcesses/pure.d.ts +2 -0
  333. package/PostProcesses/pure.js +2 -0
  334. package/PostProcesses/pure.js.map +1 -1
  335. package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
  336. package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
  337. package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
  338. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
  339. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  340. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +8 -8
  341. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  342. package/Rendering/boundingBoxRenderer.pure.js +2 -1
  343. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  344. package/Rendering/depthRenderer.pure.js +3 -4
  345. package/Rendering/depthRenderer.pure.js.map +1 -1
  346. package/Rendering/edgesRenderer.pure.d.ts +4 -2
  347. package/Rendering/edgesRenderer.pure.js +11 -2
  348. package/Rendering/edgesRenderer.pure.js.map +1 -1
  349. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +10 -0
  350. package/Rendering/fluidRenderer/fluidRenderingObject.js +20 -0
  351. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  352. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +9 -3
  353. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +14 -9
  354. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  355. package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
  356. package/Rendering/geometryBufferRenderer.pure.js +126 -17
  357. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  358. package/Rendering/objectRenderer.d.ts +7 -1
  359. package/Rendering/objectRenderer.js +45 -7
  360. package/Rendering/objectRenderer.js.map +1 -1
  361. package/Rendering/outlineRenderer.pure.js +6 -2
  362. package/Rendering/outlineRenderer.pure.js.map +1 -1
  363. package/Rendering/renderingManager.d.ts +1 -1
  364. package/Rendering/renderingManager.js +5 -4
  365. package/Rendering/renderingManager.js.map +1 -1
  366. package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  367. package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
  368. package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  369. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
  370. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  371. package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
  372. package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
  373. package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  374. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
  375. package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
  376. package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
  377. package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  378. package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
  379. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  380. package/Shaders/ShadersInclude/pbrDebug.js +6 -2
  381. package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
  382. package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
  383. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  384. package/Shaders/default.fragment.js +31 -40
  385. package/Shaders/default.fragment.js.map +1 -1
  386. package/Shaders/depthOfField.fragment.js +13 -9
  387. package/Shaders/depthOfField.fragment.js.map +1 -1
  388. package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
  389. package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
  390. package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
  391. package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
  392. package/Shaders/gaussianSplatting.fragment.js +63 -3
  393. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  394. package/Shaders/gaussianSplatting.vertex.js +80 -0
  395. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  396. package/Shaders/geometry.fragment.js +17 -11
  397. package/Shaders/geometry.fragment.js.map +1 -1
  398. package/Shaders/gpuRenderParticles.fragment.js +43 -1
  399. package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
  400. package/Shaders/gpuRenderParticles.vertex.js +96 -16
  401. package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
  402. package/Shaders/meshBlending.fragment.d.ts +5 -0
  403. package/Shaders/meshBlending.fragment.js +519 -0
  404. package/Shaders/meshBlending.fragment.js.map +1 -0
  405. package/Shaders/particles.fragment.js +43 -1
  406. package/Shaders/particles.fragment.js.map +1 -1
  407. package/Shaders/particles.vertex.js +84 -3
  408. package/Shaders/particles.vertex.js.map +1 -1
  409. package/Shaders/sprites.fragment.js +52 -2
  410. package/Shaders/sprites.fragment.js.map +1 -1
  411. package/Shaders/sprites.vertex.js +62 -1
  412. package/Shaders/sprites.vertex.js.map +1 -1
  413. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
  414. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
  415. package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
  416. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
  417. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
  418. package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
  419. package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
  420. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  421. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
  422. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
  423. package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
  424. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
  425. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
  426. package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
  427. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
  428. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
  429. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  430. package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
  431. package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
  432. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
  433. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  434. package/ShadersWGSL/default.fragment.js +17 -48
  435. package/ShadersWGSL/default.fragment.js.map +1 -1
  436. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
  437. package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
  438. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
  439. package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
  440. package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
  441. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  442. package/ShadersWGSL/gaussianSplatting.vertex.js +80 -0
  443. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  444. package/ShadersWGSL/geometry.fragment.js +37 -2
  445. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  446. package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
  447. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
  448. package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
  449. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
  450. package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
  451. package/ShadersWGSL/meshBlending.fragment.js +576 -0
  452. package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
  453. package/ShadersWGSL/openpbr.fragment.js +2 -1
  454. package/ShadersWGSL/openpbr.fragment.js.map +1 -1
  455. package/ShadersWGSL/particles.fragment.js +45 -1
  456. package/ShadersWGSL/particles.fragment.js.map +1 -1
  457. package/ShadersWGSL/particles.vertex.js +86 -4
  458. package/ShadersWGSL/particles.vertex.js.map +1 -1
  459. package/ShadersWGSL/pbr.fragment.js +2 -1
  460. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  461. package/ShadersWGSL/sprites.fragment.js +56 -2
  462. package/ShadersWGSL/sprites.fragment.js.map +1 -1
  463. package/ShadersWGSL/sprites.vertex.js +62 -1
  464. package/ShadersWGSL/sprites.vertex.js.map +1 -1
  465. package/Sprites/spriteManager.d.ts +13 -0
  466. package/Sprites/spriteManager.js +15 -0
  467. package/Sprites/spriteManager.js.map +1 -1
  468. package/Sprites/spriteRenderer.d.ts +24 -1
  469. package/Sprites/spriteRenderer.js +368 -50
  470. package/Sprites/spriteRenderer.js.map +1 -1
  471. package/Sprites/thinSprite.d.ts +4 -0
  472. package/Sprites/thinSprite.js +4 -0
  473. package/Sprites/thinSprite.js.map +1 -1
  474. package/States/alphaCullingState.d.ts +3 -1
  475. package/States/alphaCullingState.js +18 -3
  476. package/States/alphaCullingState.js.map +1 -1
  477. package/XR/webXRDefaultExperience.d.ts +5 -1
  478. package/XR/webXRDefaultExperience.js.map +1 -1
  479. package/XR/webXREnterExitUI.d.ts +2 -1
  480. package/XR/webXREnterExitUI.js.map +1 -1
  481. package/package.json +1 -1
  482. package/scene.pure.d.ts +23 -0
  483. package/scene.pure.js +35 -0
  484. package/scene.pure.js.map +1 -1
@@ -171,7 +171,13 @@ export class AnimationGroup {
171
171
  if (this._speedRatio === value) {
172
172
  return;
173
173
  }
174
+ if (this._animatables[0]) {
175
+ this._retainedCurrentFrame = this._animatables[0].masterFrame;
176
+ }
177
+ this._updateVirtualFrame();
174
178
  this._speedRatio = value;
179
+ this._virtualFrameStart = this._virtualFrame;
180
+ this._virtualFrameStartTime = this._scene._animationTime;
175
181
  for (let index = 0; index < this._animatables.length; index++) {
176
182
  const animatable = this._animatables[index];
177
183
  animatable.speedRatio = this._speedRatio;
@@ -334,6 +340,17 @@ export class AnimationGroup {
334
340
  this._to = -Number.MAX_VALUE;
335
341
  this._speedRatio = 1;
336
342
  this._loopAnimation = false;
343
+ this._virtualFrame = 0;
344
+ this._virtualFrameStart = 0;
345
+ this._virtualFrameStartTime = 0;
346
+ this._virtualFrameRate = 60;
347
+ this._virtualFrameDirection = 1;
348
+ this._virtualFrameInitial = 0;
349
+ this._virtualFrameEnd = 0;
350
+ this._virtualSamplingObserver = null;
351
+ this._usesVirtualSampling = false;
352
+ this._retainedCurrentFrame = 0;
353
+ this._isStopping = false;
337
354
  this._isAdditive = false;
338
355
  this._weight = -1;
339
356
  this._playOrder = 0;
@@ -492,10 +509,47 @@ export class AnimationGroup {
492
509
  * @returns the current animation group
493
510
  */
494
511
  start(loop = false, speedRatio = 1, from, to, isAdditive, predicate) {
512
+ return this._start(loop, speedRatio, from, to, isAdditive, false, predicate);
513
+ }
514
+ /**
515
+ * Starts all animations using an unbounded requested timeline mapped to the animation's
516
+ * effective keyframe range.
517
+ * @param loop defines if animations must loop
518
+ * @param speedRatio defines the ratio to apply to animation speed
519
+ * @param from defines the requested start frame
520
+ * @param to defines the requested end frame
521
+ * @param isAdditive defines the additive state for the resulting animatables
522
+ * @returns the current animation group
523
+ */
524
+ startWithVirtualTimeline(loop = false, speedRatio = 1, from, to, isAdditive) {
525
+ return this._start(loop, speedRatio, from, to, isAdditive, true);
526
+ }
527
+ _start(loop, speedRatio, from, to, isAdditive, useVirtualTimeline, predicate) {
495
528
  if (this._isStarted || this._targetedAnimations.length === 0) {
496
529
  return this;
497
530
  }
498
531
  this._loopAnimation = loop;
532
+ const effectiveFrom = from ?? this._from;
533
+ const effectiveTo = to ?? this._to;
534
+ this._virtualFrame = effectiveFrom;
535
+ this._virtualFrameStart = effectiveFrom;
536
+ this._virtualFrameStartTime = this._scene._animationTime;
537
+ this._virtualFrameRate = this._targetedAnimations[0]?.animation.framePerSecond ?? 60;
538
+ this._virtualFrameDirection = effectiveTo < effectiveFrom ? -1 : 1;
539
+ this._virtualFrameInitial = effectiveFrom;
540
+ this._virtualFrameEnd = effectiveTo;
541
+ const effectiveSamplingFrom = useVirtualTimeline ? this._mapVirtualFrame(effectiveFrom) : effectiveFrom;
542
+ const effectiveSamplingTo = useVirtualTimeline
543
+ ? Number.isFinite(effectiveTo)
544
+ ? this._mapVirtualFrame(effectiveTo)
545
+ : effectiveTo < effectiveFrom
546
+ ? 0
547
+ : this._to
548
+ : effectiveTo;
549
+ this._retainedCurrentFrame = effectiveSamplingFrom;
550
+ this._usesVirtualSampling = useVirtualTimeline && (effectiveSamplingFrom !== effectiveFrom || effectiveSamplingTo !== effectiveTo);
551
+ const samplingFrom = this._usesVirtualSampling ? (this._virtualFrameDirection > 0 ? 0 : this._to) : effectiveSamplingFrom;
552
+ const samplingTo = this._usesVirtualSampling ? (this._virtualFrameDirection > 0 ? this._to : 0) : effectiveSamplingTo;
499
553
  this._shouldStart = false;
500
554
  this._animationLoopCount = 0;
501
555
  this._animationLoopFlags.length = 0;
@@ -504,7 +558,7 @@ export class AnimationGroup {
504
558
  if (predicate && !predicate(targetedAnimation)) {
505
559
  continue;
506
560
  }
507
- const animatable = this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this._from, to !== undefined ? to : this._to, loop, speedRatio, undefined, undefined, isAdditive !== undefined ? isAdditive : this._isAdditive);
561
+ const animatable = this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], samplingFrom, samplingTo, this._usesVirtualSampling || loop, speedRatio, undefined, undefined, isAdditive !== undefined ? isAdditive : this._isAdditive);
508
562
  animatable.weight = this._weight;
509
563
  animatable.playOrder = this._playOrder;
510
564
  animatable.onAnimationEnd = () => {
@@ -513,12 +567,20 @@ export class AnimationGroup {
513
567
  };
514
568
  this._processLoop(animatable, targetedAnimation, index);
515
569
  this._animatables.push(animatable);
570
+ if (this._usesVirtualSampling && this._isTargetRetainedByMask(animatable.target)) {
571
+ animatable.goToFrame(effectiveSamplingFrom);
572
+ }
516
573
  }
517
574
  this.syncWithMask();
518
575
  this._scene.sortActiveAnimatables();
519
576
  this._speedRatio = speedRatio;
520
577
  this._isStarted = true;
521
578
  this._isPaused = false;
579
+ if (this._usesVirtualSampling) {
580
+ this._virtualSamplingObserver = this._scene.onAfterAnimationsObservable.add(() => {
581
+ this._sampleVirtualTimeline();
582
+ });
583
+ }
522
584
  this.onAnimationGroupPlayObservable.notifyObservers(this);
523
585
  return this;
524
586
  }
@@ -530,6 +592,7 @@ export class AnimationGroup {
530
592
  if (!this._isStarted) {
531
593
  return this;
532
594
  }
595
+ this._updateVirtualFrame();
533
596
  this._isPaused = true;
534
597
  for (let index = 0; index < this._animatables.length; index++) {
535
598
  const animatable = this._animatables[index];
@@ -573,6 +636,13 @@ export class AnimationGroup {
573
636
  const animatable = this._animatables[index];
574
637
  animatable.reset();
575
638
  }
639
+ this._virtualFrame = this._usesVirtualSampling ? this._virtualFrameInitial : (this._animatables[0]?.fromFrame ?? 0);
640
+ this._virtualFrameStart = this._virtualFrame;
641
+ this._virtualFrameStartTime = this._scene._animationTime;
642
+ if (this._usesVirtualSampling) {
643
+ this._retainedCurrentFrame = this._mapVirtualFrame(this._virtualFrame);
644
+ this._goToFrameWithMask(this._retainedCurrentFrame);
645
+ }
576
646
  return this;
577
647
  }
578
648
  /**
@@ -588,6 +658,8 @@ export class AnimationGroup {
588
658
  animatable.restart();
589
659
  }
590
660
  this.syncWithMask();
661
+ this._virtualFrameStart = this._virtualFrame;
662
+ this._virtualFrameStartTime = this._scene._animationTime;
591
663
  this._isPaused = false;
592
664
  this.onAnimationGroupPlayObservable.notifyObservers(this);
593
665
  return this;
@@ -601,6 +673,12 @@ export class AnimationGroup {
601
673
  if (!this._isStarted) {
602
674
  return this;
603
675
  }
676
+ if (this._animatables[0]) {
677
+ this._retainedCurrentFrame = this._animatables[0].masterFrame;
678
+ }
679
+ this._updateVirtualFrame();
680
+ this._removeVirtualSamplingObserver();
681
+ this._isStopping = true;
604
682
  const list = this._animatables.slice();
605
683
  for (let index = 0; index < list.length; index++) {
606
684
  list[index].stop(undefined, undefined, true, skipOnAnimationEnd);
@@ -621,6 +699,8 @@ export class AnimationGroup {
621
699
  }
622
700
  this._scene._activeAnimatables.length = curIndex;
623
701
  this._isStarted = false;
702
+ this._isStopping = false;
703
+ this._usesVirtualSampling = false;
624
704
  return this;
625
705
  }
626
706
  /**
@@ -670,12 +750,113 @@ export class AnimationGroup {
670
750
  return this;
671
751
  }
672
752
  /**
673
- * Helper to get the current frame. This will return 0 if the AnimationGroup is not running, and it might return wrong results if multiple animations are running in different frames.
753
+ * Helper to get the current frame. This returns 0 when the AnimationGroup is
754
+ * not running and might be inaccurate when animations use different frames.
674
755
  * @returns current animation frame.
675
756
  */
676
757
  getCurrentFrame() {
677
758
  return this.animatables[0]?.masterFrame || 0;
678
759
  }
760
+ /**
761
+ * Gets the last effective frame, retaining it after the group stops.
762
+ * @returns current or retained effective animation frame
763
+ */
764
+ getRetainedCurrentFrame() {
765
+ if (this.animatables[0]) {
766
+ this._retainedCurrentFrame = this.animatables[0].masterFrame;
767
+ }
768
+ return this._retainedCurrentFrame;
769
+ }
770
+ /**
771
+ * Gets the current frame on the unbounded timeline requested by the caller.
772
+ * Unlike {@link getCurrentFrame}, this value is not clamped or wrapped by the
773
+ * animation's keyframe range and is retained after the group stops.
774
+ * @returns the current virtual animation frame
775
+ */
776
+ getVirtualCurrentFrame() {
777
+ this._updateVirtualFrame();
778
+ return this._virtualFrame;
779
+ }
780
+ /**
781
+ * Returns whether the virtual timeline crossed the requested frame.
782
+ * @param frame virtual frame to test
783
+ * @returns true when the frame was reached in the playback direction
784
+ */
785
+ isVirtualFrameReached(frame) {
786
+ const current = this.getVirtualCurrentFrame();
787
+ return this._virtualFrameDirection > 0 ? current >= frame : current <= frame;
788
+ }
789
+ /**
790
+ * Returns whether a frame is inside the requested start/end interval.
791
+ * The end frame is excluded because natural completion takes precedence.
792
+ * @param frame virtual frame to test
793
+ * @returns true when a scheduled stop may occur at the frame
794
+ */
795
+ isValidVirtualStopFrame(frame) {
796
+ return this._virtualFrameDirection > 0
797
+ ? frame >= this._virtualFrameInitial && frame < this._virtualFrameEnd
798
+ : frame <= this._virtualFrameInitial && frame > this._virtualFrameEnd;
799
+ }
800
+ /**
801
+ * Snaps both retained playheads to an exact virtual timeline position.
802
+ * @param frame virtual frame to retain
803
+ */
804
+ setVirtualCurrentFrame(frame) {
805
+ this._virtualFrame = frame;
806
+ this._virtualFrameStart = frame;
807
+ this._virtualFrameStartTime = this._scene._animationTime;
808
+ this._retainedCurrentFrame = this._mapVirtualFrame(frame);
809
+ this._goToFrameWithMask(this._retainedCurrentFrame);
810
+ }
811
+ _updateVirtualFrame() {
812
+ if (!this._isStarted || this._isPaused) {
813
+ return;
814
+ }
815
+ const elapsedSeconds = (this._scene._animationTime - this._virtualFrameStartTime) / 1000;
816
+ this._virtualFrame = this._virtualFrameStart + elapsedSeconds * this._virtualFrameRate * this._speedRatio * this._virtualFrameDirection;
817
+ }
818
+ _sampleVirtualTimeline() {
819
+ this._updateVirtualFrame();
820
+ const reachedEnd = !this._loopAnimation &&
821
+ Number.isFinite(this._virtualFrameEnd) &&
822
+ (this._virtualFrameDirection > 0 ? this._virtualFrame >= this._virtualFrameEnd : this._virtualFrame <= this._virtualFrameEnd);
823
+ if (reachedEnd) {
824
+ this.setVirtualCurrentFrame(this._virtualFrameEnd);
825
+ this._removeVirtualSamplingObserver();
826
+ this.stop();
827
+ return;
828
+ }
829
+ this._retainedCurrentFrame = this._mapVirtualFrame(this._virtualFrame);
830
+ this._goToFrameWithMask(this._retainedCurrentFrame);
831
+ }
832
+ _goToFrameWithMask(frame) {
833
+ for (let index = 0; index < this._animatables.length; index++) {
834
+ const animatable = this._animatables[index];
835
+ if (this._isTargetRetainedByMask(animatable.target)) {
836
+ animatable.goToFrame(frame);
837
+ }
838
+ }
839
+ }
840
+ _isTargetRetainedByMask(target) {
841
+ return !this._mask || this._mask.disabled || this._mask.retainsTarget(target.name);
842
+ }
843
+ _removeVirtualSamplingObserver() {
844
+ if (this._virtualSamplingObserver) {
845
+ this._scene.onAfterAnimationsObservable.remove(this._virtualSamplingObserver);
846
+ this._virtualSamplingObserver = null;
847
+ }
848
+ }
849
+ _mapVirtualFrame(frame) {
850
+ const maximum = this._to;
851
+ if (maximum === 0) {
852
+ return 0;
853
+ }
854
+ if (!Number.isFinite(frame) || !Number.isFinite(maximum) || maximum < 0) {
855
+ return frame;
856
+ }
857
+ const iteration = frame > 0 ? Math.ceil((frame - maximum) / maximum) : Math.floor(frame / maximum);
858
+ return frame - iteration * maximum;
859
+ }
679
860
  /**
680
861
  * Dispose all associated resources
681
862
  */
@@ -704,6 +885,10 @@ export class AnimationGroup {
704
885
  this._isDisposed = true;
705
886
  }
706
887
  _checkAnimationGroupEnded(animatable, skipOnAnimationEnd = false) {
888
+ this._updateVirtualFrame();
889
+ if (!skipOnAnimationEnd && !this._isStopping) {
890
+ this._retainedCurrentFrame = animatable.masterFrame;
891
+ }
707
892
  // animatable should be taken out of the array
708
893
  const idx = this._animatables.indexOf(animatable);
709
894
  if (idx > -1) {
@@ -711,6 +896,10 @@ export class AnimationGroup {
711
896
  }
712
897
  // all animatables were removed? animation group ended!
713
898
  if (this._animatables.length === this._targetedAnimations.length - this._numActiveAnimatables) {
899
+ if (!skipOnAnimationEnd && !this._isStopping && Number.isFinite(this._virtualFrameEnd)) {
900
+ this._virtualFrame = this._virtualFrameEnd;
901
+ this._retainedCurrentFrame = this._mapVirtualFrame(this._virtualFrameEnd);
902
+ }
714
903
  this._isStarted = false;
715
904
  if (!skipOnAnimationEnd) {
716
905
  this.onAnimationGroupEndObservable.notifyObservers(this);