@babylonjs/core 7.27.2 → 7.28.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.
- package/Animations/animatable.core.d.ts +198 -0
- package/Animations/animatable.core.js +893 -0
- package/Animations/animatable.core.js.map +1 -0
- package/Animations/animatable.d.ts +4 -213
- package/Animations/animatable.js +5 -886
- package/Animations/animatable.js.map +1 -1
- package/Animations/animationGroup.d.ts +1 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.d.ts +1 -0
- package/Animations/runtimeAnimation.js +25 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +0 -4
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/skeleton.d.ts +1 -1
- package/Bones/skeleton.js.map +1 -1
- package/Culling/ray.core.d.ts +328 -0
- package/Culling/ray.core.js +931 -0
- package/Culling/ray.core.js.map +1 -0
- package/Culling/ray.d.ts +1 -220
- package/Culling/ray.js +12 -791
- package/Culling/ray.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +3 -2
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +1 -0
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/index.d.ts +1 -0
- package/Engines/index.js +1 -0
- package/Engines/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/Inputs/scene.inputManager.js +2 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayerSceneComponent.d.ts +0 -6
- package/Layers/effectLayerSceneComponent.js +0 -1
- package/Layers/effectLayerSceneComponent.js.map +1 -1
- package/Layers/layerSceneComponent.d.ts +0 -9
- package/Layers/layerSceneComponent.js +0 -1
- package/Layers/layerSceneComponent.js.map +1 -1
- package/LensFlares/lensFlareSystemSceneComponent.d.ts +0 -5
- package/LensFlares/lensFlareSystemSceneComponent.js +0 -1
- package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
- package/Lights/light.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.d.ts +0 -10
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js +0 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInterceptorBlock.d.ts +36 -0
- package/Meshes/Node/Blocks/geometryInterceptorBlock.js +60 -0
- package/Meshes/Node/Blocks/geometryInterceptorBlock.js.map +1 -0
- package/Meshes/Node/index.d.ts +1 -0
- package/Meshes/Node/index.js +1 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/WebGPU/webgpuDataBuffer.d.ts +3 -1
- package/Meshes/WebGPU/webgpuDataBuffer.js +6 -1
- package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
- package/Misc/assetsManager.d.ts +1 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/tools.js +1 -13
- package/Misc/tools.js.map +1 -1
- package/Sprites/spriteSceneComponent.d.ts +1 -1
- package/Sprites/spriteSceneComponent.js +4 -4
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/assetContainer.d.ts +1 -1
- package/assetContainer.js.map +1 -1
- package/import.helper.d.ts +5 -0
- package/import.helper.js +6 -0
- package/import.helper.js.map +1 -0
- package/node.d.ts +1 -1
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +41 -4
- package/scene.js +25 -6
- package/scene.js.map +1 -1
package/Engines/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./WebGPU/webgpuCacheBindGroups";
|
|
|
22
22
|
export * from "./WebGPU/webgpuCacheSampler";
|
|
23
23
|
export * from "./WebGPU/webgpuDrawContext";
|
|
24
24
|
export * from "./WebGPU/webgpuRenderTargetWrapper";
|
|
25
|
+
export * from "./WebGPU/webgpuShaderProcessor";
|
|
25
26
|
export * from "./WebGPU/webgpuTintWASM";
|
|
26
27
|
export * from "./WebGL/webGL2ShaderProcessors";
|
|
27
28
|
export * from "./nativeEngine";
|
package/Engines/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./WebGPU/webgpuCacheBindGroups.js";
|
|
|
23
23
|
export * from "./WebGPU/webgpuCacheSampler.js";
|
|
24
24
|
export * from "./WebGPU/webgpuDrawContext.js";
|
|
25
25
|
export * from "./WebGPU/webgpuRenderTargetWrapper.js";
|
|
26
|
+
export * from "./WebGPU/webgpuShaderProcessor.js";
|
|
26
27
|
export * from "./WebGPU/webgpuTintWASM.js";
|
|
27
28
|
export * from "./WebGL/webGL2ShaderProcessors.js";
|
|
28
29
|
export * from "./nativeEngine.js";
|
package/Engines/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./constants\";\r\nexport * from \"./engineCapabilities\";\r\nexport * from \"./instancingAttributeInfo\";\r\nexport * from \"./abstractEngine\";\r\nexport * from \"./thinEngine\";\r\nexport * from \"./engine\";\r\nexport * from \"./engineStore\";\r\nexport * from \"./nullEngine\";\r\nexport * from \"./AbstractEngine/index\";\r\nexport * from \"./Extensions/index\";\r\nexport * from \"./Native/index\";\r\nexport * from \"./WebGPU/Extensions/index\";\r\nexport * from \"./IPipelineContext\";\r\nexport * from \"./ICanvas\";\r\nexport * from \"./WebGL/webGLPipelineContext\";\r\nexport * from \"./WebGL/webGLHardwareTexture\";\r\nexport * from \"./WebGPU/webgpuConstants\";\r\nexport * from \"./webgpuEngine\";\r\nexport * from \"./WebGPU/webgpuCacheRenderPipeline\";\r\nexport * from \"./WebGPU/webgpuCacheRenderPipelineTree\";\r\nexport * from \"./WebGPU/webgpuCacheBindGroups\";\r\nexport * from \"./WebGPU/webgpuCacheSampler\";\r\nexport * from \"./WebGPU/webgpuDrawContext\";\r\nexport * from \"./WebGPU/webgpuRenderTargetWrapper\";\r\nexport * from \"./WebGPU/webgpuTintWASM\";\r\nexport * from \"./WebGL/webGL2ShaderProcessors\";\r\nexport * from \"./nativeEngine\";\r\nexport * from \"./Processors/shaderCodeInliner\";\r\nexport * from \"./performanceConfigurator\";\r\nexport * from \"./engineFeatures\";\r\nexport * from \"./engineFactory\";\r\nexport * from \"./IMaterialContext\";\r\nexport * from \"./IDrawContext\";\r\nexport * from \"./shaderStore\";\r\nexport * from \"./renderTargetWrapper\";\r\nexport * from \"./Processors/iShaderProcessor\";\r\nexport * from \"./engine.common\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./constants\";\r\nexport * from \"./engineCapabilities\";\r\nexport * from \"./instancingAttributeInfo\";\r\nexport * from \"./abstractEngine\";\r\nexport * from \"./thinEngine\";\r\nexport * from \"./engine\";\r\nexport * from \"./engineStore\";\r\nexport * from \"./nullEngine\";\r\nexport * from \"./AbstractEngine/index\";\r\nexport * from \"./Extensions/index\";\r\nexport * from \"./Native/index\";\r\nexport * from \"./WebGPU/Extensions/index\";\r\nexport * from \"./IPipelineContext\";\r\nexport * from \"./ICanvas\";\r\nexport * from \"./WebGL/webGLPipelineContext\";\r\nexport * from \"./WebGL/webGLHardwareTexture\";\r\nexport * from \"./WebGPU/webgpuConstants\";\r\nexport * from \"./webgpuEngine\";\r\nexport * from \"./WebGPU/webgpuCacheRenderPipeline\";\r\nexport * from \"./WebGPU/webgpuCacheRenderPipelineTree\";\r\nexport * from \"./WebGPU/webgpuCacheBindGroups\";\r\nexport * from \"./WebGPU/webgpuCacheSampler\";\r\nexport * from \"./WebGPU/webgpuDrawContext\";\r\nexport * from \"./WebGPU/webgpuRenderTargetWrapper\";\r\nexport * from \"./WebGPU/webgpuShaderProcessor\";\r\nexport * from \"./WebGPU/webgpuTintWASM\";\r\nexport * from \"./WebGL/webGL2ShaderProcessors\";\r\nexport * from \"./nativeEngine\";\r\nexport * from \"./Processors/shaderCodeInliner\";\r\nexport * from \"./performanceConfigurator\";\r\nexport * from \"./engineFeatures\";\r\nexport * from \"./engineFactory\";\r\nexport * from \"./IMaterialContext\";\r\nexport * from \"./IDrawContext\";\r\nexport * from \"./shaderStore\";\r\nexport * from \"./renderTargetWrapper\";\r\nexport * from \"./Processors/iShaderProcessor\";\r\nexport * from \"./engine.common\";\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
4
|
-
import type { Animatable } from "../../../../Animations/animatable";
|
|
4
|
+
import type { Animatable } from "../../../../Animations/animatable.core";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,oCAAoC;IAMlF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,uBAAuB,CAAC;IACnC,CAAC;CACJ;AACD,aAAa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { Animatable } from \"../../../../Animations/animatable\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that pauses a running animation\r\n */\r\nexport class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The animation to pause.\r\n */\r\n public readonly animationToPause: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToPause = this.registerDataInput(\"animationToPause\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToPauseValue = this.animationToPause.getValue(context);\r\n animationToPauseValue.pause();\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return \"FGPauseAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPauseAnimationBlock\", FlowGraphPauseAnimationBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,oCAAoC;IAMlF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,uBAAuB,CAAC;IACnC,CAAC;CACJ;AACD,aAAa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { Animatable } from \"../../../../Animations/animatable.core\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that pauses a running animation\r\n */\r\nexport class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The animation to pause.\r\n */\r\n public readonly animationToPause: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToPause = this.registerDataInput(\"animationToPause\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToPauseValue = this.animationToPause.getValue(context);\r\n animationToPauseValue.pause();\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return \"FGPauseAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPauseAnimationBlock\", FlowGraphPauseAnimationBlock);\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
|
-
import type { Animatable } from "../../../../Animations/animatable";
|
|
2
|
+
import type { Animatable } from "../../../../Animations/animatable.core";
|
|
3
3
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
4
4
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPlayAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAoB3F;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IA+BzE;IACI;;OAEG;IACa,MAAiD;QAEjE,KAAK,CAAC,MAAM,CAAC,CA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I,EAAE,oBAAoB,CAAkB,IAAI,EAAE,CAAC;QACvG,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SACjC;QACD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,mBAAmB,CAAC,OAAyB;QAChD,MAAM,YAAY,GAAI,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,CAAkB,IAAI,EAAE,CAAC;QACvG,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;SACf;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,2BAA2B,CAAC,SAAS,CAAC;IACjD,CAAC;IAED;;;OAGG;IACa,SAAS,CAAC,sBAA2B,EAAE;QACnD,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAC/D,mBAAmB,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACzE,CAAC;;AAED;;GAEG;AACW,qCAAS,GAAG,sBAAsB,CAAC;AAGrD,aAAa,CAAC,2BAA2B,CAAC,SAAS,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { Animatable } from \"../../../../Animations/animatable\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { IPathToObjectConverter } from \"../../../../ObjectModel/objectModelInterfaces\";\r\nimport { FlowGraphPathConverterComponent } from \"../../../flowGraphPathConverterComponent\";\r\nimport type { IObjectAccessor } from \"../../../typeDefinitions\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path to the target object that will be animated.\r\n */\r\n targetPath: string;\r\n /**\r\n * The path to the animation that will be played.\r\n */\r\n animationPath: string;\r\n /**\r\n * The path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * The substitution inputs for template strings in the target\r\n */\r\n public readonly templateTargetComponent: FlowGraphPathConverterComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathConverterComponent;\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly runningAnimatable: FlowGraphDataConnection<Animatable>;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphPlayAnimationBlockConfiguration\r\n ) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathConverterComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathConverterComponent(config.animationPath, this);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.runningAnimatable = this.registerDataOutput(\"runningAnimatable\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const targetAccessor = this.templateTargetComponent.getAccessor(this.config.pathConverter, context);\r\n const targetValue = targetAccessor.info.getObject(targetAccessor.object);\r\n const animationAccessor = this.templateAnimationComponent.getAccessor(this.config.pathConverter, context);\r\n const animationValue = animationAccessor.info.get(animationAccessor.object);\r\n\r\n if (!targetValue || !animationValue) {\r\n throw new Error(\"Cannot play animation without target or animation\");\r\n }\r\n\r\n const contextAnimatables = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n\r\n // was an animation started on this target already and was just paused? if so, we can unpause it.\r\n const existingAnimatable = this.runningAnimatable.getValue(context);\r\n if (existingAnimatable && existingAnimatable.paused) {\r\n existingAnimatable.restart();\r\n } else {\r\n const scene = context.configuration.scene;\r\n const animatable = scene.beginDirectAnimation(\r\n targetValue,\r\n [animationValue],\r\n this.from.getValue(context),\r\n this.to.getValue(context),\r\n this.loop.getValue(context),\r\n this.speed.getValue(context),\r\n () => this._onAnimationEnd(animatable, context)\r\n );\r\n this.runningAnimatable.setValue(animatable, context);\r\n contextAnimatables.push(animatable);\r\n }\r\n\r\n context._setExecutionVariable(this, \"runningAnimatables\", contextAnimatables);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n private _onAnimationEnd(animatable: Animatable, context: FlowGraphContext) {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n const index = contextAnims.indexOf(animatable);\r\n if (index !== -1) {\r\n contextAnims.splice(index, 1);\r\n }\r\n context._removePendingBlock(this);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n for (const anim of contextAnims) {\r\n anim.stop();\r\n }\r\n context._deleteExecutionVariable(this, \"runningAnimatables\");\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphPlayAnimationBlock.ClassName;\r\n }\r\n\r\n /**\r\n * Serializes the block to a JSON object.\r\n * @param serializationObject the object to serialize to.\r\n */\r\n public override serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath;\r\n serializationObject.config.animationPath = this.config.animationPath;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGPlayAnimationBlock\";\r\n}\r\n\r\nRegisterClass(FlowGraphPlayAnimationBlock.ClassName, FlowGraphPlayAnimationBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphPlayAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,+BAA+B,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,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { Animatable } from \"../../../../Animations/animatable.core\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { IPathToObjectConverter } from \"../../../../ObjectModel/objectModelInterfaces\";\r\nimport { FlowGraphPathConverterComponent } from \"../../../flowGraphPathConverterComponent\";\r\nimport type { IObjectAccessor } from \"../../../typeDefinitions\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The path to the target object that will be animated.\r\n */\r\n targetPath: string;\r\n /**\r\n * The path to the animation that will be played.\r\n */\r\n animationPath: string;\r\n /**\r\n * The path converter to use to convert the path to an object accessor.\r\n */\r\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\r\n}\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * The substitution inputs for template strings in the target\r\n */\r\n public readonly templateTargetComponent: FlowGraphPathConverterComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathConverterComponent;\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly runningAnimatable: FlowGraphDataConnection<Animatable>;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphPlayAnimationBlockConfiguration\r\n ) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathConverterComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathConverterComponent(config.animationPath, this);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.runningAnimatable = this.registerDataOutput(\"runningAnimatable\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const targetAccessor = this.templateTargetComponent.getAccessor(this.config.pathConverter, context);\r\n const targetValue = targetAccessor.info.getObject(targetAccessor.object);\r\n const animationAccessor = this.templateAnimationComponent.getAccessor(this.config.pathConverter, context);\r\n const animationValue = animationAccessor.info.get(animationAccessor.object);\r\n\r\n if (!targetValue || !animationValue) {\r\n throw new Error(\"Cannot play animation without target or animation\");\r\n }\r\n\r\n const contextAnimatables = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n\r\n // was an animation started on this target already and was just paused? if so, we can unpause it.\r\n const existingAnimatable = this.runningAnimatable.getValue(context);\r\n if (existingAnimatable && existingAnimatable.paused) {\r\n existingAnimatable.restart();\r\n } else {\r\n const scene = context.configuration.scene;\r\n const animatable = scene.beginDirectAnimation(\r\n targetValue,\r\n [animationValue],\r\n this.from.getValue(context),\r\n this.to.getValue(context),\r\n this.loop.getValue(context),\r\n this.speed.getValue(context),\r\n () => this._onAnimationEnd(animatable, context)\r\n );\r\n this.runningAnimatable.setValue(animatable, context);\r\n contextAnimatables.push(animatable);\r\n }\r\n\r\n context._setExecutionVariable(this, \"runningAnimatables\", contextAnimatables);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n private _onAnimationEnd(animatable: Animatable, context: FlowGraphContext) {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n const index = contextAnims.indexOf(animatable);\r\n if (index !== -1) {\r\n contextAnims.splice(index, 1);\r\n }\r\n context._removePendingBlock(this);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n for (const anim of contextAnims) {\r\n anim.stop();\r\n }\r\n context._deleteExecutionVariable(this, \"runningAnimatables\");\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphPlayAnimationBlock.ClassName;\r\n }\r\n\r\n /**\r\n * Serializes the block to a JSON object.\r\n * @param serializationObject the object to serialize to.\r\n */\r\n public override serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath;\r\n serializationObject.config.animationPath = this.config.animationPath;\r\n }\r\n\r\n /**\r\n * Class name of the block.\r\n */\r\n public static ClassName = \"FGPlayAnimationBlock\";\r\n}\r\n\r\nRegisterClass(FlowGraphPlayAnimationBlock.ClassName, FlowGraphPlayAnimationBlock);\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
4
|
-
import type { Animatable } from "../../../../Animations/animatable";
|
|
4
|
+
import type { Animatable } from "../../../../Animations/animatable.core";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphStopAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,oCAAoC;IAMjF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpE,oBAAoB,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,sBAAsB,CAAC;IAClC,CAAC;CACJ;AACD,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { Animatable } from \"../../../../Animations/animatable\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphStopAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The animation to stop.\r\n */\r\n public readonly animationToStop: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToStop = this.registerDataInput(\"animationToStop\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationToStop.getValue(context);\r\n animationToStopValue.stop();\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return \"FGStopAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAnimationBlock\", FlowGraphStopAnimationBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphStopAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,oCAAoC;IAMjF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpE,oBAAoB,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,OAAO,sBAAsB,CAAC;IAClC,CAAC;CACJ;AACD,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport type { Animatable } from \"../../../../Animations/animatable.core\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphStopAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The animation to stop.\r\n */\r\n public readonly animationToStop: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToStop = this.registerDataInput(\"animationToStop\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationToStop.getValue(context);\r\n animationToStopValue.stop();\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return \"FGStopAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAnimationBlock\", FlowGraphStopAnimationBlock);\r\n"]}
|
|
@@ -8,6 +8,7 @@ import { KeyboardEventTypes, KeyboardInfoPre, KeyboardInfo } from "../Events/key
|
|
|
8
8
|
import { DeviceType, PointerInput } from "../DeviceInput/InputDevices/deviceEnums.js";
|
|
9
9
|
import { DeviceSourceManager } from "../DeviceInput/InputDevices/deviceSourceManager.js";
|
|
10
10
|
import { EngineStore } from "../Engines/engineStore.js";
|
|
11
|
+
import { _ImportHelper } from "../import.helper.js";
|
|
11
12
|
/** @internal */
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
14
|
class _ClickInfo {
|
|
@@ -180,7 +181,7 @@ export class InputManager {
|
|
|
180
181
|
/** @internal */
|
|
181
182
|
_setRayOnPointerInfo(pickInfo, event) {
|
|
182
183
|
const scene = this._scene;
|
|
183
|
-
if (pickInfo &&
|
|
184
|
+
if (pickInfo && _ImportHelper._IsPickingAvailable) {
|
|
184
185
|
if (!pickInfo.ray) {
|
|
185
186
|
pickInfo.ray = scene.createPickingRay(event.offsetX, event.offsetY, Matrix.Identity(), scene.activeCamera);
|
|
186
187
|
}
|