@babylonjs/core 6.8.1 → 6.9.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/Actions/action.d.ts +4 -5
- package/Actions/action.js.map +1 -1
- package/Actions/condition.d.ts +1 -2
- package/Actions/condition.js.map +1 -1
- package/Actions/directActions.d.ts +1 -2
- package/Actions/directActions.js.map +1 -1
- package/Animations/animatable.interface.d.ts +1 -2
- package/Animations/animatable.interface.js.map +1 -1
- package/Animations/animation.d.ts +3 -4
- package/Animations/animation.js.map +1 -1
- package/Animations/runtimeAnimation.d.ts +1 -2
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Bones/bone.d.ts +3 -3
- package/Bones/bone.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -2
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +6 -7
- package/Cameras/camera.js.map +1 -1
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Collisions/meshCollisionData.d.ts +1 -2
- package/Collisions/meshCollisionData.js.map +1 -1
- package/Collisions/pickingInfo.d.ts +1 -2
- package/Collisions/pickingInfo.js.map +1 -1
- package/Compute/computeEffect.d.ts +1 -2
- package/Compute/computeEffect.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.d.ts +1 -2
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/boundingBox.d.ts +1 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/boundingInfo.d.ts +1 -2
- package/Culling/boundingInfo.js.map +1 -1
- package/Culling/ray.js.map +1 -1
- package/Engines/Extensions/engine.storageBuffer.d.ts +1 -2
- package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/Extensions/engine.textureSampler.d.ts +1 -2
- package/Engines/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +1 -2
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderProcessor.d.ts +5 -6
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.d.ts +1 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +1 -2
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.d.ts +1 -2
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +1 -2
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/engine.d.ts +3 -3
- package/Engines/engine.js.map +1 -1
- package/Engines/engineStore.d.ts +4 -5
- package/Engines/engineStore.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/pointerEvents.d.ts +1 -2
- package/Events/pointerEvents.js.map +1 -1
- package/Helpers/textureDome.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +1 -2
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +3 -4
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialDecorator.d.ts +2 -3
- package/Materials/Node/nodeMaterialDecorator.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +2 -3
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +3 -4
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +1 -2
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.d.ts +1 -2
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +1 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +4 -5
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/drawWrapper.d.ts +3 -4
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +5 -6
- package/Materials/effect.js.map +1 -1
- package/Materials/effectFallbacks.d.ts +2 -3
- package/Materials/effectFallbacks.js.map +1 -1
- package/Materials/iEffectFallbacks.d.ts +1 -2
- package/Materials/iEffectFallbacks.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +2 -3
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/material.d.ts +3 -4
- package/Materials/material.detailMapConfiguration.d.ts +4 -5
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +11 -12
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +8 -9
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginFactoryExport.d.ts +1 -2
- package/Materials/materialPluginFactoryExport.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +3 -4
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/materialStencilState.d.ts +1 -2
- package/Materials/materialStencilState.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +1 -2
- package/Materials/shaderMaterial.js.map +1 -1
- package/Meshes/Builders/linesBuilder.d.ts +1 -2
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.d.ts +34 -0
- package/Meshes/Builders/textBuilder.js +10 -2
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +5 -5
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +1 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +6 -6
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +2 -3
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/subMesh.d.ts +7 -8
- package/Meshes/subMesh.js.map +1 -1
- package/Misc/copyTools.d.ts +1 -2
- package/Misc/copyTools.js.map +1 -1
- package/Misc/decorators.d.ts +5 -6
- package/Misc/decorators.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +12 -0
- package/Misc/greasedLineTools.js +36 -0
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +3 -4
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/screenshotTools.d.ts +1 -2
- package/Misc/screenshotTools.js.map +1 -1
- package/Morph/morphTarget.d.ts +2 -1
- package/Morph/morphTarget.js.map +1 -1
- package/Particles/EmitterTypes/IParticleEmitterType.d.ts +1 -2
- package/Particles/EmitterTypes/IParticleEmitterType.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +2 -3
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -2
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -2
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/subEmitter.d.ts +2 -3
- package/Particles/subEmitter.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -2
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +1 -2
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +1 -2
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.d.ts +1 -2
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.d.ts +1 -2
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/displayPassPostProcess.d.ts +1 -2
- package/PostProcesses/displayPassPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.d.ts +1 -2
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.d.ts +1 -2
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.d.ts +1 -2
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.d.ts +2 -3
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +1 -2
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +6 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +1 -2
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/PostProcesses/refractionPostProcess.d.ts +1 -2
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +2 -3
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.d.ts +2 -3
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.d.ts +2 -3
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -2
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +1 -2
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthRenderer.d.ts +2 -3
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +2 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/renderingManager.d.ts +5 -6
- package/Rendering/renderingManager.js.map +1 -1
- package/Sprites/sprite.d.ts +1 -2
- package/Sprites/sprite.js.map +1 -1
- package/Sprites/spriteManager.d.ts +1 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +2 -3
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/webXRExperienceHelper.js +1 -0
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/abstractScene.d.ts +3 -3
- package/abstractScene.js.map +1 -1
- package/node.d.ts +6 -7
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +49 -50
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +6 -7
- package/sceneComponent.js.map +1 -1
package/Actions/action.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import type { Condition } from "./condition";
|
|
|
3
3
|
import type { AbstractActionManager } from "./abstractActionManager";
|
|
4
4
|
import type { Nullable } from "../types";
|
|
5
5
|
import type { Material } from "../Materials/material";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import type { Scene } from "../scene";
|
|
7
|
+
import type { ActionManager } from "./actionManager";
|
|
8
|
+
import type { ActionEvent } from "./actionEvent";
|
|
9
|
+
import type { Node } from "../node";
|
|
10
10
|
/**
|
|
11
11
|
* Interface used to define Action
|
|
12
12
|
*/
|
|
@@ -159,4 +159,3 @@ export declare class Action implements IAction {
|
|
|
159
159
|
value: string;
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
export {};
|
package/Actions/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../lts/core/generated/Actions/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAiElD;;;GAGG;AACH,MAAM,OAAO,MAAM;IAsBf;;;;OA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,OAAO,EAAE;QAC1B,OAAO,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;KACpD;IAED,IAAI,KAAK,YAAY,MAAM,EAAE;QACzB,OAAO,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;KACpD;IACD,IAAI,KAAK,YAAY,MAAM,EAAE;QACzB,OAAO,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;KACrE;IAED,OAAO,KAAK,CAAC,CAAC,SAAS;AAC3B,CAAC,AAxBoC,CAwBnC;AAEF;;;GAGG;AACW,yBAAkB,GAAG,CAAC,MAA+B,EAAE,EAAE;IACnE,OAAO;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAS,MAAO,CAAC,OAAO;YAC9B,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAS,MAAO,CAAC,QAAQ;gBAC1B,CAAC,CAAC,iBAAiB;gBACnB,CAAC,CAAU,MAAO,CAAC,SAAS;oBAC5B,CAAC,CAAC,kBAAkB;oBACpB,CAAC,CAAY,MAAO,CAAC,WAAW;wBAChC,CAAC,CAAC,oBAAoB;wBACtB,CAAC,CAAC,iBAAiB;QACvB,KAAK,EAAU,MAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAQ,MAAO,CAAC,IAAI;KAClE,CAAC;AACN,CAAC,AAd+B,CAc9B;AAGN,aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport { Vector2, Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { Condition } from \"./condition\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { AbstractActionManager } from \"./abstractActionManager\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Material } from \"../Materials/material\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\ndeclare type ActionManager = import(\"./actionManager\").ActionManager;\r\ndeclare type ActionEvent = import(\"./actionEvent\").ActionEvent;\r\ndeclare type Mesh = import(\"../Meshes/mesh\").Mesh;\r\ndeclare type Light = import(\"../Lights/light\").Light;\r\ndeclare type Camera = import(\"../Cameras/camera\").Camera;\r\ndeclare type Node = import(\"../node\").Node;\r\n\r\n/**\r\n * Interface used to define Action\r\n */\r\nexport interface IAction {\r\n /**\r\n * Trigger for the action\r\n */\r\n trigger: number;\r\n\r\n /** Options of the trigger */\r\n triggerOptions: any;\r\n\r\n /**\r\n * Gets the trigger parameters\r\n * @returns the trigger parameters\r\n */\r\n getTriggerParameter(): any;\r\n\r\n /**\r\n * Internal only - executes current action event\r\n * @internal\r\n */\r\n _executeCurrent(evt?: ActionEvent): void;\r\n\r\n /**\r\n * Serialize placeholder for child classes\r\n * @param parent of child\r\n * @returns the serialized object\r\n */\r\n serialize(parent: any): any;\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n _prepare(): void;\r\n\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n _actionManager: Nullable<AbstractActionManager>;\r\n\r\n /**\r\n * Adds action to chain of actions, may be a DoNothingAction\r\n * @param action defines the next action to execute\r\n * @returns The action passed in\r\n * @see https://www.babylonjs-playground.com/#1T30HR#0\r\n */\r\n then(action: IAction): IAction;\r\n}\r\n\r\n/**\r\n * The action to be carried out following a trigger\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#available-actions\r\n */\r\nexport class Action implements IAction {\r\n /**\r\n * Trigger for the action\r\n */\r\n public trigger: number;\r\n\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n private _nextActiveAction: Action;\r\n private _child: Action;\r\n private _condition?: Condition;\r\n private _triggerParameter: any;\r\n\r\n /**\r\n * An event triggered prior to action being executed.\r\n */\r\n public onBeforeExecuteObservable = new Observable<Action>();\r\n\r\n /**\r\n * Creates a new Action\r\n * @param triggerOptions the trigger, with or without parameters, for the action\r\n * @param condition an optional determinant of action\r\n */\r\n constructor(\r\n /** the trigger, with or without parameters, for the action */\r\n public triggerOptions: any,\r\n condition?: Condition\r\n ) {\r\n if (triggerOptions.parameter) {\r\n this.trigger = triggerOptions.trigger;\r\n this._triggerParameter = triggerOptions.parameter;\r\n } else if (triggerOptions.trigger) {\r\n this.trigger = triggerOptions.trigger;\r\n } else {\r\n this.trigger = triggerOptions;\r\n }\r\n\r\n this._nextActiveAction = this;\r\n this._condition = condition;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Gets the trigger parameter\r\n * @returns the trigger parameter\r\n */\r\n public getTriggerParameter(): any {\r\n return this._triggerParameter;\r\n }\r\n\r\n /**\r\n * Sets the trigger parameter\r\n * @param value defines the new trigger parameter\r\n */\r\n public setTriggerParameter(value: any) {\r\n this._triggerParameter = value;\r\n }\r\n\r\n /**\r\n * Internal only - Returns if the current condition allows to run the action\r\n * @internal\r\n */\r\n public _evaluateConditionForCurrentFrame(): boolean {\r\n const condition = this._condition;\r\n if (!condition) {\r\n return true;\r\n }\r\n\r\n const currentRenderId = this._actionManager.getScene().getRenderId();\r\n\r\n // We cache the current evaluation for the current frame\r\n if (condition._evaluationId !== currentRenderId) {\r\n condition._evaluationId = currentRenderId;\r\n condition._currentResult = condition.isValid();\r\n }\r\n\r\n return condition._currentResult;\r\n }\r\n\r\n /**\r\n * Internal only - executes current action event\r\n * @internal\r\n */\r\n public _executeCurrent(evt?: ActionEvent): void {\r\n const isConditionValid = this._evaluateConditionForCurrentFrame();\r\n if (!isConditionValid) {\r\n return;\r\n }\r\n\r\n this.onBeforeExecuteObservable.notifyObservers(this);\r\n this._nextActiveAction.execute(evt);\r\n\r\n this.skipToNextActiveAction();\r\n }\r\n\r\n /**\r\n * Execute placeholder for child classes\r\n * @param evt optional action event\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public execute(evt?: ActionEvent): void {}\r\n\r\n /**\r\n * Skips to next active action\r\n */\r\n public skipToNextActiveAction(): void {\r\n if (this._nextActiveAction._child) {\r\n if (!this._nextActiveAction._child._actionManager) {\r\n this._nextActiveAction._child._actionManager = this._actionManager;\r\n }\r\n\r\n this._nextActiveAction = this._nextActiveAction._child;\r\n } else {\r\n this._nextActiveAction = this;\r\n }\r\n }\r\n\r\n /**\r\n * Adds action to chain of actions, may be a DoNothingAction\r\n * @param action defines the next action to execute\r\n * @returns The action passed in\r\n * @see https://www.babylonjs-playground.com/#1T30HR#0\r\n */\r\n public then(action: Action): Action {\r\n this._child = action;\r\n\r\n action._actionManager = this._actionManager;\r\n action._prepare();\r\n\r\n return action;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public _getProperty(propertyPath: string): string {\r\n return this._actionManager._getProperty(propertyPath);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getEffectiveTarget(target: any, propertyPath: string): any {\r\n return this._actionManager._getEffectiveTarget(target, propertyPath);\r\n }\r\n\r\n /**\r\n * Serialize placeholder for child classes\r\n * @param parent of child\r\n * @returns the serialized object\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public serialize(parent: any): any {}\r\n\r\n /**\r\n * Internal only called by serialize\r\n * @internal\r\n */\r\n protected _serialize(serializedAction: any, parent?: any): any {\r\n const serializationObject: any = {\r\n type: 1,\r\n children: [],\r\n name: serializedAction.name,\r\n properties: serializedAction.properties || [],\r\n };\r\n\r\n // Serialize child\r\n if (this._child) {\r\n this._child.serialize(serializationObject);\r\n }\r\n\r\n // Check if \"this\" has a condition\r\n if (this._condition) {\r\n const serializedCondition = this._condition.serialize();\r\n serializedCondition.children.push(serializationObject);\r\n\r\n if (parent) {\r\n parent.children.push(serializedCondition);\r\n }\r\n return serializedCondition;\r\n }\r\n\r\n if (parent) {\r\n parent.children.push(serializationObject);\r\n }\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public static _SerializeValueAsString = (value: any): string => {\r\n if (typeof value === \"number\") {\r\n return value.toString();\r\n }\r\n\r\n if (typeof value === \"boolean\") {\r\n return value ? \"true\" : \"false\";\r\n }\r\n\r\n if (value instanceof Vector2) {\r\n return value.x + \", \" + value.y;\r\n }\r\n if (value instanceof Vector3) {\r\n return value.x + \", \" + value.y + \", \" + value.z;\r\n }\r\n\r\n if (value instanceof Color3) {\r\n return value.r + \", \" + value.g + \", \" + value.b;\r\n }\r\n if (value instanceof Color4) {\r\n return value.r + \", \" + value.g + \", \" + value.b + \", \" + value.a;\r\n }\r\n\r\n return value; // string\r\n };\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public static _GetTargetProperty = (target: Scene | Node | Material) => {\r\n return {\r\n name: \"target\",\r\n targetType: (<Mesh>target)._isMesh\r\n ? \"MeshProperties\"\r\n : (<Light>target)._isLight\r\n ? \"LightProperties\"\r\n : (<Camera>target)._isCamera\r\n ? \"CameraProperties\"\r\n : (<Material>target)._isMaterial\r\n ? \"MaterialProperties\"\r\n : \"SceneProperties\",\r\n value: (<Scene>target)._isScene ? \"Scene\" : (<Node>target).name,\r\n };\r\n };\r\n}\r\n\r\nRegisterClass(\"BABYLON.Action\", Action);\r\n"]}
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../lts/core/generated/Actions/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,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, Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { Condition } from \"./condition\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { AbstractActionManager } from \"./abstractActionManager\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Material } from \"../Materials/material\";\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport type { ActionManager } from \"./actionManager\";\r\nimport type { ActionEvent } from \"./actionEvent\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Light } from \"../Lights/light\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Node } from \"../node\";\r\n\r\n/**\r\n * Interface used to define Action\r\n */\r\nexport interface IAction {\r\n /**\r\n * Trigger for the action\r\n */\r\n trigger: number;\r\n\r\n /** Options of the trigger */\r\n triggerOptions: any;\r\n\r\n /**\r\n * Gets the trigger parameters\r\n * @returns the trigger parameters\r\n */\r\n getTriggerParameter(): any;\r\n\r\n /**\r\n * Internal only - executes current action event\r\n * @internal\r\n */\r\n _executeCurrent(evt?: ActionEvent): void;\r\n\r\n /**\r\n * Serialize placeholder for child classes\r\n * @param parent of child\r\n * @returns the serialized object\r\n */\r\n serialize(parent: any): any;\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n _prepare(): void;\r\n\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n _actionManager: Nullable<AbstractActionManager>;\r\n\r\n /**\r\n * Adds action to chain of actions, may be a DoNothingAction\r\n * @param action defines the next action to execute\r\n * @returns The action passed in\r\n * @see https://www.babylonjs-playground.com/#1T30HR#0\r\n */\r\n then(action: IAction): IAction;\r\n}\r\n\r\n/**\r\n * The action to be carried out following a trigger\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions#available-actions\r\n */\r\nexport class Action implements IAction {\r\n /**\r\n * Trigger for the action\r\n */\r\n public trigger: number;\r\n\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n private _nextActiveAction: Action;\r\n private _child: Action;\r\n private _condition?: Condition;\r\n private _triggerParameter: any;\r\n\r\n /**\r\n * An event triggered prior to action being executed.\r\n */\r\n public onBeforeExecuteObservable = new Observable<Action>();\r\n\r\n /**\r\n * Creates a new Action\r\n * @param triggerOptions the trigger, with or without parameters, for the action\r\n * @param condition an optional determinant of action\r\n */\r\n constructor(\r\n /** the trigger, with or without parameters, for the action */\r\n public triggerOptions: any,\r\n condition?: Condition\r\n ) {\r\n if (triggerOptions.parameter) {\r\n this.trigger = triggerOptions.trigger;\r\n this._triggerParameter = triggerOptions.parameter;\r\n } else if (triggerOptions.trigger) {\r\n this.trigger = triggerOptions.trigger;\r\n } else {\r\n this.trigger = triggerOptions;\r\n }\r\n\r\n this._nextActiveAction = this;\r\n this._condition = condition;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Gets the trigger parameter\r\n * @returns the trigger parameter\r\n */\r\n public getTriggerParameter(): any {\r\n return this._triggerParameter;\r\n }\r\n\r\n /**\r\n * Sets the trigger parameter\r\n * @param value defines the new trigger parameter\r\n */\r\n public setTriggerParameter(value: any) {\r\n this._triggerParameter = value;\r\n }\r\n\r\n /**\r\n * Internal only - Returns if the current condition allows to run the action\r\n * @internal\r\n */\r\n public _evaluateConditionForCurrentFrame(): boolean {\r\n const condition = this._condition;\r\n if (!condition) {\r\n return true;\r\n }\r\n\r\n const currentRenderId = this._actionManager.getScene().getRenderId();\r\n\r\n // We cache the current evaluation for the current frame\r\n if (condition._evaluationId !== currentRenderId) {\r\n condition._evaluationId = currentRenderId;\r\n condition._currentResult = condition.isValid();\r\n }\r\n\r\n return condition._currentResult;\r\n }\r\n\r\n /**\r\n * Internal only - executes current action event\r\n * @internal\r\n */\r\n public _executeCurrent(evt?: ActionEvent): void {\r\n const isConditionValid = this._evaluateConditionForCurrentFrame();\r\n if (!isConditionValid) {\r\n return;\r\n }\r\n\r\n this.onBeforeExecuteObservable.notifyObservers(this);\r\n this._nextActiveAction.execute(evt);\r\n\r\n this.skipToNextActiveAction();\r\n }\r\n\r\n /**\r\n * Execute placeholder for child classes\r\n * @param evt optional action event\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public execute(evt?: ActionEvent): void {}\r\n\r\n /**\r\n * Skips to next active action\r\n */\r\n public skipToNextActiveAction(): void {\r\n if (this._nextActiveAction._child) {\r\n if (!this._nextActiveAction._child._actionManager) {\r\n this._nextActiveAction._child._actionManager = this._actionManager;\r\n }\r\n\r\n this._nextActiveAction = this._nextActiveAction._child;\r\n } else {\r\n this._nextActiveAction = this;\r\n }\r\n }\r\n\r\n /**\r\n * Adds action to chain of actions, may be a DoNothingAction\r\n * @param action defines the next action to execute\r\n * @returns The action passed in\r\n * @see https://www.babylonjs-playground.com/#1T30HR#0\r\n */\r\n public then(action: Action): Action {\r\n this._child = action;\r\n\r\n action._actionManager = this._actionManager;\r\n action._prepare();\r\n\r\n return action;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public _getProperty(propertyPath: string): string {\r\n return this._actionManager._getProperty(propertyPath);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getEffectiveTarget(target: any, propertyPath: string): any {\r\n return this._actionManager._getEffectiveTarget(target, propertyPath);\r\n }\r\n\r\n /**\r\n * Serialize placeholder for child classes\r\n * @param parent of child\r\n * @returns the serialized object\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public serialize(parent: any): any {}\r\n\r\n /**\r\n * Internal only called by serialize\r\n * @internal\r\n */\r\n protected _serialize(serializedAction: any, parent?: any): any {\r\n const serializationObject: any = {\r\n type: 1,\r\n children: [],\r\n name: serializedAction.name,\r\n properties: serializedAction.properties || [],\r\n };\r\n\r\n // Serialize child\r\n if (this._child) {\r\n this._child.serialize(serializationObject);\r\n }\r\n\r\n // Check if \"this\" has a condition\r\n if (this._condition) {\r\n const serializedCondition = this._condition.serialize();\r\n serializedCondition.children.push(serializationObject);\r\n\r\n if (parent) {\r\n parent.children.push(serializedCondition);\r\n }\r\n return serializedCondition;\r\n }\r\n\r\n if (parent) {\r\n parent.children.push(serializationObject);\r\n }\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public static _SerializeValueAsString = (value: any): string => {\r\n if (typeof value === \"number\") {\r\n return value.toString();\r\n }\r\n\r\n if (typeof value === \"boolean\") {\r\n return value ? \"true\" : \"false\";\r\n }\r\n\r\n if (value instanceof Vector2) {\r\n return value.x + \", \" + value.y;\r\n }\r\n if (value instanceof Vector3) {\r\n return value.x + \", \" + value.y + \", \" + value.z;\r\n }\r\n\r\n if (value instanceof Color3) {\r\n return value.r + \", \" + value.g + \", \" + value.b;\r\n }\r\n if (value instanceof Color4) {\r\n return value.r + \", \" + value.g + \", \" + value.b + \", \" + value.a;\r\n }\r\n\r\n return value; // string\r\n };\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public static _GetTargetProperty = (target: Scene | Node | Material) => {\r\n return {\r\n name: \"target\",\r\n targetType: (<Mesh>target)._isMesh\r\n ? \"MeshProperties\"\r\n : (<Light>target)._isLight\r\n ? \"LightProperties\"\r\n : (<Camera>target)._isCamera\r\n ? \"CameraProperties\"\r\n : (<Material>target)._isMaterial\r\n ? \"MaterialProperties\"\r\n : \"SceneProperties\",\r\n value: (<Scene>target)._isScene ? \"Scene\" : (<Node>target).name,\r\n };\r\n };\r\n}\r\n\r\nRegisterClass(\"BABYLON.Action\", Action);\r\n"]}
|
package/Actions/condition.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ActionManager } from "./actionManager";
|
|
2
2
|
/**
|
|
3
3
|
* A Condition applied to an Action
|
|
4
4
|
*/
|
|
@@ -170,4 +170,3 @@ export declare class StateCondition extends Condition {
|
|
|
170
170
|
*/
|
|
171
171
|
serialize(): any;
|
|
172
172
|
}
|
|
173
|
-
export {};
|
package/Actions/condition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../lts/core/generated/Actions/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD;;GAEG;AACH,MAAM,OAAO,SAAS;IAiBlB;;;OAGG;IACH,YAAY,aAA4B;QACpC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,YAAoB;QACpC,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,MAAW,EAAE,YAAoB;QACxD,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACI,SAAS,KAAS,CAAC;IAE1B;;OAEG;IACO,UAAU,CAAC,mBAAwB;QACzC,OAAO;YACH,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,mBAAmB,CAAC,IAAI;YAC9B,UAAU,EAAE,mBAAmB,CAAC,UAAU;SAC7C,CAAC;IACN,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IAMzC;;OAEG;IACI,MAAM,KAAK,OAAO;QACrB,OAAO,cAAc,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,WAAW;QACzB,OAAO,cAAc,CAAC,YAAY,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,SAAS;QACvB,OAAO,cAAc,CAAC,UAAU,C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GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAO7C;;;;OAIG;IACH,YACI,aAA4B;IAC5B,oEAAoE;IAC7D,SAAwB;QAE/B,KAAK,CAAC,aAAa,CAAC,CAAC;QAFd,cAAS,GAAT,SAAS,CAAe;IAGnC,CAAC;IAED;;OAEG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IASzC;;;;;OAKG;IACH,YACI,aAA4B,EAC5B,MAAW;IACX,0CAA0C;IACnC,KAAa;QAEpB,KAAK,CAAC,aAAa,CAAC,CAAC;QAFd,UAAK,GAAL,KAAK,CAAQ;QAIpB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC;YACnB,IAAI,EAAE,gBAAgB;YACtB,UAAU,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAC9F,CAAC,CAAC;IACP,CAAC;CACJ;AAED,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC;AACxD,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AAChE,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { Action } from \"./action\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\ndeclare type ActionManager = import(\"./actionManager\").ActionManager;\r\n\r\n/**\r\n * A Condition applied to an Action\r\n */\r\nexport class Condition {\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n /**\r\n * @internal\r\n */\r\n public _evaluationId: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n public _currentResult: boolean;\r\n\r\n /**\r\n * Creates a new Condition\r\n * @param actionManager the manager of the action the condition is applied to\r\n */\r\n constructor(actionManager: ActionManager) {\r\n this._actionManager = actionManager;\r\n }\r\n\r\n /**\r\n * Check if the current condition is valid\r\n * @returns a boolean\r\n */\r\n public isValid(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getProperty(propertyPath: string): string {\r\n return this._actionManager._getProperty(propertyPath);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getEffectiveTarget(target: any, propertyPath: string): any {\r\n return this._actionManager._getEffectiveTarget(target, propertyPath);\r\n }\r\n\r\n /**\r\n * Serialize placeholder for child classes\r\n * @returns the serialized object\r\n */\r\n public serialize(): any {}\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _serialize(serializedCondition: any): any {\r\n return {\r\n type: 2, // Condition\r\n children: [],\r\n name: serializedCondition.name,\r\n properties: serializedCondition.properties,\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Defines specific conditional operators as extensions of Condition\r\n */\r\nexport class ValueCondition extends Condition {\r\n private static _IsEqual = 0;\r\n private static _IsDifferent = 1;\r\n private static _IsGreater = 2;\r\n private static _IsLesser = 3;\r\n\r\n /**\r\n * returns the number for IsEqual\r\n */\r\n public static get IsEqual(): number {\r\n return ValueCondition._IsEqual;\r\n }\r\n\r\n /**\r\n * Returns the number for IsDifferent\r\n */\r\n public static get IsDifferent(): number {\r\n return ValueCondition._IsDifferent;\r\n }\r\n\r\n /**\r\n * Returns the number for IsGreater\r\n */\r\n public static get IsGreater(): number {\r\n return ValueCondition._IsGreater;\r\n }\r\n\r\n /**\r\n * Returns the number for IsLesser\r\n */\r\n public static get IsLesser(): number {\r\n return ValueCondition._IsLesser;\r\n }\r\n\r\n /**\r\n * Internal only The action manager for the condition\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Creates a new ValueCondition\r\n * @param actionManager manager for the action the condition applies to\r\n * @param target for the action\r\n * @param propertyPath path to specify the property of the target the conditional operator uses\r\n * @param value the value compared by the conditional operator against the current value of the property\r\n * @param operator the conditional operator, default ValueCondition.IsEqual\r\n */\r\n constructor(\r\n actionManager: ActionManager,\r\n target: any,\r\n /** path to specify the property of the target the conditional operator uses */\r\n public propertyPath: string,\r\n /** the value compared by the conditional operator against the current value of the property */\r\n public value: any,\r\n /** the conditional operator, default ValueCondition.IsEqual */\r\n public operator: number = ValueCondition.IsEqual\r\n ) {\r\n super(actionManager);\r\n\r\n this._target = target;\r\n this._effectiveTarget = this._getEffectiveTarget(target, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n }\r\n\r\n /**\r\n * Compares the given value with the property value for the specified conditional operator\r\n * @returns the result of the comparison\r\n */\r\n public isValid(): boolean {\r\n switch (this.operator) {\r\n case ValueCondition.IsGreater:\r\n return this._effectiveTarget[this._property] > this.value;\r\n case ValueCondition.IsLesser:\r\n return this._effectiveTarget[this._property] < this.value;\r\n case ValueCondition.IsEqual:\r\n case ValueCondition.IsDifferent: {\r\n let check: boolean;\r\n\r\n if (this.value.equals) {\r\n check = this.value.equals(this._effectiveTarget[this._property]);\r\n } else {\r\n check = this.value === this._effectiveTarget[this._property];\r\n }\r\n return this.operator === ValueCondition.IsEqual ? check : !check;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Serialize the ValueCondition into a JSON compatible object\r\n * @returns serialization object\r\n */\r\n public serialize(): any {\r\n return this._serialize({\r\n name: \"ValueCondition\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"propertyPath\", value: this.propertyPath },\r\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\r\n { name: \"operator\", value: ValueCondition.GetOperatorName(this.operator) },\r\n ],\r\n });\r\n }\r\n\r\n /**\r\n * Gets the name of the conditional operator for the ValueCondition\r\n * @param operator the conditional operator\r\n * @returns the name\r\n */\r\n public static GetOperatorName(operator: number): string {\r\n switch (operator) {\r\n case ValueCondition._IsEqual:\r\n return \"IsEqual\";\r\n case ValueCondition._IsDifferent:\r\n return \"IsDifferent\";\r\n case ValueCondition._IsGreater:\r\n return \"IsGreater\";\r\n case ValueCondition._IsLesser:\r\n return \"IsLesser\";\r\n default:\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Defines a predicate condition as an extension of Condition\r\n */\r\nexport class PredicateCondition extends Condition {\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n /**\r\n * Creates a new PredicateCondition\r\n * @param actionManager manager for the action the condition applies to\r\n * @param predicate defines the predicate function used to validate the condition\r\n */\r\n constructor(\r\n actionManager: ActionManager,\r\n /** defines the predicate function used to validate the condition */\r\n public predicate: () => boolean\r\n ) {\r\n super(actionManager);\r\n }\r\n\r\n /**\r\n * @returns the validity of the predicate condition\r\n */\r\n public isValid(): boolean {\r\n return this.predicate();\r\n }\r\n}\r\n\r\n/**\r\n * Defines a state condition as an extension of Condition\r\n */\r\nexport class StateCondition extends Condition {\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n private _target: any;\r\n\r\n /**\r\n * Creates a new StateCondition\r\n * @param actionManager manager for the action the condition applies to\r\n * @param target of the condition\r\n * @param value to compare with target state\r\n */\r\n constructor(\r\n actionManager: ActionManager,\r\n target: any,\r\n /** Value to compare with target state */\r\n public value: string\r\n ) {\r\n super(actionManager);\r\n\r\n this._target = target;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the current condition is met\r\n * @returns the validity of the state\r\n */\r\n public isValid(): boolean {\r\n return this._target.state === this.value;\r\n }\r\n\r\n /**\r\n * Serialize the StateCondition into a JSON compatible object\r\n * @returns serialization object\r\n */\r\n public serialize(): any {\r\n return this._serialize({\r\n name: \"StateCondition\",\r\n properties: [Action._GetTargetProperty(this._target), { name: \"value\", value: this.value }],\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ValueCondition\", ValueCondition);\r\nRegisterClass(\"BABYLON.PredicateCondition\", PredicateCondition);\r\nRegisterClass(\"BABYLON.StateCondition\", StateCondition);\r\n"]}
|
|
1
|
+
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../lts/core/generated/Actions/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD;;GAEG;AACH,MAAM,OAAO,SAAS;IAiBlB;;;OAGG;IACH,YAAY,aAA4B;QACpC,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,YAAoB;QACpC,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,MAAW,EAAE,YAAoB;QACxD,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzE,CAAC;IAED;;;OAGG;IACI,SAAS,KAAS,CAAC;IAE1B;;OAEG;IACO,UAAU,CAAC,mBAAwB;QACzC,OAAO;YACH,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,mBAAmB,CAAC,IAAI;YAC9B,UAAU,EAAE,mBAAmB,CAAC,UAAU;SAC7C,CAAC;IACN,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IAMzC;;OAEG;IACI,MAAM,KAAK,OAAO;QACrB,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c,CAAC,CAAC","sourcesContent":["import { Action } from \"./action\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nimport type { ActionManager } from \"./actionManager\";\r\n\r\n/**\r\n * A Condition applied to an Action\r\n */\r\nexport class Condition {\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n /**\r\n * @internal\r\n */\r\n public _evaluationId: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n public _currentResult: boolean;\r\n\r\n /**\r\n * Creates a new Condition\r\n * @param actionManager the manager of the action the condition is applied to\r\n */\r\n constructor(actionManager: ActionManager) {\r\n this._actionManager = actionManager;\r\n }\r\n\r\n /**\r\n * Check if the current condition is valid\r\n * @returns a boolean\r\n */\r\n public isValid(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getProperty(propertyPath: string): string {\r\n return this._actionManager._getProperty(propertyPath);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getEffectiveTarget(target: any, propertyPath: string): any {\r\n return this._actionManager._getEffectiveTarget(target, propertyPath);\r\n }\r\n\r\n /**\r\n * Serialize placeholder for child classes\r\n * @returns the serialized object\r\n */\r\n public serialize(): any {}\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _serialize(serializedCondition: any): any {\r\n return {\r\n type: 2, // Condition\r\n children: [],\r\n name: serializedCondition.name,\r\n properties: serializedCondition.properties,\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Defines specific conditional operators as extensions of Condition\r\n */\r\nexport class ValueCondition extends Condition {\r\n private static _IsEqual = 0;\r\n private static _IsDifferent = 1;\r\n private static _IsGreater = 2;\r\n private static _IsLesser = 3;\r\n\r\n /**\r\n * returns the number for IsEqual\r\n */\r\n public static get IsEqual(): number {\r\n return ValueCondition._IsEqual;\r\n }\r\n\r\n /**\r\n * Returns the number for IsDifferent\r\n */\r\n public static get IsDifferent(): number {\r\n return ValueCondition._IsDifferent;\r\n }\r\n\r\n /**\r\n * Returns the number for IsGreater\r\n */\r\n public static get IsGreater(): number {\r\n return ValueCondition._IsGreater;\r\n }\r\n\r\n /**\r\n * Returns the number for IsLesser\r\n */\r\n public static get IsLesser(): number {\r\n return ValueCondition._IsLesser;\r\n }\r\n\r\n /**\r\n * Internal only The action manager for the condition\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Creates a new ValueCondition\r\n * @param actionManager manager for the action the condition applies to\r\n * @param target for the action\r\n * @param propertyPath path to specify the property of the target the conditional operator uses\r\n * @param value the value compared by the conditional operator against the current value of the property\r\n * @param operator the conditional operator, default ValueCondition.IsEqual\r\n */\r\n constructor(\r\n actionManager: ActionManager,\r\n target: any,\r\n /** path to specify the property of the target the conditional operator uses */\r\n public propertyPath: string,\r\n /** the value compared by the conditional operator against the current value of the property */\r\n public value: any,\r\n /** the conditional operator, default ValueCondition.IsEqual */\r\n public operator: number = ValueCondition.IsEqual\r\n ) {\r\n super(actionManager);\r\n\r\n this._target = target;\r\n this._effectiveTarget = this._getEffectiveTarget(target, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n }\r\n\r\n /**\r\n * Compares the given value with the property value for the specified conditional operator\r\n * @returns the result of the comparison\r\n */\r\n public isValid(): boolean {\r\n switch (this.operator) {\r\n case ValueCondition.IsGreater:\r\n return this._effectiveTarget[this._property] > this.value;\r\n case ValueCondition.IsLesser:\r\n return this._effectiveTarget[this._property] < this.value;\r\n case ValueCondition.IsEqual:\r\n case ValueCondition.IsDifferent: {\r\n let check: boolean;\r\n\r\n if (this.value.equals) {\r\n check = this.value.equals(this._effectiveTarget[this._property]);\r\n } else {\r\n check = this.value === this._effectiveTarget[this._property];\r\n }\r\n return this.operator === ValueCondition.IsEqual ? check : !check;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Serialize the ValueCondition into a JSON compatible object\r\n * @returns serialization object\r\n */\r\n public serialize(): any {\r\n return this._serialize({\r\n name: \"ValueCondition\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"propertyPath\", value: this.propertyPath },\r\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\r\n { name: \"operator\", value: ValueCondition.GetOperatorName(this.operator) },\r\n ],\r\n });\r\n }\r\n\r\n /**\r\n * Gets the name of the conditional operator for the ValueCondition\r\n * @param operator the conditional operator\r\n * @returns the name\r\n */\r\n public static GetOperatorName(operator: number): string {\r\n switch (operator) {\r\n case ValueCondition._IsEqual:\r\n return \"IsEqual\";\r\n case ValueCondition._IsDifferent:\r\n return \"IsDifferent\";\r\n case ValueCondition._IsGreater:\r\n return \"IsGreater\";\r\n case ValueCondition._IsLesser:\r\n return \"IsLesser\";\r\n default:\r\n return \"\";\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Defines a predicate condition as an extension of Condition\r\n */\r\nexport class PredicateCondition extends Condition {\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n /**\r\n * Creates a new PredicateCondition\r\n * @param actionManager manager for the action the condition applies to\r\n * @param predicate defines the predicate function used to validate the condition\r\n */\r\n constructor(\r\n actionManager: ActionManager,\r\n /** defines the predicate function used to validate the condition */\r\n public predicate: () => boolean\r\n ) {\r\n super(actionManager);\r\n }\r\n\r\n /**\r\n * @returns the validity of the predicate condition\r\n */\r\n public isValid(): boolean {\r\n return this.predicate();\r\n }\r\n}\r\n\r\n/**\r\n * Defines a state condition as an extension of Condition\r\n */\r\nexport class StateCondition extends Condition {\r\n /**\r\n * Internal only - manager for action\r\n * @internal\r\n */\r\n public _actionManager: ActionManager;\r\n\r\n private _target: any;\r\n\r\n /**\r\n * Creates a new StateCondition\r\n * @param actionManager manager for the action the condition applies to\r\n * @param target of the condition\r\n * @param value to compare with target state\r\n */\r\n constructor(\r\n actionManager: ActionManager,\r\n target: any,\r\n /** Value to compare with target state */\r\n public value: string\r\n ) {\r\n super(actionManager);\r\n\r\n this._target = target;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the current condition is met\r\n * @returns the validity of the state\r\n */\r\n public isValid(): boolean {\r\n return this._target.state === this.value;\r\n }\r\n\r\n /**\r\n * Serialize the StateCondition into a JSON compatible object\r\n * @returns serialization object\r\n */\r\n public serialize(): any {\r\n return this._serialize({\r\n name: \"StateCondition\",\r\n properties: [Action._GetTargetProperty(this._target), { name: \"value\", value: this.value }],\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ValueCondition\", ValueCondition);\r\nRegisterClass(\"BABYLON.PredicateCondition\", PredicateCondition);\r\nRegisterClass(\"BABYLON.StateCondition\", StateCondition);\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from "./action";
|
|
2
2
|
import type { Condition } from "./condition";
|
|
3
|
-
|
|
3
|
+
import type { ActionEvent } from "./actionEvent";
|
|
4
4
|
/**
|
|
5
5
|
* This defines an action responsible to toggle a boolean once triggered.
|
|
6
6
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions
|
|
@@ -316,4 +316,3 @@ export declare class SetParentAction extends Action {
|
|
|
316
316
|
*/
|
|
317
317
|
serialize(parent: any): any;
|
|
318
318
|
}
|
|
319
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directActions.js","sourceRoot":"","sources":["../../../../lts/core/generated/Actions/directActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,MAAM;IAU3C;;;;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;QAEjC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAErG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,MAAW;QACxB,OAAO,KAAK,CAAC,UAAU,CACnB;YACI,IAAI,EAAE,iBAAiB;YACvB,UAAU,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACjG,EACD,MAAM,CACT,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AAC1D,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;AAC9D,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AAC1D,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAClE,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAClE,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACpE,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC;AACxD,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC;AACxD,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AAC1D,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAClE,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { Logger } from \"../Misc/logger\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Action } from \"./action\";\r\nimport type { Condition } from \"./condition\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\ndeclare type ActionEvent = import(\"./actionEvent\").ActionEvent;\r\n\r\n/**\r\n * This defines an action responsible to toggle a boolean once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SwitchBooleanAction extends Action {\r\n /**\r\n * The path to the boolean property in the target object\r\n */\r\n public propertyPath: string;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the boolean\r\n * @param propertyPath defines the path to the boolean property in the target object\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, propertyPath: string, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.propertyPath = propertyPath;\r\n this._target = this._effectiveTarget = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n }\r\n\r\n /**\r\n * Execute the action toggle the boolean value.\r\n */\r\n public execute(): void {\r\n this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SwitchBooleanAction\",\r\n properties: [Action._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to set a the state field of the target\r\n * to a desired value once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SetStateAction extends Action {\r\n /**\r\n * The value to store in the state field.\r\n */\r\n public value: string;\r\n\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the state property\r\n * @param value defines the value to store in the state field\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, value: string, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.value = value;\r\n this._target = target;\r\n }\r\n\r\n /**\r\n * Execute the action and store the value on the target state property.\r\n */\r\n public execute(): void {\r\n this._target.state = this.value;\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SetStateAction\",\r\n properties: [Action._GetTargetProperty(this._target), { name: \"value\", value: this.value }],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to set a property of the target\r\n * to a desired value once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SetValueAction extends Action {\r\n /**\r\n * The path of the property to set in the target.\r\n */\r\n public propertyPath: string;\r\n\r\n /**\r\n * The value to set in the property\r\n */\r\n public value: any;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the property\r\n * @param propertyPath defines the path of the property to set in the target\r\n * @param value defines the value to set in the property\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.propertyPath = propertyPath;\r\n this.value = value;\r\n this._target = this._effectiveTarget = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n }\r\n\r\n /**\r\n * Execute the action and set the targeted property to the desired value.\r\n */\r\n public execute(): void {\r\n this._effectiveTarget[this._property] = this.value;\r\n\r\n if (this._target.markAsDirty) {\r\n this._target.markAsDirty(this._property);\r\n }\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SetValueAction\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"propertyPath\", value: this.propertyPath },\r\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\r\n ],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to increment the target value\r\n * to a desired value once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class IncrementValueAction extends Action {\r\n /**\r\n * The path of the property to increment in the target.\r\n */\r\n public propertyPath: string;\r\n\r\n /**\r\n * The value we should increment the property by.\r\n */\r\n public value: any;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the property\r\n * @param propertyPath defines the path of the property to increment in the target\r\n * @param value defines the value value we should increment the property by\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.propertyPath = propertyPath;\r\n this.value = value;\r\n this._target = this._effectiveTarget = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n\r\n if (typeof this._effectiveTarget[this._property] !== \"number\") {\r\n Logger.Warn(\"Warning: IncrementValueAction can only be used with number values\");\r\n }\r\n }\r\n\r\n /**\r\n * Execute the action and increment the target of the value amount.\r\n */\r\n public execute(): void {\r\n this._effectiveTarget[this._property] += this.value;\r\n\r\n if (this._target.markAsDirty) {\r\n this._target.markAsDirty(this._property);\r\n }\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"IncrementValueAction\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"propertyPath\", value: this.propertyPath },\r\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\r\n ],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to start an animation once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class PlayAnimationAction extends Action {\r\n /**\r\n * Where the animation should start (animation frame)\r\n */\r\n public from: number;\r\n\r\n /**\r\n * Where the animation should stop (animation frame)\r\n */\r\n public to: number;\r\n\r\n /**\r\n * Define if the animation should loop or stop after the first play.\r\n */\r\n public loop?: boolean;\r\n\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the target animation or animation name\r\n * @param from defines from where the animation should start (animation frame)\r\n * @param to defines where the animation should stop (animation frame)\r\n * @param loop defines if the animation should loop or stop after the first play\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, from: number, to: number, loop?: boolean, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.from = from;\r\n this.to = to;\r\n this.loop = loop;\r\n this._target = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Execute the action and play the animation.\r\n */\r\n public execute(): void {\r\n const scene = this._actionManager.getScene();\r\n scene.beginAnimation(this._target, this.from, this.to, this.loop);\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"PlayAnimationAction\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"from\", value: String(this.from) },\r\n { name: \"to\", value: String(this.to) },\r\n { name: \"loop\", value: Action._SerializeValueAsString(this.loop) || false },\r\n ],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to stop an animation once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class StopAnimationAction extends Action {\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the target animation or animation name\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this._target = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Execute the action and stop the animation.\r\n */\r\n public execute(): void {\r\n const scene = this._actionManager.getScene();\r\n scene.stopAnimation(this._target);\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"StopAnimationAction\",\r\n properties: [Action._GetTargetProperty(this._target)],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible that does nothing once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class DoNothingAction extends Action {\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any = Constants.ACTION_NothingTrigger, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n }\r\n\r\n /**\r\n * Execute the action and do nothing.\r\n */\r\n public execute(): void {}\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"DoNothingAction\",\r\n properties: [],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to trigger several actions once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class CombineAction extends Action {\r\n /**\r\n * The list of aggregated animations to run.\r\n */\r\n public children: Action[];\r\n\r\n /**\r\n * defines if the children actions conditions should be check before execution\r\n */\r\n public enableChildrenConditions: boolean;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param children defines the list of aggregated animations to run\r\n * @param condition defines the trigger related conditions\r\n * @param enableChildrenConditions defines if the children actions conditions should be check before execution\r\n */\r\n constructor(triggerOptions: any, children: Action[], condition?: Condition, enableChildrenConditions = true) {\r\n super(triggerOptions, condition);\r\n this.children = children;\r\n this.enableChildrenConditions = enableChildrenConditions;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._actionManager = this._actionManager;\r\n this.children[index]._prepare();\r\n }\r\n }\r\n\r\n /**\r\n * Execute the action and executes all the aggregated actions.\r\n * @param evt\r\n */\r\n public execute(evt: ActionEvent): void {\r\n for (const action of this.children) {\r\n if (!this.enableChildrenConditions || action._evaluateConditionForCurrentFrame()) {\r\n action.execute(evt);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n const serializationObject = super._serialize(\r\n {\r\n name: \"CombineAction\",\r\n properties: [],\r\n combine: [],\r\n },\r\n parent\r\n );\r\n\r\n for (let i = 0; i < this.children.length; i++) {\r\n serializationObject.combine.push(this.children[i].serialize(null));\r\n }\r\n\r\n return serializationObject;\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to run code (external event) once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class ExecuteCodeAction extends Action {\r\n /**\r\n * The callback function to run.\r\n */\r\n public func: (evt: ActionEvent) => void;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param func defines the callback function to run\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, func: (evt: ActionEvent) => void, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.func = func;\r\n }\r\n\r\n /**\r\n * Execute the action and run the attached code.\r\n * @param evt\r\n */\r\n public execute(evt: ActionEvent): void {\r\n this.func(evt);\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to set the parent property of the target once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SetParentAction extends Action {\r\n private _parent: any;\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the target containing the parent property\r\n * @param parent defines from where the animation should start (animation frame)\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, parent: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this._target = target;\r\n this._parent = parent;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Execute the action and set the parent property.\r\n */\r\n public execute(): void {\r\n if (this._target.parent === this._parent) {\r\n return;\r\n }\r\n\r\n const invertParentWorldMatrix = this._parent.getWorldMatrix().clone();\r\n invertParentWorldMatrix.invert();\r\n\r\n this._target.position = Vector3.TransformCoordinates(this._target.position, invertParentWorldMatrix);\r\n\r\n this._target.parent = this._parent;\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SetParentAction\",\r\n properties: [Action._GetTargetProperty(this._target), Action._GetTargetProperty(this._parent)],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\r\nRegisterClass(\"BABYLON.ExecuteCodeAction\", ExecuteCodeAction);\r\nRegisterClass(\"BABYLON.DoNothingAction\", DoNothingAction);\r\nRegisterClass(\"BABYLON.StopAnimationAction\", StopAnimationAction);\r\nRegisterClass(\"BABYLON.PlayAnimationAction\", PlayAnimationAction);\r\nRegisterClass(\"BABYLON.IncrementValueAction\", IncrementValueAction);\r\nRegisterClass(\"BABYLON.SetValueAction\", SetValueAction);\r\nRegisterClass(\"BABYLON.SetStateAction\", SetStateAction);\r\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\r\nRegisterClass(\"BABYLON.SwitchBooleanAction\", SwitchBooleanAction);\r\nRegisterClass(\"BABYLON.CombineAction\", CombineAction);\r\n"]}
|
|
1
|
+
{"version":3,"file":"directActions.js","sourceRoot":"","sources":["../../../../lts/core/generated/Actions/directActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,MAAM;IAU3C;;;;;;OAMG;IACH,YAAY,cAAmB,EAAE,MAAW,EAAE,YAAoB,EAAE,SAAqB;QACrF,KAAK,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;IAClD,CAAC;IAED,gBAAgB;IACT,QAAQ;QACX,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3F,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;I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,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AAC1D,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;AAC9D,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AAC1D,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAClE,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAClE,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACpE,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC;AACxD,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC;AACxD,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;AAC1D,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;AAClE,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { Logger } from \"../Misc/logger\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Action } from \"./action\";\r\nimport type { Condition } from \"./condition\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nimport type { ActionEvent } from \"./actionEvent\";\r\n\r\n/**\r\n * This defines an action responsible to toggle a boolean once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SwitchBooleanAction extends Action {\r\n /**\r\n * The path to the boolean property in the target object\r\n */\r\n public propertyPath: string;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the boolean\r\n * @param propertyPath defines the path to the boolean property in the target object\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, propertyPath: string, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.propertyPath = propertyPath;\r\n this._target = this._effectiveTarget = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n }\r\n\r\n /**\r\n * Execute the action toggle the boolean value.\r\n */\r\n public execute(): void {\r\n this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SwitchBooleanAction\",\r\n properties: [Action._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to set a the state field of the target\r\n * to a desired value once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SetStateAction extends Action {\r\n /**\r\n * The value to store in the state field.\r\n */\r\n public value: string;\r\n\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the state property\r\n * @param value defines the value to store in the state field\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, value: string, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.value = value;\r\n this._target = target;\r\n }\r\n\r\n /**\r\n * Execute the action and store the value on the target state property.\r\n */\r\n public execute(): void {\r\n this._target.state = this.value;\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SetStateAction\",\r\n properties: [Action._GetTargetProperty(this._target), { name: \"value\", value: this.value }],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to set a property of the target\r\n * to a desired value once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SetValueAction extends Action {\r\n /**\r\n * The path of the property to set in the target.\r\n */\r\n public propertyPath: string;\r\n\r\n /**\r\n * The value to set in the property\r\n */\r\n public value: any;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the property\r\n * @param propertyPath defines the path of the property to set in the target\r\n * @param value defines the value to set in the property\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.propertyPath = propertyPath;\r\n this.value = value;\r\n this._target = this._effectiveTarget = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n }\r\n\r\n /**\r\n * Execute the action and set the targeted property to the desired value.\r\n */\r\n public execute(): void {\r\n this._effectiveTarget[this._property] = this.value;\r\n\r\n if (this._target.markAsDirty) {\r\n this._target.markAsDirty(this._property);\r\n }\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SetValueAction\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"propertyPath\", value: this.propertyPath },\r\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\r\n ],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to increment the target value\r\n * to a desired value once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class IncrementValueAction extends Action {\r\n /**\r\n * The path of the property to increment in the target.\r\n */\r\n public propertyPath: string;\r\n\r\n /**\r\n * The value we should increment the property by.\r\n */\r\n public value: any;\r\n\r\n private _target: any;\r\n private _effectiveTarget: any;\r\n private _property: string;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the object containing the property\r\n * @param propertyPath defines the path of the property to increment in the target\r\n * @param value defines the value value we should increment the property by\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, propertyPath: string, value: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.propertyPath = propertyPath;\r\n this.value = value;\r\n this._target = this._effectiveTarget = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\r\n this._property = this._getProperty(this.propertyPath);\r\n\r\n if (typeof this._effectiveTarget[this._property] !== \"number\") {\r\n Logger.Warn(\"Warning: IncrementValueAction can only be used with number values\");\r\n }\r\n }\r\n\r\n /**\r\n * Execute the action and increment the target of the value amount.\r\n */\r\n public execute(): void {\r\n this._effectiveTarget[this._property] += this.value;\r\n\r\n if (this._target.markAsDirty) {\r\n this._target.markAsDirty(this._property);\r\n }\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"IncrementValueAction\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"propertyPath\", value: this.propertyPath },\r\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\r\n ],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to start an animation once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class PlayAnimationAction extends Action {\r\n /**\r\n * Where the animation should start (animation frame)\r\n */\r\n public from: number;\r\n\r\n /**\r\n * Where the animation should stop (animation frame)\r\n */\r\n public to: number;\r\n\r\n /**\r\n * Define if the animation should loop or stop after the first play.\r\n */\r\n public loop?: boolean;\r\n\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the target animation or animation name\r\n * @param from defines from where the animation should start (animation frame)\r\n * @param to defines where the animation should stop (animation frame)\r\n * @param loop defines if the animation should loop or stop after the first play\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, from: number, to: number, loop?: boolean, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.from = from;\r\n this.to = to;\r\n this.loop = loop;\r\n this._target = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Execute the action and play the animation.\r\n */\r\n public execute(): void {\r\n const scene = this._actionManager.getScene();\r\n scene.beginAnimation(this._target, this.from, this.to, this.loop);\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"PlayAnimationAction\",\r\n properties: [\r\n Action._GetTargetProperty(this._target),\r\n { name: \"from\", value: String(this.from) },\r\n { name: \"to\", value: String(this.to) },\r\n { name: \"loop\", value: Action._SerializeValueAsString(this.loop) || false },\r\n ],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to stop an animation once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class StopAnimationAction extends Action {\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the target animation or animation name\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this._target = target;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Execute the action and stop the animation.\r\n */\r\n public execute(): void {\r\n const scene = this._actionManager.getScene();\r\n scene.stopAnimation(this._target);\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"StopAnimationAction\",\r\n properties: [Action._GetTargetProperty(this._target)],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible that does nothing once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class DoNothingAction extends Action {\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any = Constants.ACTION_NothingTrigger, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n }\r\n\r\n /**\r\n * Execute the action and do nothing.\r\n */\r\n public execute(): void {}\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"DoNothingAction\",\r\n properties: [],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to trigger several actions once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class CombineAction extends Action {\r\n /**\r\n * The list of aggregated animations to run.\r\n */\r\n public children: Action[];\r\n\r\n /**\r\n * defines if the children actions conditions should be check before execution\r\n */\r\n public enableChildrenConditions: boolean;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param children defines the list of aggregated animations to run\r\n * @param condition defines the trigger related conditions\r\n * @param enableChildrenConditions defines if the children actions conditions should be check before execution\r\n */\r\n constructor(triggerOptions: any, children: Action[], condition?: Condition, enableChildrenConditions = true) {\r\n super(triggerOptions, condition);\r\n this.children = children;\r\n this.enableChildrenConditions = enableChildrenConditions;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._actionManager = this._actionManager;\r\n this.children[index]._prepare();\r\n }\r\n }\r\n\r\n /**\r\n * Execute the action and executes all the aggregated actions.\r\n * @param evt\r\n */\r\n public execute(evt: ActionEvent): void {\r\n for (const action of this.children) {\r\n if (!this.enableChildrenConditions || action._evaluateConditionForCurrentFrame()) {\r\n action.execute(evt);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n const serializationObject = super._serialize(\r\n {\r\n name: \"CombineAction\",\r\n properties: [],\r\n combine: [],\r\n },\r\n parent\r\n );\r\n\r\n for (let i = 0; i < this.children.length; i++) {\r\n serializationObject.combine.push(this.children[i].serialize(null));\r\n }\r\n\r\n return serializationObject;\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to run code (external event) once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class ExecuteCodeAction extends Action {\r\n /**\r\n * The callback function to run.\r\n */\r\n public func: (evt: ActionEvent) => void;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param func defines the callback function to run\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, func: (evt: ActionEvent) => void, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this.func = func;\r\n }\r\n\r\n /**\r\n * Execute the action and run the attached code.\r\n * @param evt\r\n */\r\n public execute(evt: ActionEvent): void {\r\n this.func(evt);\r\n }\r\n}\r\n\r\n/**\r\n * This defines an action responsible to set the parent property of the target once triggered.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\r\n */\r\nexport class SetParentAction extends Action {\r\n private _parent: any;\r\n private _target: any;\r\n\r\n /**\r\n * Instantiate the action\r\n * @param triggerOptions defines the trigger options\r\n * @param target defines the target containing the parent property\r\n * @param parent defines from where the animation should start (animation frame)\r\n * @param condition defines the trigger related conditions\r\n */\r\n constructor(triggerOptions: any, target: any, parent: any, condition?: Condition) {\r\n super(triggerOptions, condition);\r\n this._target = target;\r\n this._parent = parent;\r\n }\r\n\r\n /** @internal */\r\n public _prepare(): void {}\r\n\r\n /**\r\n * Execute the action and set the parent property.\r\n */\r\n public execute(): void {\r\n if (this._target.parent === this._parent) {\r\n return;\r\n }\r\n\r\n const invertParentWorldMatrix = this._parent.getWorldMatrix().clone();\r\n invertParentWorldMatrix.invert();\r\n\r\n this._target.position = Vector3.TransformCoordinates(this._target.position, invertParentWorldMatrix);\r\n\r\n this._target.parent = this._parent;\r\n }\r\n\r\n /**\r\n * Serializes the actions and its related information.\r\n * @param parent defines the object to serialize in\r\n * @returns the serialized object\r\n */\r\n public serialize(parent: any): any {\r\n return super._serialize(\r\n {\r\n name: \"SetParentAction\",\r\n properties: [Action._GetTargetProperty(this._target), Action._GetTargetProperty(this._parent)],\r\n },\r\n parent\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\r\nRegisterClass(\"BABYLON.ExecuteCodeAction\", ExecuteCodeAction);\r\nRegisterClass(\"BABYLON.DoNothingAction\", DoNothingAction);\r\nRegisterClass(\"BABYLON.StopAnimationAction\", StopAnimationAction);\r\nRegisterClass(\"BABYLON.PlayAnimationAction\", PlayAnimationAction);\r\nRegisterClass(\"BABYLON.IncrementValueAction\", IncrementValueAction);\r\nRegisterClass(\"BABYLON.SetValueAction\", SetValueAction);\r\nRegisterClass(\"BABYLON.SetStateAction\", SetStateAction);\r\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\r\nRegisterClass(\"BABYLON.SwitchBooleanAction\", SwitchBooleanAction);\r\nRegisterClass(\"BABYLON.CombineAction\", CombineAction);\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Nullable } from "../types";
|
|
2
|
-
|
|
2
|
+
import type { Animation } from "./animation";
|
|
3
3
|
/**
|
|
4
4
|
* Interface containing an array of animations
|
|
5
5
|
*/
|
|
@@ -9,4 +9,3 @@ export interface IAnimatable {
|
|
|
9
9
|
*/
|
|
10
10
|
animations: Nullable<Array<Animation>>;
|
|
11
11
|
}
|
|
12
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animatable.interface.js","sourceRoot":"","sources":["../../../../lts/core/generated/Animations/animatable.interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"../types\";\r\n\r\
|
|
1
|
+
{"version":3,"file":"animatable.interface.js","sourceRoot":"","sources":["../../../../lts/core/generated/Animations/animatable.interface.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"../types\";\r\n\r\nimport type { Animation } from \"./animation\";\r\n\r\n/**\r\n * Interface containing an array of animations\r\n */\r\nexport interface IAnimatable {\r\n /**\r\n * Array of animations\r\n */\r\n animations: Nullable<Array<Animation>>;\r\n}\r\n"]}
|
|
@@ -9,8 +9,8 @@ import type { AnimationEvent } from "./animationEvent";
|
|
|
9
9
|
import { Node } from "../node";
|
|
10
10
|
import type { IAnimatable } from "./animatable.interface";
|
|
11
11
|
import { Size } from "../Maths/math.size";
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import type { Animatable } from "./animatable";
|
|
13
|
+
import type { RuntimeAnimation } from "./runtimeAnimation";
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -66,7 +66,7 @@ export declare class Animation {
|
|
|
66
66
|
/**
|
|
67
67
|
* @internal Internal use only
|
|
68
68
|
*/
|
|
69
|
-
_runtimeAnimations:
|
|
69
|
+
_runtimeAnimations: RuntimeAnimation[];
|
|
70
70
|
/**
|
|
71
71
|
* The set of event that will be linked to this animation
|
|
72
72
|
*/
|
|
@@ -496,4 +496,3 @@ export declare class Animation {
|
|
|
496
496
|
*/
|
|
497
497
|
static CreateFromSnippetAsync: typeof Animation.ParseFromSnippetAsync;
|
|
498
498
|
}
|
|
499
|
-
export {};
|