1 |
- {"ast":null,"code":"import { Logger } from \"../Misc/logger.js\";\nimport { Vector3 } from \"../Maths/math.vector.js\";\nimport { Action } from \"./action.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\n/**\n * This defines an action responsible to toggle a boolean once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SwitchBooleanAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the boolean\n * @param propertyPath defines the path to the boolean property in the target object\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, propertyPath, condition) {\n super(triggerOptions, condition);\n this.propertyPath = propertyPath;\n this._target = this._effectiveTarget = target;\n }\n /** @internal */\n _prepare() {\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\n this._property = this._getProperty(this.propertyPath);\n }\n /**\n * Execute the action toggle the boolean value.\n */\n execute() {\n this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SwitchBooleanAction\",\n properties: [Action._GetTargetProperty(this._target), {\n name: \"propertyPath\",\n value: this.propertyPath\n }]\n }, parent);\n }\n}\n/**\n * This defines an action responsible to set a the state field of the target\n * to a desired value once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SetStateAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the state property\n * @param value defines the value to store in the state field\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, value, condition) {\n super(triggerOptions, condition);\n this.value = value;\n this._target = target;\n }\n /**\n * Execute the action and store the value on the target state property.\n */\n execute() {\n this._target.state = this.value;\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SetStateAction\",\n properties: [Action._GetTargetProperty(this._target), {\n name: \"value\",\n value: this.value\n }]\n }, parent);\n }\n}\n/**\n * This defines an action responsible to set a property of the target\n * to a desired value once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SetValueAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the property\n * @param propertyPath defines the path of the property to set in the target\n * @param value defines the value to set in the property\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, propertyPath, value, condition) {\n super(triggerOptions, condition);\n this.propertyPath = propertyPath;\n this.value = value;\n this._target = this._effectiveTarget = target;\n }\n /** @internal */\n _prepare() {\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\n this._property = this._getProperty(this.propertyPath);\n }\n /**\n * Execute the action and set the targeted property to the desired value.\n */\n execute() {\n this._effectiveTarget[this._property] = this.value;\n if (this._target.markAsDirty) {\n this._target.markAsDirty(this._property);\n }\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SetValueAction\",\n properties: [Action._GetTargetProperty(this._target), {\n name: \"propertyPath\",\n value: this.propertyPath\n }, {\n name: \"value\",\n value: Action._SerializeValueAsString(this.value)\n }]\n }, parent);\n }\n}\n/**\n * This defines an action responsible to increment the target value\n * to a desired value once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class IncrementValueAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the property\n * @param propertyPath defines the path of the property to increment in the target\n * @param value defines the value value we should increment the property by\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, propertyPath, value, condition) {\n super(triggerOptions, condition);\n this.propertyPath = propertyPath;\n this.value = value;\n this._target = this._effectiveTarget = target;\n }\n /** @internal */\n _prepare() {\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\n this._property = this._getProperty(this.propertyPath);\n if (typeof this._effectiveTarget[this._property] !== \"number\") {\n Logger.Warn(\"Warning: IncrementValueAction can only be used with number values\");\n }\n }\n /**\n * Execute the action and increment the target of the value amount.\n */\n execute() {\n this._effectiveTarget[this._property] += this.value;\n if (this._target.markAsDirty) {\n this._target.markAsDirty(this._property);\n }\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"IncrementValueAction\",\n properties: [Action._GetTargetProperty(this._target), {\n name: \"propertyPath\",\n value: this.propertyPath\n }, {\n name: \"value\",\n value: Action._SerializeValueAsString(this.value)\n }]\n }, parent);\n }\n}\n/**\n * This defines an action responsible to start an animation once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class PlayAnimationAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the target animation or animation name\n * @param from defines from where the animation should start (animation frame)\n * @param to defines where the animation should stop (animation frame)\n * @param loop defines if the animation should loop or stop after the first play\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, from, to, loop, condition) {\n super(triggerOptions, condition);\n this.from = from;\n this.to = to;\n this.loop = loop;\n this._target = target;\n }\n /** @internal */\n _prepare() {}\n /**\n * Execute the action and play the animation.\n */\n execute() {\n const scene = this._actionManager.getScene();\n scene.beginAnimation(this._target, this.from, this.to, this.loop);\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"PlayAnimationAction\",\n properties: [Action._GetTargetProperty(this._target), {\n name: \"from\",\n value: String(this.from)\n }, {\n name: \"to\",\n value: String(this.to)\n }, {\n name: \"loop\",\n value: Action._SerializeValueAsString(this.loop) || false\n }]\n }, parent);\n }\n}\n/**\n * This defines an action responsible to stop an animation once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class StopAnimationAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the target animation or animation name\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, condition) {\n super(triggerOptions, condition);\n this._target = target;\n }\n /** @internal */\n _prepare() {}\n /**\n * Execute the action and stop the animation.\n */\n execute() {\n const scene = this._actionManager.getScene();\n scene.stopAnimation(this._target);\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"StopAnimationAction\",\n properties: [Action._GetTargetProperty(this._target)]\n }, parent);\n }\n}\n/**\n * This defines an action responsible that does nothing once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class DoNothingAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions = 0, condition) {\n super(triggerOptions, condition);\n }\n /**\n * Execute the action and do nothing.\n */\n execute() {}\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"DoNothingAction\",\n properties: []\n }, parent);\n }\n}\n/**\n * This defines an action responsible to trigger several actions once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class CombineAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param children defines the list of aggregated animations to run\n * @param condition defines the trigger related conditions\n * @param enableChildrenConditions defines if the children actions conditions should be check before execution\n */\n constructor(triggerOptions, children, condition, enableChildrenConditions = true) {\n super(triggerOptions, condition);\n this.children = children;\n this.enableChildrenConditions = enableChildrenConditions;\n }\n /** @internal */\n _prepare() {\n for (let index = 0; index < this.children.length; index++) {\n this.children[index]._actionManager = this._actionManager;\n this.children[index]._prepare();\n }\n }\n /**\n * Execute the action and executes all the aggregated actions.\n * @param evt event to execute\n */\n execute(evt) {\n for (const action of this.children) {\n if (!this.enableChildrenConditions || action._evaluateConditionForCurrentFrame()) {\n action.execute(evt);\n }\n }\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n const serializationObject = super._serialize({\n name: \"CombineAction\",\n properties: [],\n combine: []\n }, parent);\n for (let i = 0; i < this.children.length; i++) {\n serializationObject.combine.push(this.children[i].serialize(null));\n }\n return serializationObject;\n }\n}\n/**\n * This defines an action responsible to run code (external event) once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class ExecuteCodeAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param func defines the callback function to run\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, func, condition) {\n super(triggerOptions, condition);\n this.func = func;\n }\n /**\n * Execute the action and run the attached code.\n * @param evt event to execute\n */\n execute(evt) {\n this.func(evt);\n }\n}\n/**\n * This defines an action responsible to set the parent property of the target once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SetParentAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the target containing the parent property\n * @param parent defines from where the animation should start (animation frame)\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, parent, condition) {\n super(triggerOptions, condition);\n this._target = target;\n this._parent = parent;\n }\n /** @internal */\n _prepare() {}\n /**\n * Execute the action and set the parent property.\n */\n execute() {\n if (this._target.parent === this._parent) {\n return;\n }\n const invertParentWorldMatrix = this._parent.getWorldMatrix().clone();\n invertParentWorldMatrix.invert();\n this._target.position = Vector3.TransformCoordinates(this._target.position, invertParentWorldMatrix);\n this._target.parent = this._parent;\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SetParentAction\",\n properties: [Action._GetTargetProperty(this._target), Action._GetTargetProperty(this._parent)]\n }, parent);\n }\n}\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\nRegisterClass(\"BABYLON.ExecuteCodeAction\", ExecuteCodeAction);\nRegisterClass(\"BABYLON.DoNothingAction\", DoNothingAction);\nRegisterClass(\"BABYLON.StopAnimationAction\", StopAnimationAction);\nRegisterClass(\"BABYLON.PlayAnimationAction\", PlayAnimationAction);\nRegisterClass(\"BABYLON.IncrementValueAction\", IncrementValueAction);\nRegisterClass(\"BABYLON.SetValueAction\", SetValueAction);\nRegisterClass(\"BABYLON.SetStateAction\", SetStateAction);\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\nRegisterClass(\"BABYLON.SwitchBooleanAction\", SwitchBooleanAction);\nRegisterClass(\"BABYLON.CombineAction\", CombineAction);","map":{"version":3,"names":["Logger","Vector3","Action","RegisterClass","SwitchBooleanAction","constructor","triggerOptions","target","propertyPath","condition","_target","_effectiveTarget","_prepare","_getEffectiveTarget","_property","_getProperty","execute","serialize","parent","_serialize","name","properties","_GetTargetProperty","value","SetStateAction","state","SetValueAction","markAsDirty","_SerializeValueAsString","IncrementValueAction","Warn","PlayAnimationAction","from","to","loop","scene","_actionManager","getScene","beginAnimation","String","StopAnimationAction","stopAnimation","DoNothingAction","CombineAction","children","enableChildrenConditions","index","length","evt","action","_evaluateConditionForCurrentFrame","serializationObject","combine","i","push","ExecuteCodeAction","func","SetParentAction","_parent","invertParentWorldMatrix","getWorldMatrix","clone","invert","position","TransformCoordinates"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Actions/directActions.js"],"sourcesContent":["import { Logger } from \"../Misc/logger.js\";\nimport { Vector3 } from \"../Maths/math.vector.js\";\nimport { Action } from \"./action.js\";\n\nimport { RegisterClass } from \"../Misc/typeStore.js\";\n/**\n * This defines an action responsible to toggle a boolean once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SwitchBooleanAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the boolean\n * @param propertyPath defines the path to the boolean property in the target object\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, propertyPath, condition) {\n super(triggerOptions, condition);\n this.propertyPath = propertyPath;\n this._target = this._effectiveTarget = target;\n }\n /** @internal */\n _prepare() {\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\n this._property = this._getProperty(this.propertyPath);\n }\n /**\n * Execute the action toggle the boolean value.\n */\n execute() {\n this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SwitchBooleanAction\",\n properties: [Action._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }],\n }, parent);\n }\n}\n/**\n * This defines an action responsible to set a the state field of the target\n * to a desired value once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SetStateAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the state property\n * @param value defines the value to store in the state field\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, value, condition) {\n super(triggerOptions, condition);\n this.value = value;\n this._target = target;\n }\n /**\n * Execute the action and store the value on the target state property.\n */\n execute() {\n this._target.state = this.value;\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SetStateAction\",\n properties: [Action._GetTargetProperty(this._target), { name: \"value\", value: this.value }],\n }, parent);\n }\n}\n/**\n * This defines an action responsible to set a property of the target\n * to a desired value once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SetValueAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the property\n * @param propertyPath defines the path of the property to set in the target\n * @param value defines the value to set in the property\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, propertyPath, value, condition) {\n super(triggerOptions, condition);\n this.propertyPath = propertyPath;\n this.value = value;\n this._target = this._effectiveTarget = target;\n }\n /** @internal */\n _prepare() {\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\n this._property = this._getProperty(this.propertyPath);\n }\n /**\n * Execute the action and set the targeted property to the desired value.\n */\n execute() {\n this._effectiveTarget[this._property] = this.value;\n if (this._target.markAsDirty) {\n this._target.markAsDirty(this._property);\n }\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SetValueAction\",\n properties: [\n Action._GetTargetProperty(this._target),\n { name: \"propertyPath\", value: this.propertyPath },\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\n ],\n }, parent);\n }\n}\n/**\n * This defines an action responsible to increment the target value\n * to a desired value once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class IncrementValueAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the object containing the property\n * @param propertyPath defines the path of the property to increment in the target\n * @param value defines the value value we should increment the property by\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, propertyPath, value, condition) {\n super(triggerOptions, condition);\n this.propertyPath = propertyPath;\n this.value = value;\n this._target = this._effectiveTarget = target;\n }\n /** @internal */\n _prepare() {\n this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath);\n this._property = this._getProperty(this.propertyPath);\n if (typeof this._effectiveTarget[this._property] !== \"number\") {\n Logger.Warn(\"Warning: IncrementValueAction can only be used with number values\");\n }\n }\n /**\n * Execute the action and increment the target of the value amount.\n */\n execute() {\n this._effectiveTarget[this._property] += this.value;\n if (this._target.markAsDirty) {\n this._target.markAsDirty(this._property);\n }\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"IncrementValueAction\",\n properties: [\n Action._GetTargetProperty(this._target),\n { name: \"propertyPath\", value: this.propertyPath },\n { name: \"value\", value: Action._SerializeValueAsString(this.value) },\n ],\n }, parent);\n }\n}\n/**\n * This defines an action responsible to start an animation once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class PlayAnimationAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the target animation or animation name\n * @param from defines from where the animation should start (animation frame)\n * @param to defines where the animation should stop (animation frame)\n * @param loop defines if the animation should loop or stop after the first play\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, from, to, loop, condition) {\n super(triggerOptions, condition);\n this.from = from;\n this.to = to;\n this.loop = loop;\n this._target = target;\n }\n /** @internal */\n _prepare() { }\n /**\n * Execute the action and play the animation.\n */\n execute() {\n const scene = this._actionManager.getScene();\n scene.beginAnimation(this._target, this.from, this.to, this.loop);\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"PlayAnimationAction\",\n properties: [\n Action._GetTargetProperty(this._target),\n { name: \"from\", value: String(this.from) },\n { name: \"to\", value: String(this.to) },\n { name: \"loop\", value: Action._SerializeValueAsString(this.loop) || false },\n ],\n }, parent);\n }\n}\n/**\n * This defines an action responsible to stop an animation once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class StopAnimationAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the target animation or animation name\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, condition) {\n super(triggerOptions, condition);\n this._target = target;\n }\n /** @internal */\n _prepare() { }\n /**\n * Execute the action and stop the animation.\n */\n execute() {\n const scene = this._actionManager.getScene();\n scene.stopAnimation(this._target);\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"StopAnimationAction\",\n properties: [Action._GetTargetProperty(this._target)],\n }, parent);\n }\n}\n/**\n * This defines an action responsible that does nothing once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class DoNothingAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions = 0, condition) {\n super(triggerOptions, condition);\n }\n /**\n * Execute the action and do nothing.\n */\n execute() { }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"DoNothingAction\",\n properties: [],\n }, parent);\n }\n}\n/**\n * This defines an action responsible to trigger several actions once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class CombineAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param children defines the list of aggregated animations to run\n * @param condition defines the trigger related conditions\n * @param enableChildrenConditions defines if the children actions conditions should be check before execution\n */\n constructor(triggerOptions, children, condition, enableChildrenConditions = true) {\n super(triggerOptions, condition);\n this.children = children;\n this.enableChildrenConditions = enableChildrenConditions;\n }\n /** @internal */\n _prepare() {\n for (let index = 0; index < this.children.length; index++) {\n this.children[index]._actionManager = this._actionManager;\n this.children[index]._prepare();\n }\n }\n /**\n * Execute the action and executes all the aggregated actions.\n * @param evt event to execute\n */\n execute(evt) {\n for (const action of this.children) {\n if (!this.enableChildrenConditions || action._evaluateConditionForCurrentFrame()) {\n action.execute(evt);\n }\n }\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n const serializationObject = super._serialize({\n name: \"CombineAction\",\n properties: [],\n combine: [],\n }, parent);\n for (let i = 0; i < this.children.length; i++) {\n serializationObject.combine.push(this.children[i].serialize(null));\n }\n return serializationObject;\n }\n}\n/**\n * This defines an action responsible to run code (external event) once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class ExecuteCodeAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param func defines the callback function to run\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, func, condition) {\n super(triggerOptions, condition);\n this.func = func;\n }\n /**\n * Execute the action and run the attached code.\n * @param evt event to execute\n */\n execute(evt) {\n this.func(evt);\n }\n}\n/**\n * This defines an action responsible to set the parent property of the target once triggered.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\nexport class SetParentAction extends Action {\n /**\n * Instantiate the action\n * @param triggerOptions defines the trigger options\n * @param target defines the target containing the parent property\n * @param parent defines from where the animation should start (animation frame)\n * @param condition defines the trigger related conditions\n */\n constructor(triggerOptions, target, parent, condition) {\n super(triggerOptions, condition);\n this._target = target;\n this._parent = parent;\n }\n /** @internal */\n _prepare() { }\n /**\n * Execute the action and set the parent property.\n */\n execute() {\n if (this._target.parent === this._parent) {\n return;\n }\n const invertParentWorldMatrix = this._parent.getWorldMatrix().clone();\n invertParentWorldMatrix.invert();\n this._target.position = Vector3.TransformCoordinates(this._target.position, invertParentWorldMatrix);\n this._target.parent = this._parent;\n }\n /**\n * Serializes the actions and its related information.\n * @param parent defines the object to serialize in\n * @returns the serialized object\n */\n serialize(parent) {\n return super._serialize({\n name: \"SetParentAction\",\n properties: [Action._GetTargetProperty(this._target), Action._GetTargetProperty(this._parent)],\n }, parent);\n }\n}\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\nRegisterClass(\"BABYLON.ExecuteCodeAction\", ExecuteCodeAction);\nRegisterClass(\"BABYLON.DoNothingAction\", DoNothingAction);\nRegisterClass(\"BABYLON.StopAnimationAction\", StopAnimationAction);\nRegisterClass(\"BABYLON.PlayAnimationAction\", PlayAnimationAction);\nRegisterClass(\"BABYLON.IncrementValueAction\", IncrementValueAction);\nRegisterClass(\"BABYLON.SetValueAction\", SetValueAction);\nRegisterClass(\"BABYLON.SetStateAction\", SetStateAction);\nRegisterClass(\"BABYLON.SetParentAction\", SetParentAction);\nRegisterClass(\"BABYLON.SwitchBooleanAction\", SwitchBooleanAction);\nRegisterClass(\"BABYLON.CombineAction\", CombineAction);\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAASC,MAAM,QAAQ,aAAa;AAEpC,SAASC,aAAa,QAAQ,sBAAsB;AACpD;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SAASF,MAAM,CAAC;EAC5C;AACJ;AACA;AACA;AACA;AACA;AACA;EACIG,WAAWA,CAACC,cAAc,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,EAAE;IACzD,KAAK,CAACH,cAAc,EAAEG,SAAS,CAAC;IAChC,IAAI,CAACD,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACE,OAAO,GAAG,IAAI,CAACC,gBAAgB,GAAGJ,MAAM;EACjD;EACA;EACAK,QAAQA,CAAA,EAAG;IACP,IAAI,CAACD,gBAAgB,GAAG,IAAI,CAACE,mBAAmB,CAAC,IAAI,CAACF,gBAAgB,EAAE,IAAI,CAACH,YAAY,CAAC;IAC1F,IAAI,CAACM,SAAS,GAAG,IAAI,CAACC,YAAY,CAAC,IAAI,CAACP,YAAY,CAAC;EACzD;EACA;AACJ;AACA;EACIQ,OAAOA,CAAA,EAAG;IACN,IAAI,CAACL,gBAAgB,CAAC,IAAI,CAACG,SAAS,CAAC,GAAG,CAAC,IAAI,CAACH,gBAAgB,CAAC,IAAI,CAACG,SAAS,CAAC;EAClF;EACA;AACJ;AACA;AACA;AACA;EACIG,SAASA,CAACC,MAAM,EAAE;IACd,OAAO,KAAK,CAACC,UAAU,CAAC;MACpBC,IAAI,EAAE,qBAAqB;MAC3BC,UAAU,EAAE,CAACnB,MAAM,CAACoB,kBAAkB,CAAC,IAAI,CAACZ,OAAO,CAAC,EAAE;QAAEU,IAAI,EAAE,cAAc;QAAEG,KAAK,EAAE,IAAI,CAACf;MAAa,CAAC;IAC5G,CAA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