@babylonjs/core 6.31.0 → 6.32.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.js.map +1 -1
- package/Animations/animation.d.ts +8 -2
- package/Animations/animation.js +21 -13
- package/Animations/animation.js.map +1 -1
- package/Animations/runtimeAnimation.js +6 -15
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
- package/Debug/skeletonViewer.d.ts +2 -2
- package/Debug/skeletonViewer.js +38 -12
- package/Debug/skeletonViewer.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Processors/shaderCodeNode.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +12 -12
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +4 -4
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +9 -9
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +11 -11
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +10 -10
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +4 -4
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +16 -6
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +17 -6
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +16 -9
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +8 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +8 -12
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +9 -19
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +2 -2
- package/FlowGraph/flowGraphBlock.js +20 -4
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +4 -4
- package/FlowGraph/flowGraphContext.js +22 -40
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphPath.d.ts +27 -0
- package/FlowGraph/flowGraphPath.js +136 -0
- package/FlowGraph/flowGraphPath.js.map +1 -0
- package/FlowGraph/flowGraphPathComponent.d.ts +42 -0
- package/FlowGraph/flowGraphPathComponent.js +51 -0
- package/FlowGraph/flowGraphPathComponent.js.map +1 -0
- package/FlowGraph/index.d.ts +1 -0
- package/FlowGraph/index.js +1 -0
- package/FlowGraph/index.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +8 -0
- package/Lights/Shadows/shadowGenerator.js +12 -0
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -0
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Maths/math.size.d.ts +6 -0
- package/Maths/math.size.js +8 -0
- package/Maths/math.size.js.map +1 -1
- package/Maths/math.vector.js +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/geometry.d.ts +8 -0
- package/Meshes/geometry.js +20 -1
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +8 -0
- package/Meshes/mesh.js +14 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/tools.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +9 -1
- package/PostProcesses/postProcess.js +16 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +6 -3
- package/Rendering/geometryBufferRenderer.js +28 -10
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +5 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Shaders/ShadersInclude/bonesDeclaration.js +1 -1
- package/Shaders/ShadersInclude/bonesDeclaration.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/package.json +1 -1
- package/types.js.map +1 -1
package/Actions/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../dev/core/src/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;;;;OAIG;IACH;IACI,8DAA8D;IACvD,cAAmB,EAC1B,SAAqB;QADd,mBAAc,GAAd,cAAc,CAAK;QAZ9B;;WAEG;QACI,8BAAyB,GAAG,IAAI,UAAU,EAAU,CAAC;QAYxD,IAAI,cAAc,CAAC,SAAS,EAAE;YAC1B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;YACtC,IAAI,CAAC,iBAAiB,GAAG,cAAc,CAAC,SAAS,CAAC;SACrD;aAAM,IAAI,cAAc,CAAC,OAAO,EAAE;YAC/B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;SACzC;aAAM;YACH,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC;SACjC;QAED,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B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AAS;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\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"]}
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../dev/core/src/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;;;;OAIG;IACH;IACI,8DAA8D;IACvD,cAAmB,EAC1B,SAAqB;QADd,mBAAc,GAAd,cAAc,CAAK;QAZ9B;;WAEG;QACI,8BAAyB,GAAG,IAAI,UAAU,EAAU,CAAC;QAYxD,IAAI,cAAc,CAAC,SAAS,EAAE;YAC1B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;YACtC,IAAI,CAAC,iBAAiB,GAAG,cAAc,CAAC,SAAS,CAAC;SACrD;aAAM,IAAI,cAAc,CAAC,OAAO,EAAE;YAC/B,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;SACzC;aAAM;YACH,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC;SACjC;QAED,IAAI,CAAC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rE;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;gBACxB,CAAC,CAAC,iBAAiB;gBACnB,CAAC,CAAU,MAAO,CAAC,SAAS;oBAC1B,CAAC,CAAC,kBAAkB;oBACpB,CAAC,CAAY,MAAO,CAAC,WAAW;wBAC9B,CAAC,CAAC,oBAAoB;wBACtB,CAAC,CAAC,iBAAiB;QAC7B,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\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"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IEasingFunction, EasingFunction } from "./easing";
|
|
2
2
|
import { Vector3, Quaternion, Vector2, Matrix } from "../Maths/math.vector";
|
|
3
3
|
import { Color3, Color4 } from "../Maths/math.color";
|
|
4
|
-
import type { Nullable } from "../types";
|
|
4
|
+
import type { DeepImmutable, Nullable } from "../types";
|
|
5
5
|
import type { Scene } from "../scene";
|
|
6
6
|
import type { IAnimationKey } from "./animationKey";
|
|
7
7
|
import { AnimationRange } from "./animationRange";
|
|
@@ -11,6 +11,12 @@ import type { IAnimatable } from "./animatable.interface";
|
|
|
11
11
|
import { Size } from "../Maths/math.size";
|
|
12
12
|
import type { Animatable } from "./animatable";
|
|
13
13
|
import type { RuntimeAnimation } from "./runtimeAnimation";
|
|
14
|
+
export declare const _staticOffsetValueQuaternion: DeepImmutable<Quaternion>;
|
|
15
|
+
export declare const _staticOffsetValueVector3: DeepImmutable<Vector3>;
|
|
16
|
+
export declare const _staticOffsetValueVector2: DeepImmutable<Vector2>;
|
|
17
|
+
export declare const _staticOffsetValueSize: DeepImmutable<Size>;
|
|
18
|
+
export declare const _staticOffsetValueColor3: DeepImmutable<Color3>;
|
|
19
|
+
export declare const _staticOffsetValueColor4: DeepImmutable<Color4>;
|
|
14
20
|
/**
|
|
15
21
|
* Options to be used when creating an additive animation
|
|
16
22
|
*/
|
|
@@ -49,7 +55,7 @@ export interface IMakeAnimationAdditiveOptions {
|
|
|
49
55
|
/**
|
|
50
56
|
* @internal
|
|
51
57
|
*/
|
|
52
|
-
export
|
|
58
|
+
export interface _IAnimationState {
|
|
53
59
|
key: number;
|
|
54
60
|
repeatCount: number;
|
|
55
61
|
workValue?: any;
|
package/Animations/animation.js
CHANGED
|
@@ -9,12 +9,19 @@ import { Node } from "../node.js";
|
|
|
9
9
|
import { Size } from "../Maths/math.size.js";
|
|
10
10
|
import { WebRequest } from "../Misc/webRequest.js";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
export
|
|
17
|
-
|
|
12
|
+
// Static values to help the garbage collector
|
|
13
|
+
// Quaternion
|
|
14
|
+
export const _staticOffsetValueQuaternion = Object.freeze(new Quaternion(0, 0, 0, 0));
|
|
15
|
+
// Vector3
|
|
16
|
+
export const _staticOffsetValueVector3 = Object.freeze(Vector3.Zero());
|
|
17
|
+
// Vector2
|
|
18
|
+
export const _staticOffsetValueVector2 = Object.freeze(Vector2.Zero());
|
|
19
|
+
// Size
|
|
20
|
+
export const _staticOffsetValueSize = Object.freeze(Size.Zero());
|
|
21
|
+
// Color3
|
|
22
|
+
export const _staticOffsetValueColor3 = Object.freeze(Color3.Black());
|
|
23
|
+
// Color4
|
|
24
|
+
export const _staticOffsetValueColor4 = Object.freeze(new Color4(0, 0, 0, 0));
|
|
18
25
|
const evaluateAnimationState = {
|
|
19
26
|
key: 0,
|
|
20
27
|
repeatCount: 0,
|
|
@@ -692,6 +699,7 @@ export class Animation {
|
|
|
692
699
|
* @internal Internal use only
|
|
693
700
|
*/
|
|
694
701
|
_interpolate(currentFrame, state, searchClosestKeyOnly = false) {
|
|
702
|
+
var _a;
|
|
695
703
|
if (state.loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && state.repeatCount > 0) {
|
|
696
704
|
return state.highLimitValue.clone ? state.highLimitValue.clone() : state.highLimitValue;
|
|
697
705
|
}
|
|
@@ -747,7 +755,7 @@ export class Animation {
|
|
|
747
755
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
748
756
|
return floatValue;
|
|
749
757
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
750
|
-
return state.offsetValue * state.repeatCount + floatValue;
|
|
758
|
+
return ((_a = state.offsetValue) !== null && _a !== void 0 ? _a : 0) * state.repeatCount + floatValue;
|
|
751
759
|
}
|
|
752
760
|
break;
|
|
753
761
|
}
|
|
@@ -762,7 +770,7 @@ export class Animation {
|
|
|
762
770
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
763
771
|
return quatValue;
|
|
764
772
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
765
|
-
return quatValue.addInPlace(state.offsetValue.scale(state.repeatCount));
|
|
773
|
+
return quatValue.addInPlace((state.offsetValue || _staticOffsetValueQuaternion).scale(state.repeatCount));
|
|
766
774
|
}
|
|
767
775
|
return quatValue;
|
|
768
776
|
}
|
|
@@ -777,7 +785,7 @@ export class Animation {
|
|
|
777
785
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
778
786
|
return vec3Value;
|
|
779
787
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
780
|
-
return vec3Value.add(state.offsetValue.scale(state.repeatCount));
|
|
788
|
+
return vec3Value.add((state.offsetValue || _staticOffsetValueVector3).scale(state.repeatCount));
|
|
781
789
|
}
|
|
782
790
|
break;
|
|
783
791
|
}
|
|
@@ -792,7 +800,7 @@ export class Animation {
|
|
|
792
800
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
793
801
|
return vec2Value;
|
|
794
802
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
795
|
-
return vec2Value.add(state.offsetValue.scale(state.repeatCount));
|
|
803
|
+
return vec2Value.add((state.offsetValue || _staticOffsetValueVector2).scale(state.repeatCount));
|
|
796
804
|
}
|
|
797
805
|
break;
|
|
798
806
|
}
|
|
@@ -804,7 +812,7 @@ export class Animation {
|
|
|
804
812
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
805
813
|
return this.sizeInterpolateFunction(startValue, endValue, gradient);
|
|
806
814
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
807
|
-
return this.sizeInterpolateFunction(startValue, endValue, gradient).add(state.offsetValue.scale(state.repeatCount));
|
|
815
|
+
return this.sizeInterpolateFunction(startValue, endValue, gradient).add((state.offsetValue || _staticOffsetValueSize).scale(state.repeatCount));
|
|
808
816
|
}
|
|
809
817
|
break;
|
|
810
818
|
}
|
|
@@ -819,7 +827,7 @@ export class Animation {
|
|
|
819
827
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
820
828
|
return color3Value;
|
|
821
829
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
822
|
-
return color3Value.add(state.offsetValue.scale(state.repeatCount));
|
|
830
|
+
return color3Value.add((state.offsetValue || _staticOffsetValueColor3).scale(state.repeatCount));
|
|
823
831
|
}
|
|
824
832
|
break;
|
|
825
833
|
}
|
|
@@ -834,7 +842,7 @@ export class Animation {
|
|
|
834
842
|
case Animation.ANIMATIONLOOPMODE_YOYO:
|
|
835
843
|
return color4Value;
|
|
836
844
|
case Animation.ANIMATIONLOOPMODE_RELATIVE:
|
|
837
|
-
return color4Value.add(state.offsetValue.scale(state.repeatCount));
|
|
845
|
+
return color4Value.add((state.offsetValue || _staticOffsetValueColor4).scale(state.repeatCount));
|
|
838
846
|
}
|
|
839
847
|
break;
|
|
840
848
|
}
|