@babylonjs/core 6.35.0 → 6.36.1
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/Compute/computeShader.d.ts +2 -2
- package/Compute/computeShader.js.map +1 -1
- package/Engines/ICanvas.d.ts +4 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGPU/Extensions/index.d.ts +0 -2
- package/Engines/WebGPU/Extensions/index.js +0 -2
- package/Engines/WebGPU/Extensions/index.js.map +1 -1
- package/Engines/engineCapabilities.d.ts +2 -0
- package/Engines/engineCapabilities.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.js +4 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +52 -1
- package/Engines/webgpuEngine.js +133 -0
- package/Engines/webgpuEngine.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/Gizmos/boundingBoxGizmo.d.ts +6 -0
- package/Gizmos/boundingBoxGizmo.js +28 -3
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -2
- package/Materials/Node/nodeMaterial.js +2 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +11 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js +3 -0
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +13 -2
- package/Materials/Textures/Procedurals/proceduralTexture.js +12 -14
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/dynamicTexture.d.ts +5 -0
- package/Materials/Textures/dynamicTexture.js +13 -0
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.d.ts +2 -1
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +2 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +8 -9
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +14 -2
- package/Rendering/geometryBufferRenderer.js +40 -6
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +9 -3
- package/Rendering/geometryBufferRendererSceneComponent.js +2 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Shaders/geometry.fragment.js +3 -0
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/screenSpaceReflection2.fragment.js +6 -0
- package/Shaders/screenSpaceReflection2.fragment.js.map +1 -1
- package/package.json +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.d.ts +0 -1
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js +0 -44
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js.map +0 -1
- package/Engines/WebGPU/Extensions/engine.uniformBuffer.d.ts +0 -1
- package/Engines/WebGPU/Extensions/engine.uniformBuffer.js +0 -46
- package/Engines/WebGPU/Extensions/engine.uniformBuffer.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
4
|
-
import type { Animatable } from "../../../../Animations";
|
|
4
|
+
import type { Animatable } from "../../../../Animations/animatable";
|
|
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,4CAA4C,CAAC;AAElG,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;IAEM,YAAY;QACf,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 \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { Animatable } from \"../../../../Animations\";\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 FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n *\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 public 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,4CAA4C,CAAC;AAElG,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;IAEM,YAAY;QACf,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 \"../../../flowGraphWithOnDoneExecutionBlock\";\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 FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n *\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 public 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";
|
|
2
|
+
import type { Animatable } from "../../../../Animations/animatable";
|
|
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,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AASzE;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IA+BzE,YAA0B,MAAiD;QACvE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAAN,MAAM,CAA2C;QAGvE,IAAI,CAAC,uBAAuB,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACnF,IAAI,CAAC,0BAA0B,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAEzF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QAC3D,IAA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AAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC3E,mBAAmB,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;IACrF,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { Animatable } from \"../../../../Animations\";\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 { FlowGraphPath } from \"../../../flowGraphPath\";\r\nimport { FlowGraphPathComponent } from \"../../../flowGraphPathComponent\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n targetPath: FlowGraphPath;\r\n animationPath: FlowGraphPath;\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: FlowGraphPathComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathComponent;\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(public config: IFlowGraphPlayAnimationBlockConfiguration) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathComponent(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 targetValue = this.templateTargetComponent.getProperty(context);\r\n const animationValue = this.templateAnimationComponent.getProperty(context);\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 public getClassName(): string {\r\n return \"FGPlayAnimationBlock\";\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath.serialize();\r\n serializationObject.config.animationPath = this.config.animationPath.serialize();\r\n }\r\n}\r\n\r\nRegisterClass(\"FGPlayAnimationBlock\", 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,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AASzE;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ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C,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,GAAG,MAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,CAAkB,mCAAI,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;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,sBAA2B,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC3E,mBAAmB,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;IACrF,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,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 { FlowGraphPath } from \"../../../flowGraphPath\";\r\nimport { FlowGraphPathComponent } from \"../../../flowGraphPathComponent\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n targetPath: FlowGraphPath;\r\n animationPath: FlowGraphPath;\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: FlowGraphPathComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathComponent;\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(public config: IFlowGraphPlayAnimationBlockConfiguration) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathComponent(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 targetValue = this.templateTargetComponent.getProperty(context);\r\n const animationValue = this.templateAnimationComponent.getProperty(context);\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 public getClassName(): string {\r\n return \"FGPlayAnimationBlock\";\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath.serialize();\r\n serializationObject.config.animationPath = this.config.animationPath.serialize();\r\n }\r\n}\r\n\r\nRegisterClass(\"FGPlayAnimationBlock\", 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 "../../../flowGraphWithOnDoneExecutionBlock";
|
|
4
|
-
import type { Animatable } from "../../../../Animations";
|
|
4
|
+
import type { Animatable } from "../../../../Animations/animatable";
|
|
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,4CAA4C,CAAC;AAElG,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;IAEM,YAAY;QACf,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 \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { Animatable } from \"../../../../Animations\";\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 *\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 public 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,4CAA4C,CAAC;AAElG,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;IAEM,YAAY;QACf,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 \"../../../flowGraphWithOnDoneExecutionBlock\";\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 *\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 public getClassName(): string {\r\n return \"FGStopAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAnimationBlock\", FlowGraphStopAnimationBlock);\r\n"]}
|
|
@@ -103,6 +103,8 @@ export declare class BoundingBoxGizmo extends Gizmo implements IBoundingBoxGizmo
|
|
|
103
103
|
private _tmpQuaternion;
|
|
104
104
|
private _tmpVector;
|
|
105
105
|
private _tmpRotationMatrix;
|
|
106
|
+
private _incrementalStartupValue;
|
|
107
|
+
private _incrementalAnchorStartupValue;
|
|
106
108
|
/**
|
|
107
109
|
* If child meshes should be ignored when calculating the bounding box. This should be set to true to avoid perf hits with heavily nested meshes (Default: false)
|
|
108
110
|
*/
|
|
@@ -169,6 +171,10 @@ export declare class BoundingBoxGizmo extends Gizmo implements IBoundingBoxGizmo
|
|
|
169
171
|
* Scale factor used for masking some axis
|
|
170
172
|
*/
|
|
171
173
|
protected _axisFactor: Vector3;
|
|
174
|
+
/**
|
|
175
|
+
* Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...
|
|
176
|
+
*/
|
|
177
|
+
incrementalSnap: boolean;
|
|
172
178
|
/**
|
|
173
179
|
* Sets the axis factor
|
|
174
180
|
* @param factor the Vector3 value
|
|
@@ -104,6 +104,8 @@ export class BoundingBoxGizmo extends Gizmo {
|
|
|
104
104
|
this._tmpQuaternion = new Quaternion();
|
|
105
105
|
this._tmpVector = new Vector3(0, 0, 0);
|
|
106
106
|
this._tmpRotationMatrix = new Matrix();
|
|
107
|
+
this._incrementalStartupValue = Vector3.Zero();
|
|
108
|
+
this._incrementalAnchorStartupValue = Vector3.Zero();
|
|
107
109
|
/**
|
|
108
110
|
* If child meshes should be ignored when calculating the bounding box. This should be set to true to avoid perf hits with heavily nested meshes (Default: false)
|
|
109
111
|
*/
|
|
@@ -170,6 +172,10 @@ export class BoundingBoxGizmo extends Gizmo {
|
|
|
170
172
|
* Scale factor used for masking some axis
|
|
171
173
|
*/
|
|
172
174
|
this._axisFactor = new Vector3(1, 1, 1);
|
|
175
|
+
/**
|
|
176
|
+
* Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...
|
|
177
|
+
*/
|
|
178
|
+
this.incrementalSnap = false;
|
|
173
179
|
this._existingMeshScale = new Vector3();
|
|
174
180
|
// Dragging
|
|
175
181
|
this._dragMesh = null;
|
|
@@ -359,6 +365,7 @@ export class BoundingBoxGizmo extends Gizmo {
|
|
|
359
365
|
previousScale = scale;
|
|
360
366
|
}
|
|
361
367
|
const deltaScale = new Vector3(relativeDragDistance, relativeDragDistance, relativeDragDistance);
|
|
368
|
+
const fullScale = new Vector3(previousScale, previousScale, previousScale);
|
|
362
369
|
if (zeroAxisCount === 2) {
|
|
363
370
|
// scale on 1 axis when using the anchor box in the face middle
|
|
364
371
|
deltaScale.x *= Math.abs(dragAxis.x);
|
|
@@ -367,6 +374,9 @@ export class BoundingBoxGizmo extends Gizmo {
|
|
|
367
374
|
}
|
|
368
375
|
deltaScale.scaleInPlace(this._scaleDragSpeed);
|
|
369
376
|
deltaScale.multiplyInPlace(this._axisFactor);
|
|
377
|
+
fullScale.scaleInPlace(this._scaleDragSpeed);
|
|
378
|
+
fullScale.multiplyInPlace(this._axisFactor);
|
|
379
|
+
fullScale.addInPlace(this._incrementalStartupValue);
|
|
370
380
|
this.updateBoundingBox();
|
|
371
381
|
if (this.scalePivot) {
|
|
372
382
|
this.attachedMesh.getWorldMatrix().getRotationMatrixToRef(this._tmpRotationMatrix);
|
|
@@ -387,9 +397,22 @@ export class BoundingBoxGizmo extends Gizmo {
|
|
|
387
397
|
}
|
|
388
398
|
}
|
|
389
399
|
this._anchorMesh.addChild(this.attachedMesh);
|
|
390
|
-
this.
|
|
391
|
-
|
|
392
|
-
this.
|
|
400
|
+
if (this.incrementalSnap) {
|
|
401
|
+
fullScale.x /= Math.abs(this._incrementalStartupValue.x) < Epsilon ? 1 : this._incrementalStartupValue.x;
|
|
402
|
+
fullScale.y /= Math.abs(this._incrementalStartupValue.y) < Epsilon ? 1 : this._incrementalStartupValue.y;
|
|
403
|
+
fullScale.z /= Math.abs(this._incrementalStartupValue.z) < Epsilon ? 1 : this._incrementalStartupValue.z;
|
|
404
|
+
fullScale.x = Math.max(this._incrementalAnchorStartupValue.x * fullScale.x, this.scalingSnapDistance);
|
|
405
|
+
fullScale.y = Math.max(this._incrementalAnchorStartupValue.y * fullScale.y, this.scalingSnapDistance);
|
|
406
|
+
fullScale.z = Math.max(this._incrementalAnchorStartupValue.z * fullScale.z, this.scalingSnapDistance);
|
|
407
|
+
this._anchorMesh.scaling.x += (fullScale.x - this._anchorMesh.scaling.x) * Math.abs(dragAxis.x);
|
|
408
|
+
this._anchorMesh.scaling.y += (fullScale.y - this._anchorMesh.scaling.y) * Math.abs(dragAxis.y);
|
|
409
|
+
this._anchorMesh.scaling.z += (fullScale.z - this._anchorMesh.scaling.z) * Math.abs(dragAxis.z);
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
this._anchorMesh.scaling.addInPlace(deltaScale);
|
|
413
|
+
if (this._anchorMesh.scaling.x < 0 || this._anchorMesh.scaling.y < 0 || this._anchorMesh.scaling.z < 0) {
|
|
414
|
+
this._anchorMesh.scaling.subtractInPlace(deltaScale);
|
|
415
|
+
}
|
|
393
416
|
}
|
|
394
417
|
this._anchorMesh.removeChild(this.attachedMesh);
|
|
395
418
|
this.attachedMesh.setParent(originalParent);
|
|
@@ -403,6 +426,8 @@ export class BoundingBoxGizmo extends Gizmo {
|
|
|
403
426
|
this._selectNode(box);
|
|
404
427
|
totalRelativeDragDistance = 0;
|
|
405
428
|
previousScale = 0;
|
|
429
|
+
this._incrementalStartupValue.copyFrom(this.attachedMesh.scaling);
|
|
430
|
+
this._incrementalAnchorStartupValue.copyFrom(this._anchorMesh.scaling);
|
|
406
431
|
});
|
|
407
432
|
_dragBehavior.onDragEndObservable.add((event) => {
|
|
408
433
|
this.onScaleBoxDragEndObservable.notifyObservers({});
|